sql
Executes a SQL statement or a PL/SQL stored procedure against a sharded database.
Syntax
sql "sql_statement"Options
Table 2-99 GDSCTL sql Options
| Option | Description |
|---|---|
sql_statement |
Enter the SQL statement or PL/SQL stored procedure to be executed. Do not include a semi-colon (;) after the SQL statement to be executed. |
Usage Notes
This command can only be executed against a sharded GDS pool. The statements are executed in the GDS catalog database and are then broadcast to all shards in the pool. Since there can be only one sharded pool in a GDS configuration, all SQL statements executed on the catalog database are applied to this pool, if it exists.
Database objects created by this command in the catalog database are used as a schema of the sharded database and are not intended to store user data. The only exception is tables duplicated on all shards (reference tables) – they are populated with data in the catalog database.
SELECT statements are not allowed as the parameter.
The SQL statement or PL/SQL stored procedure to be executed must be enclosed in double quotation marks.
If the string that GDSCTL passes to PL/SQL contains a filename, then the filename must be enclosed in single quotation marks.
Do not include a semi-colon (;) after the SQL statement to be executed.
Examples
Using the gdsctl sql command.
GDSCTL> sql “CREATE TABLESPACE SET ts1 IN SHARDGROUP sgr1"