Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extract ORDER BY from cursor
Message
From
11/09/2008 20:08:23
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346902
Message ID:
01346917
Views:
8
>I have a view that displays table results (viewgrid). In order to have access to all fields in the primary table (incident) when printing, I create a very simple select command:
>
>
>select incident.* ;
>    from viewgrid, incident;
>    where incident.inc_id = viewgrid.inc_id ;
>    into cursor printjob
>
>
>I would think that printjob would retain the fields in the order of viewgrid, but this is not happening. It seems to be in the natural order of incident.
>
>Is there something wrong with my select command? Should I be handling this differently?

I believe your assumption is incorrect. You are not selecting any fields from viewgrid, they are all comming from incident so the fields will be ordered as they are in incident. This code seems awkward, but at first blush you could do something like
SELECT * FROM viewgrid WHERE .f. INTO CURSOR printjob READWRITE   && create the cursor with the right structure

SELECT * ;
    FROM incident;
              JOIN viewgrid ON incident.inc_id = viewgrid.inc_id;
   INTO CURSOR curHold

SELECT printjob
APPEND FROM DBF('curHold')
Previous
Reply
Map
View

Click here to load this message in the networking platform