Discussions
Categories
- 197K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.8K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 556 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.4K SQL Developer
- 296.4K Development
- 17 Developer Projects
- 139 Programming Languages
- 293.1K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 161 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 205 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 475 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
creating trigger with dbms_sql causes ORA-01912

herzal
Member Posts: 26
I use the following procedure to execute statements that are stored in clobs. These statements are very long 'create trigger' statements.
ORA-01912: keyword ROW expected
ORA-06512: in "SYS.DBMS_SYS_SQL", Line 1485
ORA-06512: in "SYS.DBMS_SQL", Line 26
ORA-06512: in "NTSDEV6.EXECUTECLOB", Line 14
ORA-06512: in "NTSDEV6.CREATELOGTRIGGER", Line 150
Has anyone an idea what the heck is going on? I can't explain that ORA-01912.
Thanks for your help
SQL> create or replace procedure executeClob(clob_stmt in clob) is 2 3 n_size number := ceil(dbms_lob.getlength(clob_stmt) / 255); 4 n_counter number; 5 6 t_lines dbms_sql.varchar2s; 7 i_cursor integer := dbms_sql.open_cursor; 8 begin 9 10 for n_counter in 1..n_size loop 11 t_lines (n_counter) := to_char(substr(clob_stmt, 1 + 255 * (n_counter - 1), 255)); 12 end loop; 13 14 dbms_sql.parse(i_cursor, t_lines, t_lines.FIRST, t_lines.LAST, false, DBMS_SQL.native); 15 dbms_sql.close_cursor(i_cursor); 16 end; 17 /Every time I call this procedure, I get the following error
ORA-01912: keyword ROW expected
ORA-06512: in "SYS.DBMS_SYS_SQL", Line 1485
ORA-06512: in "SYS.DBMS_SQL", Line 26
ORA-06512: in "NTSDEV6.EXECUTECLOB", Line 14
ORA-06512: in "NTSDEV6.CREATELOGTRIGGER", Line 150
Has anyone an idea what the heck is going on? I can't explain that ORA-01912.
Thanks for your help

Tagged:
Best Answer
-
Herzal wrote:When and how did you test that? - Before putting it into the clob of after splitting clob up into strings.
yes, the create-statement works fine when I paste it directly into sql*plus
Have you tried writing out the contents of your collection before parsing it? - It sounds like a missing chr(10) after FOR EACH ROW
Regards
Peter
Answers
-
Has anyone an idea what the heck is going on? I can't explain that ORA-01912.Did you check for the syntax of the Trigger in the CLOB.
-
yes, the create-statement works fine when I paste it directly into sql*plus
-
Herzal wrote:When and how did you test that? - Before putting it into the clob of after splitting clob up into strings.
yes, the create-statement works fine when I paste it directly into sql*plus
Have you tried writing out the contents of your collection before parsing it? - It sounds like a missing chr(10) after FOR EACH ROW
Regards
Peter -
For the second time: Thank you, Peter
I removed the chr(10) a few hours ago because I thought they would cause a problem, stupid me =p
Now I get another error, ORA-01031: insufficient privileges, but that's something I have to dig into first.
Again: thank you
This discussion has been closed.