Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
V6s5 - Make individual slip item details from clubbed de
Message
 
À
19/09/2003 08:00:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00830572
Message ID:
00830617
Vues:
31
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
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform