Executes a SQL statement in the current database at the primary database server.
pdb_execute_sql statement
A SQL statement to be executed in the current database at the primary database server.
The pdb_execute_sql command allows simple SQL queries to be executed in a database.
The SQL statement specified as a parameter of the pdb_execute_sql command must be a single SQL command enclosed in double quotes. For example:
pdb_execute_sql "select * from Authors"
No command terminator is required. No syntax or other validation is performed; the string is passed directly to the current database.
When pdb_execute_sql is invoked, it executes the specified SQL statement against the current database.
The default current database is the primary database to which the Replication Agent instance is connected (as specified by the Replication Agent pds_database_name configuration parameter).
To set or change the current database, use the pdb_set_sql_database command.
If the pdb_set_sql_database command
has not been invoked to set the current database, the pdb_execute_sql command
executes the SQL query against the primary database to which the Replication Agent instance
is connected.
Any results returned from execution of the SQL statement are passed to the client via the Replication Agent administration port.
To find out the name of the current database, use the pdb_get_sql_database command. If the pdb_set_sql_database command has not been invoked to set the current database, the pdb_get_sql_database command returns the default current database.
The pdb_execute_sql command is valid when the Replication Agent instance is in either Admin or Replicating state.
pdb_get_sql_database, pdb_set_sql_database