RE: substitution variable
Posted in 2000
From: "COOPER, Joseph" <Joseph.COOPER@sema.co.uk>
>
> > -----Original Message-----
> > From: Usha M Rao [mailto:usha_mr@trigent.com]
> >
> > In a simple sql query or in a stored procedure language,if I
> > want to use
> > variables in the where condition which should be prompted for
> > the values
> > when I execute it
> > (for eg:select * from emp where empno=&a (in Oracle) When I
> > execute it,it
> > should
> > prompt for a& substitute it and give the o/p).How can I do it
> > in informix?
> >
>CREATE PROCEDURE sp_test ( some_input INTEGER ) RETURNING CHAR(18);>DEFINE retval CHAR(18);
>
> SELECT tabname
> INTO retval
> FROM systables
> WHERE tabid = some_input;>
> RETURN retval;
>
>END PROCEDURE;
>
>Then
>EXECUTE PROCEDURE sp_test(1); -- returns systables
>EXECUTE PROCEDURE sp_test(2); -- returns syscolumns
Mr Cooper!! You're not listening to the question!! :-)
Anyway, I'm not aware of anything that will prompt for input in the
execution of SQL or a stored procedure. You'll probably find that the
feature in question is more of a feature of SQL*Plus than of Oracle's SQL,
anyway.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com