Hi, I'm creating a stored procedure and inside this procedure I have a
CREATE TABLE statement, but I want to make a dynamic table for this table.
Also, this table name is passed as a parameter for another SP, but instead
of get the value of the parameter, I got the name of the parameter. For
example:
CREATE PROEDURE my_test_sp()
BEGIN
DECLARE my_table CHAR(32);
SET my_table = UNIX_TIMESTAMP();
CREATE TABLE my_table (
id int,
name char(64));
call nested_sp(my_table);
END
CREATE PROCEDURE nested_sp(my_table CHAR(32))
BEGIN
INSERT INTO my_table 1, 'John Doe';
END
of course nested_sp is very silly, but the idea is the same. When I run
this, I found that there is no table name like '20080426...' but I get a
table 'my_table', how can I fix this?
--
Mauricio Tellez

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.