Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Programming » Application development using SQL » Prepared statements

 

Prepared statements overview

This section provides a brief overview of how to use prepared statements. The general procedure is the same, but the details vary from interface to interface. Comparing how to use prepared statements in different interfaces illustrates this point.

You typically perform the following tasks to use a prepared statement:

  1. Prepare the statement.

  2. Bind the parameters that will hold values in the statement.

  3. Assign values to the bound parameters in the statement.

  4. Execute the statement.

  5. Repeat steps 3 and 4 as needed.

  6. Drop the statement when finished. In JDBC the Java garbage collection mechanism drops the statement.

 Use a prepared statement in ADO.NET
 Use a prepared statement in ODBC
 Use a prepared statement in JDBC
 Use a prepared statement in embedded SQL
 Use a prepared statement in Open Client