Home > Archive > Visual FoxPro SQL Queries > September 2005 > SCAN...ENDSCAN for an table in buffered mode









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SCAN...ENDSCAN for an table in buffered mode
Marc de Vries

2005-09-23, 9:24 am

TABLE: so_line

*art_code art_amt
----------+------------
uren 5
uren 5
uren 90
kant .... <-- sum = 5+5+90=100


TABLE: pc_type

*art_code sub_type
----------+-----------
uren 1 <--------
mat 2
def 3




I want to sum art_amt in the so_line where sub_type = 1 in the pc_type
table. (so_line.art_code == pc_type.art_code)
The sum i want in the table so_line only in the record where art_code =
'kant'
so_line is opened in table-buffered mode so i want to use an SCAN...ENDSCAN
... sum and seek


Anders

2005-09-23, 1:24 pm

Marc
In VFP9 you can use SQL queries that read the buffer by adding WITH
(BUFFERING = .T.) to the FROM Table clause
-Anders

"Marc de Vries" <marc.de.vries@zonnet.nl> skrev i meddelandet
news:%23yaffhEwFHA.2312@TK2MSFTNGP14.phx.gbl...
> TABLE: so_line
>
> *art_code art_amt
> ----------+------------
> uren 5
> uren 5
> uren 90
> kant .... <-- sum = 5+5+90=100
>
>
> TABLE: pc_type
>
> *art_code sub_type
> ----------+-----------
> uren 1 <--------
> mat 2
> def 3
>
>
>
>
> I want to sum art_amt in the so_line where sub_type = 1 in the pc_type
> table. (so_line.art_code == pc_type.art_code)
> The sum i want in the table so_line only in the record where art_code =
> 'kant'
> so_line is opened in table-buffered mode so i want to use an
> SCAN...ENDSCAN
> .. sum and seek
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com