Try OpenEdge Now
skip to main content
DataServer for Oracle
Sample Queries : Query 2
 

Query 2

In Query 2 presented in this section, note the following points related to cursor behavior:
<2>    The DataServer uses the cursor to compare schema information and fetch column values.
<2>    The DataServer uses this cursor for customer 2.
<5>    The WHERE clause generated by the DataServer positions the cursor for country-post after customer 2. The ORDER BY clause uses the PROGRESS_RECID column as the final component to guarantee unique ordering.
FIND customer 2.
DISPLAY customer.name customer.custnum customer.postalcode.
FIND NEXT customer USE-INDEX Country-Post.
DISPLAY customer.name customer.custnum customer.postalcode WITH FRAME b.
OCI call OCIStmtPrepare <2> sqlcrc = 41633
SELECT /*+ INDEX(T0 CUSTOMER##PROGRESS_RECID) */ * FROM
DOCTEST.CUSTOMER T0 WHERE PROGRESS_RECID = :rid
OCI call OCIStmtExecute-DescribeOnly <2>
OCI call omru <2>
OCI call OCIHandleAlloc <0>
OCI call OCIStmtPrepare <3> sqlcrc = 53596
SELECT /*+ INDEX_ASC(T0 CUSTOMER##CUST_NUM) */ PROGRESS_RECID
FROM DOCTEST.CUSTOMER T0 WHERE ((CUST_NUM = :1)) order by CUST_NUM
OCI call OCIStmtExecute <3>
OCI call omru <2>
OCI call OCIStmtExecute <2>
OCI call omru <3>
OCI call OCIHandleAlloc <0>
OCI call OCIHandleAlloc <0>
OCI call omru <4>
OCI call OCIStmtPrepare <5> sqlcrc = 49589
SELECT /*+ INDEX_ASC(T0 CUSTOMER##COUNTRY_POST) */ PROGRESS_RECID
FROM DOCTEST.CUSTOMER T0 WHERE ((upper(COUNTRY) = upper(:p1) AND
upper(POSTAL_CODE) = upper(:p2) AND PROGRESS_RECID > :p0) OR
(upper(COUNTRY) = upper(:p1) AND upper(POSTAL_CODE) > upper(:p2)) OR
(upper(COUNTRY) > upper(:p1))) order by upper(COUNTRY),
upper(POSTAL_CODE), PROGRESS_RECID
OCI call OCIStmtExecute <5>
OCI call omru <2>
OCI call OCIStmtExecute <2>
OCI call omru <5>
Cursor <5> Rows processed 20 (last execution)
OCI call OCIHandleFree <0>
Cursor <2> Rows processed 1 (last execution)
Total Rows processed 1 (previous executions)
OCI call OCIHandleFree <0>
Cursor <4> Rows processed 0 (last execution)
OCI call OCIHandleFree <0>
Cursor <3> Rows processed 1 (last execution)
OCI call OCIHandleFree <0>