Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Dynamic SQL in PL/SQL

Re: Dynamic SQL in PL/SQL

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 20 Apr 1998 00:42:25 GMT
Message-ID: <353a9986.489223@192.86.155.100>


A copy of this was sent to Christian Scholz <christian.scholz_at_syskoplan.de> (if that email address didn't require changing) On Mon, 20 Apr 1998 00:30:59 +0200, you wrote:

>I have a problem with the DBMS_SQL Package in a PL/SQL Procedure.
>I try to generate a INSERT INTO statement and execute it with dynamic
>SQL.
>This works fine with a short statement. When I try to parse a long
>statement with DBMS_SQL.PARSE(... ); the Database throws an exeption.
>The sql error is -936.
>I tried to use an PL/SQL table as the parameter, too.
>I work with an Oracle 7.3 Server running PL/SQL on the server.
>Are there known Problems with Dynamic SQL and long statements?
>What does the error mean?
>How can I get information about the errorcode from the system?
>
>I would be pleased about every help.
>
>Christian Scholz
>
>

I think the statement you are building is in error. 936 is "Missing Expression" meaning, the sql statement was syntatically incorrect. You might consider creating a table like:

create table error_log ( stmt long );

and after you catch an exception from dbms_sql, simply insert the statement you were trying to parse into this table, commit it and re-raise the exception. that way, you can look at the statement to see what it is you built.

I've parsed very long strings using dbms_sql, it works.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Sun Apr 19 1998 - 19:42:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US