Possible Duplicate:
UPSERT into table with dynamic table name
The following procedure is declared as so:
CREATE OR REPLACE
PROCEDURE STUFF(tableToQuery VARCHAR2) AS
BEGIN
MERGE INTO myTable m
USING (select * from tableToQuery) t
ON (m.id = t.id)
... --other stuff
END STUFF;
I receive an ORA-00903 error that states the table name is invalid. My question is how do I get the value that resides within tableToQuery
to equate to a valid table name in the select statement? Assume that I do not know the table name ahead of time.
UPDATE
The function compiles now, however I currently receive the unknown keyword error at the end of my function.