Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Esther asked whether an SPL variable could hold a table name for use in a FROM clause. ibdn suggested an IF/ELIF chain with one SELECT per table. Paul Watson said dynamic SQL is not allowed in SPL, but an SPL could write and execute another SPL. Avi Abrami said it cannot be done in SPL but can in ESQL/C.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Esther — — source: Informix-list mailing list archive (1991-1998)
I would like if I can store the name of a table into a variable, and
then use it in the FROM clause of a SELECT instead of the table name.
Thank you for your help.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
↪ replying to Esther
ibdn@my-deja.com — — source: Informix-list mailing list archive (1991-1998)
> I would like if I can store the name of a table into a variable, and
> then use it in the FROM clause of a SELECT instead of the table name.
>
> Thank you for your help.
>
Hello
You can use this method:
if variable=='tab1' then
select ... from tab1elif variable=='tab2' then
select ... from tab2...
end if;
With regards,Igor
Sent via Deja.com http://www.deja.com/
Before you buy.
↪ replying to Esther
Paul Watson — — source: Informix-list mailing list archive (1991-1998)
Sorry can't do that, dynamic SQL not allowed. However you can get the
SPL to write another SPL and execute that
Esther wrote:
>
> I would like if I can store the name of a table into a variable, and
> then use it in the FROM clause of a SELECT instead of the table name.
>
> Thank you for your help.
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
--
Paul Watson #
WF Software Ltd # You are only young once
Tel: +44 1436 674728 # but you can be immature
Fax: +44 1436 678693 # for ever
www.wfsoftware.com #
↪ replying to Esther
Avi Abrami — — source: Informix-list mailing list archive (1991-1998)
Esther wrote:
> I would like if I can store the name of a table into a variable, and
> then use it in the FROM clause of a SELECT instead of the table name.
>
> Thank you for your help.
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
Sorry Esther,
As far as I know, this can't be done in SPL. It can be done in ESQL/C, though.
HTH,
Avi.
--
/\\ \\ /| Avi Abrami, Analyst/Programmer, Telegate Ltd.
/__\\ \\ / | 7 Haplada Street, Or-Yehuda, ISRAEL
/ \\ \\/ | Phone:+972-3-5384717 Fax:+972-3-5335877 eMail:avia@telegate.co.il
Your privacy choices
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.