OraParse Function

Action

Parses a SQL statement or a PL/SQL block and associates it with a cursor. You can specify whether the parse should be deferred. If you defer parsing, the statement is parsed immediately before it is described or executed.

Include file

Ora.bdh

Syntax

OraParse( in cCursor      : cursor,
          in sqlStatement : sql,
          in nDeferred    : number optional,
          in nVersion     : number optional): boolean;

Return value

  • true if successful

  • false otherwise. In this case, you can use the OraOciError function to retrieve the Oracle OCI error code

Parameter Description
cCursor Cursor associated with a database connection.
sqlStatement SQL statement or PL/SQL block to parse
nDeferred

Specifies whether the parse should be deferred (optional). Possible options are:

  • ORA_DEFERRED. The statement is parsed immediately before it is described or executed (default)

  • ORA_NONDEFERRED. The statement is parsed immediately

  • ORA_OSQL3. Indicates a call of the Oracle osql3 function rather than the oparse function

nVersion

Oracle version (optional). Possible options are:

  • ORA_VERSION_6

  • ORA_VERSION_DEFAULT (default)

  • ORA_VERSION_7

Example

var
  hConnection : number;
  cCursor : cursor;

dcltrans
  transaction TMain
  begin
    OraLogon(hConnection, "user", "password", "orclnet2");
    OraOpen(cCursor, hConnection);
    OraParse(cCursor, sqlDelete, ORA_NONDEFERRED);
    OraExec(cCursor);
    OraClose(cCursor);
    OraLogoff(hConnection);
  end TMain;

dclsql
  sqlDelete:
  DELETE FROM persons;

Sample scripts

OraArrayFetch.bdf, OraSample.bdf, OraLoadPers.bdf