|Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)
Part Number B10118-01
Executes the SQL statement and creates an OraSqlStmt object from the specified SQL statement and options.
Set orasqlstmt = oradatabase.CreateSQL(sql_statement, options)
||Any valid Oracle SQL statement.|
||A bit flag indicating the status of any optional states of the sqlstmt object. You can combine one or more options by adding their respective values.|
Options Flag Values
||Do not perform automatic binding of database parameters.|
||Raise error and do not create SQL statement object.|
||To execute SQL in non-blocking state|
The SQL statement can be one continuous line with no breaks. If it is necessary to break the line, be sure to use line feeds (ASCII 10). Do not use carriage returns (ASCII 13), because the underlying Oracle database functions treat carriage returns as null terminators.
You can use PL/SQL bind variables in conjunction with the OraParameters collection.
Executing the SQL statement generates a commit to the database by default. To avoid this, use BeginTrans on the session object before using CreateSQL.
When executing PL/SQL blocks or calling stored procedures, you must include a BEGIN and END around your call as if you were executing an anonymous PL/SQL block. This is equivalent to the EXECUTE command of SQL*Plus and SQL*DBA.
If ORASQL_FAILEXEC is used, an error will be raised during SQLstatement object creation failure (on SQLstatement object refresh). The SQLstatement object will not be created and cannot be refreshed.
See Asynchronous Processing for further information on ORASQL_NONBLK option.
Note: Use CreateSQL with care, since any SQL statement or PL/SQL block that is executed might cause errors afterward when you use the Edit method on open dynasets.