Help with Cursor in QDESIGN

Ken Langendock Ken at Langendock.com
Wed Mar 5 10:16:47 CST 2008


Hello all, I need some help with making my screen work the way I want it
too.
 
I have a table (simplified version):
RECORD Users
  UserId CHARACTER * 8, &
  UserName CHARACTER * 40
 
On a screen the User can select to view the data in UserId or UserName order
by means of a function key (toggle switch).
I use a variable (not actual syntax)
 
Element T-Option CHARACTER * 1 
  Values "C" CAPTION "Code" 
         "D" CAPTION "Description"
 
In my screen I created a cursor to handle the orderby but I have no idea if
I can "override" a field size in the statement.
See below, SortField needs to be the same size (character * 40) for the
Cursor to work but I can't get the syntax to work.
Maybe this needs a declare clause embedded...not sure
 
@if ORACLE
SQL IN MYDB &
   DECLARE UsersCursor CURSOR FOR &
     SELECT Users.UserId, &
            Users.UserName, &
            Users.UserName AS SortField  &
       FROM Users &
      WHERE 'D' = :T-Option &
    UNION ALL &
     SELECT Users.UserId, &
            Users.UserName, &
            Users.UserId AS SortField  &
       FROM Users &
      WHERE 'C' = :T-Option &
   ORDER BY SortField
 
CURSOR UsersCursor PRIMARY &
       ALIAS Users &
       OCCURS 17
@else
FILE Users PRIMARY &
     OCCURS 17
  ACCESS VIA UserId &
         SEQUENTIAL
@endif

Any help would be appreciated.
Ken
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20080305/306bf625/attachment.html


More information about the powerh-l mailing list