Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
V6s5 - Make individual slip item details from clubbed de
Message
From
19/09/2003 08:50:45
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:
00830624
Views:
25
This message has been marked as the solution to the initial question of the thread.
Then create crsResult (or named dynamically) as a free table (if you want also you could create a view in your DBC getting data from that table).
Cetin

>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform