From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
Creates a PreparedSQLStatement using the SQL statement for use with the various database prepared statement classes. A prepared statement is an SQL statement with parameters that has been pre-processed by the database so that it can be executed more quickly if it is re-used with different parameters. Prepared statements also mitigate the risk of SQL injection in web apps.
To create a prepared statement, you assign the value of Prepare to appropriate class for the database you are using.
Refer to the specific PreparedStatement class for the database you are using to learn how to specify and bind parameters:
SQL Injection is a way to attack database-driven applications.
To create a prepared statement, you use the appropriate class for the database you are using. For example, to create a prepared statement for PostgreSQL:
Var ps As PostgreSQLPreparedStatement
ps = db.Prepare("SELECT * FROM Country WHERE code = $1")