Subject | Stored Procedures!! |
---|---|
Author | draconian2800 |
Post date | 2004-07-20T13:49:09Z |
Hi All!!
How can I in a stored procedure get the table name for the select
statement from the input paramaters??
When I use :
SET TERM !! ;
CREATE PROCEDURE GET_NEXT_KEY(cur_key char(15), table_name char(25))
RETURNS (next_key_val char(15))
AS
DECLARE VARIABLE next_key char(15);
BEGIN
FOR
SELECT FIRST 1 IndexKey FROM :table_name
WHERE IndexKey > :cur_key
INTO :next_key
DO
next_key_val = :next_key;
SUSPEND;
END!!
it tells me that the table name is unknown!!
Thanx!!
Harry Roets
How can I in a stored procedure get the table name for the select
statement from the input paramaters??
When I use :
SET TERM !! ;
CREATE PROCEDURE GET_NEXT_KEY(cur_key char(15), table_name char(25))
RETURNS (next_key_val char(15))
AS
DECLARE VARIABLE next_key char(15);
BEGIN
FOR
SELECT FIRST 1 IndexKey FROM :table_name
WHERE IndexKey > :cur_key
INTO :next_key
DO
next_key_val = :next_key;
SUSPEND;
END!!
it tells me that the table name is unknown!!
Thanx!!
Harry Roets