Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select from a DBF table
Message
 
 
To
15/05/2019 17:24:47
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01668631
Message ID:
01668647
Views:
52
>>Hi,
>>
>>Can I SQL Select from a DBF table and increase a number of records according to a column?
>>
>>Here is an example.
>>Table of the following structure:
>>
>>PART #      PART DESCR                QTY
>>'ABC'         Abc Part                       1
>>'CBS'         Cbs Part                       2
>>'NBC'        Nbc Part                       5
>>'ESPN"      ESPN Part                      0
>>NFL           NFL Part                      10   
>>
>>
>>Then the resulting cursor should have the same structure (resulting cursor of temporary name). And the number of records would increase according to the QTY column. For example, part "NBC" would be entered 5 times (5 records). And ESPN 0 records.
>>
>>TIA
>
>With the dbf alone no.
>With a second dbf yes.
>
>create cursor x (qty int)
>for k=1 to 100 && max(qty)
>  insert into x values (m.k)
>next
>select a.* from table a join x on x.qty <= a.qty into ...
>
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform