Article View: borland.public.vdbase.data.sql
Article #304Re: Bunch of SQL open
From: David M. O'Neil
Date: Tue, 29 Dec 1998 00:00
Date: Tue, 29 Dec 1998 00:00
33 lines
1942 bytes
1942 bytes
I finally figured out the problem. The original code was,
**Wrong**
select sum((rate* N_of_pages)+ price) AS tot_inv, sum(Etax) AS t_Etax from bill ;
where bill_n= :t_recno save to "temp1.dbf"
select tot_inv, t_Etax from temp1
a= tot_inv
use
drop temp1
**Wrong**
Which give the following error, "Error; Table already open, temp1," when I try
to drop the table. I needed to close the temp1 table. It looked like use wouldn't
close an file opened with the select command, it would only close a file opened
with the use command. But the problem is when I issue the second select command, I
am in a new work area. The code should read;
**Correct**
select sum((rate* N_of_pages)+ price) AS tot_inv, sum(Etax) AS t_Etax from bill
where bill_n= :t_recno save to "temp1.dbf"
use
select tot_inv, t_Etax from temp1
a= tot_inv
use
drop temp1
**Correct**
This closes the temp1 table in it's current work area before opening it again to
get the values, and then recloses it. I'm still not quite sure why I can't get the
values tot_inv and t_Etax without reopening the table. I suppose it just creates
the table, but has no recollection of what tot_inv or t_Etax is.
David
Technical Details
Message-ID:
<36890182.1A319A35@ONeilComputing.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<36819874.659232AA@ONeilComputing.com> <75u0jt$fdm3@forums.borland.com> <36850D4F.AACE8665@ONeilComputing.com> <7634mg$iu24@forums.borland.com> <3687C1C7.C5ADFCE2@ONeilComputing.com> <768n1c$noc16@forums.borland.com> <3687F21F.C2C05A74@ONeilComputing.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,b11ae58a0bc6f72d X-Google-Attributes: gidff5a1,public From: "David M. O'Neil" <David@ONeilComputing.com> Subject: Re: Bunch of SQL open Date: 1998/12/29 Message-ID: <36890182.1A319A35@ONeilComputing.com> X-Deja-AN: 426799909 Content-Transfer-Encoding: 7bit References: <36819874.659232AA@ONeilComputing.com> <75u0jt$fdm3@forums.borland.com> <36850D4F.AACE8665@ONeilComputing.com> <7634mg$iu24@forums.borland.com> <3687C1C7.C5ADFCE2@ONeilComputing.com> <768n1c$noc16@forums.borland.com> <3687F21F.C2C05A74@ONeilComputing.com> Content-Type: text/plain; charset=us-ascii Organization: OCC Mime-Version: 1.0 Newsgroups: borland.public.vdbase.data.sql