Runs a SELECT query and returns the result set.
class JDBC method .executeQuery()
JDBC is the Apps Script service.
.executeQuery() is the method name you will see after a dot in your code.
What it does
Why it's used
- SELECT rows from a database into your script.
- Refresh a sheet tab from a warehouse table.
Common errors
- Forgetting parentheses on executeQuery. Write JDBC.executeQuery(), not JDBC.executeQuery or executeQuery by itself.
- Skipping dots between chained calls. Each step needs a dot, like JDBC.executeQuery().
- Adding spaces where they do not belong. Write JDBC.executeQuery(), not JDBC .executeQuery(), JDBC.executeQuery (), or JDBC . executeQuery().
- Wrong capitalization. Use JDBC and executeQuery, not jdbc or executequery.
Explore
Related methods
-
.executeUpdate()
Runs an INSERT, UPDATE, or DELETE statement.
-
.createStatement()
Creates a SQL statement to run against the database.
-
.getConnection()
Opens a connection to an external SQL database.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about JDBC.executeQuery().