![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
hi, getting the following error when running the script below. it seems to me that the cursor is retrieving more then one value each loop. any idea how to fix this? error: ERROR at line 10: ORA-06550: line 10, column 19: PLS-00306: wrong number or types of arguments in call to '||' ORA-06550: line 10, column 1: PL/SQL: Statement ignored script: declare cursor u_tab is select table_name from user_tables; u_tab_rec user_tables.table_name%type; begin execute immediate 'create global temporary table temp_tab1 ( col_count number)'; for u_tab_rec in u_tab loop execute immediate 'insert count(*) into temp_tab1 from '||u_tab; end loop; end; |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Try This: declare cursor u_tab is select table_name from user_tables; begin execute immediate 'create global temporary table temp_tab1 ( col_count number)'; for u_tab_rec in u_tab loop execute immediate 'insert into temp_tab1 select count(*) from ' || u_tab_rec.table_name; end loop; end; |
![]() |
| Thread Tools | |
| Display Modes | |
| |