Find out what is in dbms_sql cursor

765 pts.
Tags:
DBMS
Dynamic SQL
Oracle
I am trying to put in a 5500 character query into dynamic sql, and then use the Oracle dbms_sql function to execute the sql. However, there is an error in the sql statement that is being generated, but the error message doesn't help me identify where the error is, as it pertains to the dynamic sql (i.e. error at line nn). Is there a way for me to get the value of the statement held in the cursor, so that I can see where the problem is? I have tried the dbms_output.put(statement), but that returns an error saying that it is limited to 255 bytes per line. Thanks, Darryn

Answer Wiki

Thanks. We'll let you know when a new response is added.

One option could be to write the statement to a file, using the UTL_FILE package, but it is possible that a similar limitation also exists in that package.

I would use a loop to display the statement (using dbms_output) in 254 byte substrings.

—————————

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following