Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Need help for error ORA-06550

977256Dec 1 2012 — edited Dec 1 2012
0 down vote favorite


Can any body please help I am getting below error for the code.

ORA-06550: line 20, column 33:

PLS-00306: wrong number or types of arguments in call to '||'

ORA-06550: line 20, column 12:

PL/SQL: Statement ignored

...condition1: if I put value explicitly in my parametrize cursor then it is not reaching till 2nd FOR loop. and after printing 'Inside' statement is executed. Condition2. If I put variable as parameter then it is giving above mentioned error.

DECLARE
/* First cursor */
CURSOR get_tables IS
SELECT DISTINCT * FROM src_table_list tbl ;
/* Second cursor */
CURSOR get_columns(v_table_name varchar2) IS
SELECT SUBSTR (SYS_CONNECT_BY_PATH (column_name, ','), 2) csv
FROM (SELECT column_name , ROW_NUMBER () OVER (ORDER BY column_name ) rn,
COUNT (*) OVER () cnt
FROM USER_TAB_COLUMNS where table_name = v_table_name)
WHERE rn = cnt
-- and col.sn = v_sn
START WITH rn = 1
CONNECT BY rn = PRIOR rn + 1;

BEGIN
FOR i IN get_tables LOOP
dbms_output.put_line( 'Inside ' );
FOR j IN get_columns(i.table_name) LOOP
dbms_output.put_line('SELECT '|| j ||'FROM'||i.table_name||' ;' );
dbms_output.put_line( ' ' );
END LOOP;
END LOOP;
END;
/
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2012
Added on Dec 1 2012
13 comments
360 views