OraParse2 Function

Action

Parses a SQL statement or PL/SQL block passed to the function as a string and associates it with a cursor. It is possible to specify whether the parse should be deferred. In this case, it is parsed immediately before it is described or executed.

Include file

Ora.bdh

Syntax

OraParse2( in cCursor      : cursor,
           in sStatement   : string,
           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.
sStatement 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);
    OraParse2(cCursor, "DELETE FROM persons", ORA_NONDEFERRED);
    OraExec(cCursor);
    OraClose(cCursor);
    OraLogoff(hConnection);
  end TMain;