Solved

Oracle Error from Coldfusion

Posted on 2010-11-16
3
372 Views
Last Modified: 2012-05-10
My insert statement is failing. I want to know the Oracle Error exception that is being thrown as a result.

How do I find the oracle error caused?

Thank you
sshivanna
0
Comment
Question by:sshivanna
3 Comments
 
LVL 15

Expert Comment

by:myselfrandhawa
Comment Utility
well i did not understood your question though
0
 
LVL 2

Author Comment

by:sshivanna
Comment Utility
When you program in oracle and if there is any runtime error, the oracle database usually throws a ORA error. In PL/SQL we use sqlerrm to see what error has occured. How can we accomplish the same in coldfusion?
0
 
LVL 4

Accepted Solution

by:
docnica earned 500 total points
Comment Utility
put your cfquery code inside a cftry, then use

<cfcatch type="Database">
        <h1>Database Error</h1>
        <cfoutput>
        <ul>
            <li><b>Message:</b> #cfcatch.Message#
            <li><b>Native error code:</b> #cfcatch.NativeErrorCode#
            <li><b>SQLState:</b> #cfcatch.SQLState#
            <li><b>Detail:</b> #cfcatch.Detail#
            </ul>
        </cfoutput>
        <cfset errorCaught = "Database">
    </cfcatch>

The native error code and sqlstate are the DBMS original errors.

complete example at: http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0bb9b-7fef.html
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now