SPL
Posted in 2000
Topics: Stored Procedures & SPL
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!
> 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.
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 #
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