Retrieving results from a select in a procedure
I'm new to Sql and sp's , I'd like to know if such a code is possible :
CREATE PROCEDURE waldataservers.StockQuots (Walident integer)
BEGIN
declare str as String:
select field1 from table1 where (field1=walident);
set str = table1.field1;
select field2 from concat(str,'_tableName') where (field2=v);
...
END;
the syntax "set str = table1.field1" seems incorrect.
I need to "create" the table name automatically for the second query.
I don't know if "select" is the best way to achieve this. Cursors may be a clue, but my tables are "big" (15000 records for "table1"), so a loop with "fetch" would take to much time.
Any ideas ?
Many thanks in advance.
Subject
Views
Written By
Posted
Retrieving results from a select in a procedure
2502
October 12, 2005 11:14PM
1847
October 12, 2005 11:50PM
1710
October 13, 2005 03:35PM
Sorry, you can't reply to this topic. It has been closed.
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.