Results 1 to 7 of 7
  1. #1
    Join Date
    May 2004
    Posts
    184

    Unanswered: checking for oracle error prior to execution of code

    I have a web based application with its own db that uses a remote database link to another application. I'm writing an error handler in my web app to determine if the remote database link is available but having a difficult time capturing the error in a nice clean way.

    When the remote db server is offline, I receive the expected error of "Connect failed because target host or object does not exist ". Since my webapp is Server Side JS try,catch doesn't work because this is a DB error not a JavaScript error.

    Is there a built in procedure/function in Oracle that will evaluate a statement like "select * from mytable@remote_db" to determine if it will generate an error before I actually execute this or do I need to write an error handling procedure in Oracle to handle this?

    Thank you.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    use DBMS_ERROR_PREDICTOR
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Nice one Ana
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    May 2004
    Posts
    184
    Given the source, it doesn't suprise me that I'm unable to find this command anywhere.

  5. #5
    Join Date
    Feb 2007
    Location
    Bratislava, Slovakia
    Posts
    85
    use select sysdate from dual@REMOTE_DB for test if connection is live
    Beer contains just a small amount of vitamines - that's why it's necessary to drink lot of it.

  6. #6
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    Sure you can use try/catch on the connection object you used on JS to connect to Oracle ??

  7. #7
    Join Date
    May 2004
    Posts
    184
    baloo and J,

    Thanks. I've actually tried catching the error using the JavaScript catch/try, but it hasn't worked. It may be due partly because I don't have an off the shelf version of Netscape SSJS. I guess I'll have to write an Oracle sp to do this.

    Thanks,

    Robert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •