Home » SQL & PL/SQL » SQL & PL/SQL » sqlca.sqlcode when oracle goes off
sqlca.sqlcode when oracle goes off [message #283088] Mon, 26 November 2007 01:35 Go to next message
satish@123
Messages: 15
Registered: February 2006
Junior Member
hi,

while executing query, If oracle shutdown or aborted then can we get the sqlcode for that type of situations. by seeing sqlcode i should know "oracle killed or went down". OR Any other way to predict this?
Re: sqlca.sqlcode when oracle goes off [message #283097 is a reply to message #283088] Mon, 26 November 2007 01:52 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes you get a return code indicating something went wrong.
It may be different depending on your client version (actually this is the client part that gives you the code) and when (in which part of Oracle code) the deconnection is detected.
Often it is "Not connected".

Regards
Michel
Re: sqlca.sqlcode when oracle goes off [message #283101 is a reply to message #283097] Mon, 26 November 2007 02:00 Go to previous messageGo to next message
satish@123
Messages: 15
Registered: February 2006
Junior Member
yes ofcourse we can get the code. My opinion is " Is there any specific code for that"

For Ex:
If sqlcode == [some]
printf(" Oracle not available");
Re: sqlca.sqlcode when oracle goes off [message #283117 is a reply to message #283101] Mon, 26 November 2007 02:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
As I said, there is no specific code but many depending on which part of the code the error is detected.
Most often it is "ORA-03114: "not connected to ORACLE"" but not always. You can have "ORA-12153: "TNS:not connected"" or others.

Regards
Michel
Re: sqlca.sqlcode when oracle goes off [message #283159 is a reply to message #283117] Mon, 26 November 2007 04:02 Go to previous messageGo to next message
satish@123
Messages: 15
Registered: February 2006
Junior Member
thanks, Michel..

Can we know in any other way "such a way that error got is because of oracle system failure but not from the queries wrong implementation"


Re: sqlca.sqlcode when oracle goes off [message #283165 is a reply to message #283159] Mon, 26 November 2007 04:12 Go to previous messageGo to next message
Michel Cadot
Messages: 64140
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is query wrong implementation?
- syntax error
- no data found
- single-row subquery returns more than one row
maybe few others, the rest are system errors.

Regards
Michel
Re: sqlca.sqlcode when oracle goes off [message #283256 is a reply to message #283159] Mon, 26 November 2007 09:13 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Are you serious in wanting to code explicit messages for the case that the database goes down unexpectedly?
What kind of application would need that?
Previous Topic: how to clone the record
Next Topic: PLS-00103: Encountered the symbol "(" when expecting one of the f ollowing: := . ) , @ % d
Goto Forum:
  


Current Time: Fri Dec 09 09:41:14 CST 2016

Total time taken to generate the page: 0.69431 seconds