Re: USER in ace reports
Posted in 1994
Topics: SQL Development & Query Writing, Connectivity: ESQL/C, 4GL & Embedded SQL
In article <3c2ltq$9vb@emory.mathcs.emory.edu>,
J. B. Taylor <JBTaylor@lanmail.rmc.com> wrote:
>In an ace report I have two select statements joined by a UNION and the
>results going into a temp table. I would like to use a variable name for
>the temp table being used in order to avoid problems with other users
>attempting to use the same report. What I would like to do is use the
>user name as part of the temp table name.
>
>How can I get this accomplished???
[Sorry if this has been answered before - my newsfeed is having serious
delays.]
Under OnLine 5.03, I-SQL 4.12, trying to use a variable as the temp table name
in ACE causes a syntax error. (The report in question is below.)
I'd guess that your alternatives are to use 4GL or ESQL/<insert your
favorite language here> - I use ESQL/C. These are more flexible
multi-purpose languages, and they both allow you to create an SQL
statement at runtime and have it executed (dynamic SQL), where ACE only
allows static SQL. (Of course, you lose the report-formatting
capabilities of ACE if you do this. There Ain't No Such Thing As A Free
Lunch [tm]. 8^)
Sorry, I don't think you can pull that off.
George
-- report here
database prs end
define
variable temp_name char(16)
end
input
prompt for temp_name using "Enter name for temp table: "
end
select
count(*)
from
users
into temp $temp_name;
select * from $temp_name;end
format
every row
end
-- end of report
--
Mail: gwr@metronet.com (home, preferred) - grapp@cps.cio.eds.com (work)
Phone: 214/604-1036 (voice - work) 214/604-1126 (fax)
At Ford, Quality is Job 1. At Microsoft, Quality is Job 3.1a.
At Intel, Quality is Job 0.9999271828 ...