Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
V6s5 - Make individual slip item details from clubbed de
Message
 
To
19/09/2003 08:00:21
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00830572
Message ID:
00830617
Views:
32
Thanks a lot Cetin for replying. The thing is that I have to send this view/cursor over the wire using ODBC to Report Manager (RM) an external report writer like Crytsal Reports.

Can we still make it sendable over the wire. I can provide RM with sql strings from VFP when calling is ActiveX, if that is of any use.

Please advise.

>>Hi all
>>
>>I have this type of data entry in the Invoice Line Items
>>
>>Case  Case  Item   Item
>>From  To    ID     Qty.
>> 1     1    ABC     5
>> 1     1    DEF     5
>> 2     3    GHI    45
>> 4     4    JKL     3
>>
>>
>>
>>I have to create the view in the following manner for printing purposes
>>
>>Case  Item  Item
>>No    ID    Qty.
>> 1    ABC    5
>> 1    DEF    5
>> 2    GHI   45
>> 3    GHI   45
>> 4    JKL    3
>>
>>
>>Please advise
>
>Bhavbhuti,
>IMHO having this as a view is unnecessary. A view is typically an SQL select. Doing it through code would be efficient :
>
>
>Select From,To, ItemID, ItemQty ;
>   From myTable ;
>   Order By From,To,ItemID ;
>   Into Cursor crsTemp
>Create Cursor crsResult (CaseNo i,  ItemID c(3),  ItemQty i)
>Local array arrRecs[Floor(65000/3),3]
>Local lnRec, ix
>lnRec = 0
>Select crsTemp
>Scan
>  For ix=crsTemp.From To crsTemp.To
>  	lnRec = lnRec + 1
>    arrRecs[lnRec,1] = ix
>    arrRecs[lnRec,2] = crsTemp.ItemID
>    arrRecs[lnRec,3] = crsTemp.ItemQty
>    If lnRec >= floor(65000/3)
>    	Insert Into crsResult from array arrRecs
>    	lnRec = 0
>    endif
>  Endfor
>EndScan
>Dimension arrRecs[lnRec,3]
>Insert Into crsResult from array arrRecs
>Use In 'crsTemp'
>Select crsResult
>Brows
>
Note that array is used to speed up insertion (indiviual inserts would be much slower).
>Cetin
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform