Executes a SQL statement in the current database at the primary data server.
pdb_execute_sql statement
A SQL statement to be executed in the current database at the primary data server.
The pdb_execute_sql command allows simple SQL queries to be executed in a database.
The SQL statement specified in 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 Mirror Replication Agent instance is connected. The default current database is identified by the 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 Mirror Replication Agent instance
is connected.
Any results returned from execution of the SQL statement are passed to the Mirror Replication Agent client, by way of the Mirror Replication Agent administration port.
To find 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 name of the default current database (the primary database
to which the Mirror Replication Agent instance is connected).
The pdb_execute_sql command is valid when the Mirror Replication Agent instance is in either Admin or Replicating state.