DBprepareStatement


Synopsis

Prepares the user issued SQL statement.

Input Ports

ptr dbvisual_connect_descriptor – connection to database engine

string sql_statement – valid SQL ‘Select’ statement

int process_statement – trigger to invoke the method

Output Ports

ptr dbvisual_connect_descriptor – connection to database engine

ptr dbquery_descriptor – prepared query handle

int done – finished processing? Can be used as a trigger to downstream modules

Description

This group needs a valid connection handle passed down from DBconnect group, whose interface was not modified. It retrieves the connection information from the handle and a valid “select” statement from the user, then creates a statement handle once process_statement is set to 1.

This will be a local operation only, no server round-trip required. If successful, a valid statement handle will be created and passed downstream. Otherwise, NULL value will be passed as the pointer. In either case, status will be updated, message will be displayed and attribute done will be set to 1 to indicate end of processing only when executed successfully.

See Also

DBexecuteStatement, DBdefine