Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with Select Statement
Message
From
13/06/2004 06:26:08
Emmanuel Huybrechts
Technimeca International Corp.
Montréal, Quebec, Canada
 
 
To
13/06/2004 04:45:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00912946
Message ID:
00913202
Views:
21
Very clever Fabio. I never thought it would be possible to do this with a single SQL-select. Bravo.

>
>I already had a salesman number, so that was not an issue.
>
>I really appreciate this, the code worked perfectly.
>
>Mel Cummings
>

>If you add this index ( ALSO TEMPORARY BEFORE EXECUTING THE SELECT ) to child table:
>
>SELECT Child
>INDEX ON BINTOC(id_field)+CHR(selesManNum) TAG primTag && this is a candidate index for Child table
>or
>INDEX ON BINTOC(id_field)+CHR(selesManNum) TO sys(2023)+'\primTag' && this is best for temporary index
>
>
>you can rewrite this select with the best efficient code possible:
>
>
>SELECT	parent.id_field				;
>,	parent.FirstName	;
>,	parent.LastName 	;
>,	parent.Address	;
>,	parent.city 	;
>,	parent.State	;
>,	parent.zip 	 ;
>,	LOOKUP(child.FirstName,BINTOC(id_field)+CHR(1),child.id_field,"primTag")FirstName1	;
>,	LOOKUP(child.LastName,BINTOC(id_field)+CHR(1),child.id_field,"primTag")	LastName1	;
>,	LOOKUP(child.FirstName,BINTOC(id_field)+CHR(2),child.id_field,"primTag")FirstName2	;
>,	LOOKUP(child.LastName,BINTOC(id_field)+CHR(2),child.id_field,"primTag")LastName2	;
>...
>,	LOOKUP(child.FirstName,BINTOC(id_field)+CHR(20),child.id_field,"primTag")	FirstName20	;
>,	LOOKUP(child.LastName,BINTOC(id_field)+CHR(20),child.id_field,"primTag")	LastName20	;
>FROM parent
>
>
>This run into 1 or 2 ms
>
>Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform