Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fancy SQL on child table
Message
From
28/09/2006 17:36:47
 
 
To
28/09/2006 17:28:55
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01157978
Message ID:
01157996
Views:
30
>>Is there any limitation how many Synonyms you can have for one Style?
>
>I only have 8 styles having one synonym right now. But, I know there should be at least 20 styles having at least one synonym. Some of them can go as up to 4 to 5 synonyms.

I just tested to build a SELECT with so many JOINs as the MAX() number of Synonyms in Synonym table. Something like:
CREATE CURSOR Test  (Fld1 I)
CREATE CURSOR Test1 (Fld1 I, FLd2 M)
FOR asd = 1 TO 76
    INSERT INTO Test  VALUES (asd)
    INSERT INTO Test1 VALUES (asd%4+1, REPLICATE([a],asd))
NEXT
SELECT MAX(test) AS test;
 FROM (SELECT Fld1, COUNT(*) AS test;
       FROM Test1;
       GROUP BY Fld1) Tbl1;
INTO CURSOR crsTest

lcStr  = [SELECT Test.Fld1,MAX(]
lcJoin = []
FOR lnFor = 1 TO crsTest.Test
    lcStr = lcStr + IIF(lnFor>1,[+],[]) + [NVL(","+ALLTRIM(Tbl]+TRANSFORM(lnFor)+[.Fld2),"")]
    lcJoin = lcJoin + [ LEFT JOIN Test1 Tbl]+TRANSFORM(lnFor)+[ ON Test.Fld1 = Tbl]+TRANSFORM(lnFor)+[.Fld1]
NEXT
lcStr  = lcStr +  [) AS TestMe FROM Test ]+lcJoin+[ GROUP BY Test.Fld1 INTO CURSOR crsTte]
_cliptext =lcStr
&lcStr
But this almost block my computer :o), in VFP working with NATIVE tables :-).
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform