Connection.execute()

NES3+Syntax

connection.execute(statement)

Description

The execute() method of the Connection object enables your application to execute a DDL (Data Definition Language) or DML (Data Manipulation Language) query, which does not return a Cursor, supported by your database. This includes statements such as CREATE, ALTER, and DROP.

Note

Be sure to use SQL that conforms to your database.

Example

Listing 8.16 deletes all rows with a UID less than the number passed to the script.

Listing 8.16 Using the execute() Method to Run DML Queries
 <SERVER> // Assign the UID passed to the client object client.uid = request.uid; // Execute a DELETE based on the UID passed myConn.execute('DELETE FROM employees WHERE uid < ' + client.uid); ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.