# Syntax
The syntax of SQL and PSQL statements can be checked without running them using the syntax:
```
local check sql "SQL"
```
The statements are one quoted value, so a PSQL block or several statements separated by `;` are checked together. A double quote inside the SQL is written twice. Variables such as `${NAME}` are replaced before the check.
The check parses the statements exactly as they are parsed before they run, but it reads no metadata or data and sends nothing to a platform. A table, column or data container which does not exist is therefore not found by the check, but only when the statements run.
When the statements are valid, the message itgenqtl309 reports so. When they hold a syntax error, the statement fails with the same error as running the statements would raise: a message code of the `itgensyn` series, the line and column, an excerpt with the error marked, and what is valid at that position. See [[Syntax Errors]] for the meaning of each code. Use [[On Error]] to continue the script after an error.
# Examples
The following example checks a query before it is run:
```
local check sql "select * from Payroll.Employees where Name like 'A%'"
```
The following example checks a PSQL block holding several statements:
```
local check sql "begin dbms_output.put_line('Start'); dbms_output.put_line('End'); end;"
```
The following example checks a query with a quoted identifier; its double quotes are written twice:
```
local check sql "select ""Name"" from Payroll.Employees"
```
The following example checks the query held in a variable and continues the script when it is not valid:
```
local define QUERY "select * from Payroll.Employees"
local on error continue
local check sql "${QUERY}"
```