Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SCAN Problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00461246
Message ID:
00461323
Views:
20
>First, thanks (No alltrim! DUH!) But even though I removed the ALLTRIM()'s, I'm still getting all records in the child table.
>
>Second, I'm using IDX's cause legacy code is looking for IDX files.
>Bummer, but for now it'll work.
>
>Third, I have a typical one to many, and all fields from table1 and
>table2 need to become a record in table3. So the second SCAN scatters
>each record to a memvar:
>
>
>SELECT Table1
>SCAN
>
>   ** Get's all of the first table's fields on the current record
>   SCATTER MEMVAR
>
>   ** Now loop through all child records and scatter each value to
>   ** memvars

>   SELECT Table2
>   SCAN
>     SCATTER MEMVAR
>   ENDSCAN
>
>ENDSCAN
>
>** Table3 has only matching fields from tables 1 & 2 that I want
>INSERT INTO Table3 FROM MEMVAR
>

>
>See?
Kevin,
You can do all this in one select statment
SELECT , ,
    FROM Table1, Table2 ;
    WHERE Table1.Field1 + Table1.Field2 = Table2.Field1 + Table2.Field2 ;
    INTO TABLE Table3
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform