<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>Hello all, I need
some help with making my screen work the way I want it too.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>I have a table
(simplified version):</FONT></SPAN><SPAN class=247380616-05032008><FONT
face=Arial size=2></FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>RECORD
Users</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2> UserId
CHARACTER * 8, &</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2> UserName
CHARACTER * 40</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>On a screen the User
can select to view the data in UserId or UserName order by means of a
function key (toggle switch).</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>I use a variable
(not actual syntax)</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>Element T-Option
CHARACTER * 1 </FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2> Values "C"
CAPTION "Code" </FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier
size=2> "D" CAPTION
"Description"</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>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.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial size=2>Maybe this needs a
declare clause embedded...not sure</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>@if ORACLE<BR>SQL
IN MYDB &<BR> DECLARE UsersCursor CURSOR FOR
&<BR> SELECT Users.UserId,
&<BR>
Users.UserName,
&<BR>
<FONT color=#ff0000>Users.UserName AS SortField
&<BR></FONT> FROM Users
&<BR> WHERE 'D' = :T-Option
&<BR> UNION ALL &<BR> SELECT
Users.UserId,
&<BR>
Users.UserName,
&<BR>
<FONT color=#ff0000>Users.UserId AS SortField
&<BR></FONT> FROM Users
&<BR> WHERE 'C' = :T-Option
&<BR> ORDER BY SortField</FONT></SPAN></DIV>
<DIV><FONT face=Courier size=2></FONT> </DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>CURSOR UsersCursor
PRIMARY &<BR> ALIAS Users
&<BR> OCCURS 17<BR>@else<BR>FILE Users
PRIMARY &<BR> OCCURS 17<BR> ACCESS VIA UserId
&<BR>
SEQUENTIAL<BR>@endif<BR></FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier size=2>Any help would be
appreciated.</FONT></SPAN></DIV>
<DIV><SPAN class=247380616-05032008><FONT face=Courier
size=2>Ken</DIV></FONT></SPAN>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV> </DIV></BODY></HTML>