OraOpen Function

Action

Associates a cursor with a database connection. A cursor serves to maintain state information about processing a SQL statement. In a test script, multiple cursors can be used at the same time. Usually, immediately after opening a cursor, the OraParse function is called to parse a SQL statement and associate the statement with a cursor.

Include file

Ora.bdh

Syntax

OraOpen( out cCursor     : cursor,
         in  hConnection : number): 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 Variable receiving the cursor associated with the database connection
hConnection Valid handle to a database connection

Example

var
  hConnection : number;
  cCursor     : cursor;

dcltrans
  transaction TMain
  begin
    OraLogon(hConnection, "user", "password", "orclnet2");
    OraOpen(cCursor, hConnection);
    ...
    OraClose(cCursor);
    OraLogoff(hConnection);
  end TMain;

Sample scripts

OraArrayFetch.bdf, OraSample.bdf, OraLoadPers.bdf