get every result of a query to use after in other query
I'm trying to get every result of a query to then print an output and make other query with the result. I'm trying to make it with a Cursor. But when I try to print the query result it says me:
My code is:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
-- Store the SELECT query in a cursor
CURSOR l_cur IS select memname from emuser.DEF_TABLES@controlm t, emuser.DEF_JOB@controlm j where (t.TABLE_ID = j.TABLE_ID) and t.sched_table = 'DWHRAC_DIARIOS2_DC2';
--Create a variable that will hold each result from the cursor
-- Open the Cursor so that we may retrieve results
-- Get a result from the SELECT query and store it in the variable
FETCH l_cur INTO l_cur_rec;
-- EXIT the loop if there are no more results
EXIT WHEN l_cur%NOTFOUND;
-- INSERT INTO another table that has the same structure as your results
--here I write the other query---
-- Close the cursor to release the memory
Could you help me please? Thanks
And what is it you do not understand about the PLS-00306 error?
Originally Posted by mmm286
PLS-00306: wrong number or types of arguments in call to 'string'
This error occurs when the named subprogram call cannot be matched to any declaration for that subprogram name.
The subprogram name might be misspelled, a parameter might have the wrong datatype, the declaration might be faulty,
or the declaration might be placed incorrectly in the block structure.
For example, this error occurs if the built-in square root function SQRT is called with a misspelled name or with a parameter of the wrong datatype.
Check the spelling and declaration of the subprogram name. Also confirm that its call is correct, its parameters are of the right datatype,
and, if it is not a built-in function, that its declaration is placed correctly in the block structure.
"The person who says it cannot be done should not interrupt the person doing it." --Chinese Proverb
Click Here to Expand Forum to Full Width