Help Center for Power Formulas
  • Home
  • formulas
    • =API()
    • =AI_TEXT()
    • =SQL()
    • =SQLTABLE()
Powered by GitBook
On this page
  • Overview
  • Syntax
  • Parameters
  • Usage
  • Conclusion
  1. formulas

=SQLTABLE()

SQLTABLE Formula: Pull a Table from a MySQL Database to Google Sheets

Overview

The SQLTABLE formula is a custom function that allows you to import an entire table from a MySQL database directly into your Google Sheets without writing any SQL statement. This function supports MySQL, Microsoft SQL Server (sqlserver), and Oracle databases (oracle).

Syntax

SQLTABLE(dbType, host, port, dbName, userName, userPwd, tableName)

Parameters

  • dbType (required): The type of the database. Currently, we support mysql, sqlserver (for Microsoft SQL Server), and oracle (for Oracle database).

  • host (required): The host of the database.

  • port (required): The port of the database. Usually, it's 3306.

  • dbName (required): The name of the database.

  • userName (required): The username for database authentication.

  • userPwd (required): The password for database authentication.

  • tableName (required): The name of the table you want to import.

Usage

To use the SQLTABLE formula, you need to provide all the required parameters. Here's an example:

SQLTABLE("mysql", "example.rd2.amazonaws.com", 3306, "database name", "username", "user password", "table name")

This will pull all the data from the specified table in the MySQL database and import it into your Google Sheets.

Conclusion

By using the SQLTABLE formula, you can seamlessly integrate your database information with your Google Sheets, making data analysis and manipulation easier and more efficient.

Previous=SQL()

Last updated 1 year ago