Quiz - SQL CURSOR code for remote DB access / and SQLCURSOR Decod e syntax

Leslie Tsukamoto leslie.tsukamoto@cae.com
Wed, 9 Oct 2002 15:28:09 -0500


I have posted several questions recently about how to code general quiz
access statements to allow remote connectivity to a database that is hosted
on a different box from the quiz code itself.  I was given great direction
in what definitions in the dictionary needed to exist and then how to
properly reference that data remotely.

Here are two databases currently defined within my local quiz dictionary:

database schdb & 
        type Oracle & 
        open ORACLE & 
        userid "sched1" password "prodpass" owner SCHED1

database simtst & 
        type Oracle & 
        open ORACLE & 
        userid "sched1@simtst" password "cpypass" owner SCHED1

The database referenced with the simtst tag is a copy of the sched1 database
but stored on a remote box - the databas instance name is different, but all
of the tables, views, etc are identical.  In general quiz code I can direct
quiz to access the data locally within my access statement by simply
stating:

access clients in schdb

but if I want to test against the remote database I simply code my access
statement to 

access clients in simtst 


now the issue arises that I have been given some very good directions on how
to code sql cursors within Quiz that allow for much faster and more
efficient data access - however - within that logic I was simply told to
code the select as:

SQL DECLARE X CURSOR FOR &                 
   SELECT * FROM CLIENTS &                              
  WHERE SUBSTRING(CLIENT_TYPE FROM 1 FOR 1) = 'C' &             
        AND STATUS = 'A' &                                   
    

I need to know how to properly qualify that CLIENTS table to properly tell
quiz which database to access - does anyone know the syntax of that
qualification?

Secondly - I have another question about sqlcursor command syntax - as you
can see the substring sqlcursor command is not coded in the same format as a
straight oracle substr - I have a need to send through the sql cursor a
DECODE statement - does anyone know the syntax of how to send through the
DECODE logic into a sqlcursor???

Help on these two issues is greatly appreciated.

Sincerely,  Leslie

Leslie J. Tsukamoto
Manager of Programming, CAE SimuFlite
ph:  407-445-0226
fax: 407-295-9493
email: leslie.tsukamoto@cae.com