dbPrepareSQL |
Top Previous Next |
Syntax INT = dbPrepareSQL(pConnection as POINTER,statement as STRING) Description Prepares an SQL statement for later execution with dbExecute. Parameters pConnection - A pointer to a database returned by dbConnect or dbConnectDSN. statement - The SQL statement to prepare. Return value A handle to the prepared SQL statement or NULL if a statement handle could not be allocated. Remarks A prepared SQL statement is one that has been validated by the driver and converted to the necessary internal representation ready for execution. Prepared statements are used to perform many duplicate updates or insertions into a database table. Using a prepared statement allows simply updating the bound parameters and calling dbExecute for each iteration. The main advantage over direct execution with dbExecSQL is speed of updates and insertions. See Also: dbExecute, dbFreeSQL Example usage hstmt = dbPrepareSQL(pdb,"INSERT INTO Addresses (FirstName,LastName,Address) VALUES(?,?,?)") |