Solved

Oracle Error from Coldfusion

Posted on 2010-11-16
3
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 34152429
well i did not understood your question though
0
 
LVL 2

Author Comment

by:sshivanna
ID: 34155492
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
ID: 34170701
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Recently while working on a project I got a very annoying cfdocument has no body error message. I had never seen this error before. So I checked the code. The code was pretty simple; it was Just showing me the cfdocumnt tag and inside that tag a …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

763 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