|
-
Hi, I am new in writing pl/sql code, I hope you can give me a help!
When I tried to run the code as following,
***************************************************
declare
cursor ctron_cur is
select table_name from dba_tables where owner = 'EMP';
c_ctron_rec ctron_cur%rowtype;
begin
if not ctron_cur%isopen then
open ctron_cur;
end if;
spool c:\ctro_tbls.txt
loop
fetch ctron_cur into c_ctron_rec;
if (ctron_cur%notfound) then
exit;
end if;
describ emp.(c_ctron_rec.table_name);
end loop;
close ctron_cur;
spool off
end;
/
***************************************************
I ran into an error message as,
Input truncated to 1 characters
spool c:\ctro_tbls.txt
*
ERROR at line 9:
ORA-06550: line 9, column 8:
PLS-00103: Encountered the symbol "C" when expecting one of the following:
:= . ( @ % ;
If I removed both lines of spool c:\ctro_tbls.txt and spool off and put them before and after excuting this script, then I got this error message:
Input truncated to 1 characters
describ emp.(c_ctron_rec.table_name);
*
ERROR at line 20:
ORA-06550: line 20, column 11:
PLS-00103: Encountered the symbol "EMP" when expecting one of the following:
:= . ( @ % ;
I don't understand why? Does pl/sql take spool and desc in its block? What should I do to make this program run. Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|