Executes a SQL statement in the current database at the primary data server.
pdb_execute_sql statement
A string in the form of a SQL statement enclosed in double quotes.
The Replication Agent instance executes the specified SQL statement against the “current” database.
The current database is either:
The default current database, which is the primary database specified in the Replication Agent pds_database_name configuration parameter, or
The database specified in the pdb_set_sql_database command (to which the Replication Agent instance is currently connected).
To set or change the current database, use the pdb_set_sql_database command.
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 or change the current database, the pdb_get_sql_database command returns
the name of the default current 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"
The string is passed directly to the database for execution. No command to terminate is required and no syntax or other validation is performed.
Any results returned from execution of the SQL statement are passed to the Replication Agent administrative client, by way of the Replication Agent administration port.
The pdb_execute_sql command is valid when the Replication Agent instance is in either Admin or Replicating state.