|
Home > Archive > Programming with dBASE > October 2005 > Local sql problem
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]
|
|
| Alaqn Fitch 2005-10-28, 7:23 am |
| Can anyone offer opinions on the following - (watch for wrap)
// set up fsa names and copy to new table
q.active = false
q.sql = "Select distinct refno,surname from receipt R join fsa F on (r.refno = f.refno)"
q.sql += " Where r.balance > 0 order by f.surname"
q.active = true
q.rowset.first()
u.destination = " :LocalStatementAlias
:tmprefnonames.dbf"
if lflag = true
u.append()
else
u.copy()
endif
The above code works and pulls out all required records.
// set up company names and copy to new table
q.active = false
q.sql = "Select distinct co_code,company from receipt R join company C on (r.co_code = c.co_code)"
q.sql += " Where r.balance > 0 and c.co_code > 'C0000' order by c.company"
q.active = true
q.rowset.first()
u.source = q.rowset
u.destination = " :LocalStatementAlias
:tmpcocodenames.dbf"
if lflag = true
u.append()
else
u.copy()
endif
This code only pulls out 66% of records - the first 66% - upto about letter 'S'.
I have tried but am now baffled.
Alan
| |
| Roland Wingerter 2005-10-28, 7:23 am |
| "Alaqn Fitch" wrote
> Can anyone offer opinions on the following - (watch for wrap)
> [...]
> u.source = q.rowset
> u.destination = " :LocalStatementAlias
:tmpcocodenames.dbf"
> if lflag = true
> u.append()
> else
> u.copy()
> endif
>
> This code only pulls out 66% of records - the first 66% - upto about
> letter 'S'.
-------
This is a known bug in Updateset when you reuse a an updateset object. The
solution is to destroy it before using it again.
release object u
u = null
u = new updateset()
etc.
Also make sure that the source rowset is at the first record
(u.source.first()), otherwise not all rows will be processed.
Roland
| |
| Alan Fitch 2005-10-28, 7:23 am |
| > This is a known bug in Updateset when you reuse a an updateset object. The
> solution is to destroy it before using it again.
>
> release object u
> u = null
> u = new updateset()
> etc.
>
> Also make sure that the source rowset is at the first record
> (u.source.first()), otherwise not all rows will be processed.
>
> Roland
>
Thank you, Roland
I can stop pulling my hair out now.
Alan
| |
| Roland Wingerter 2005-10-28, 1:23 pm |
| Alan Fitch wrote
> Thank you, Roland
>
> I can stop pulling my hair out now.
-------
Glad to help.
Roland
|
|
|
|
|