RE: substitution variable
Posted in 2000
> -----Original Message-----
> From: Usha M Rao [mailto:usha_mr@trigent.com]
> Sent: 03 March 2000 12:14
> To: informix-list@iiug.org
> Subject: substitution variable
>
>
> 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
Jo
___________________________________________________________________________
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of
Sema Group.
If you are not the intended recipient, be advised that you have received this
email in error and that any use, dissemination, forwarding, printing, or
copying of this email is strictly prohibited.
If you have received this email in error please notify the Sema Group
Helpdesk by telephone on +44 (0) 121 627 5600.
___________________________________________________________________________