Re: ACE Report [?]
Posted in 1997
On 17 Jun 1997, Max wrote:
>
> Greetings!
>
> I realize that ACE reports aren't terribly sexy, but I DO have to work
> with one. To that effect, would someone be so kind as to help me here?
>
> I need to prompt a user for a tablename. That tablename needs to be
> passed to the select statement.
>
> If someone can offer guidance in this regard, I'd appreciate it a great
> deal.
>
> thanks!!!
>
> Max
> pyz@panix.com
Max,
Not in ace, which has to be compiled with an existing table name in
the select statement. Ace wants to see a real table name in its runtime,
arc module. (I think.) Also, if the table name were determined only at
run time, how do you select from specific columns unless you select (*)?
I'm sure others in the group will come up with ingenious solutions,
but this may help for starters.
A few solutions:
1. dynamically create the ace program from user input and then compile
and run it (by far the hardest to do);
2. use a shell script to call dbaccess or isql to write an unload file
whose format is predetermined, then call a compiled ace program to
read the unload file and reformat it;
3. same as 2 but instead use awk or other utilities to re-format the
unload/ascii output file,
4. hardcode all possible reports, have the user select the report in
question, and run it via shellscript.
Yours,
Nick
*********************************
Nick Nobbe, Library of Congress
NLS/BPH
mail: nnob@loc.gov
*********************************
> define
> variable tablename char(12)
> end
>
> input
> prompt for pm_table using "Please enter date using 'rw_pos+yymmdd'
> format: "
>
> select field1, field2, field3, field
> from $tablename
> where field1 = Avalue
> end>