473,325 Members | 2,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Oracle Error Codes

Hi
Please help ?
I am trying to insert a record in a Oracle table using ASP as front end.In that table, one of feild name Country_ID,for this feild had given the foregin Key ref Country_Master.
I am trying to insert to Country_Id which is not in the Country_master.
So it gives me a error. I need to display the error as user friendly.
I there any Error Object Function in Oracle in which we can get the error code from that error
Oct 4 '07 #1
3 4332
amitpatel66
2,367 Expert 2GB
Hi
Please help ?
I am trying to insert a record in a Oracle table using ASP as front end.In that table, one of feild name Country_ID,for this feild had given the foregin Key ref Country_Master.
I am trying to insert to Country_Id which is not in the Country_master.
So it gives me a error. I need to display the error as user friendly.
I there any Error Object Function in Oracle in which we can get the error code from that error
Make use of SQLCODE and SQLERRM under the EXCEPTION block of the PLSQL code.

Eg:
Expand|Select|Wrap|Line Numbers
  1. DECLARE
  2. a int := 0;
  3. b int := 5;
  4. BEGIN
  5. b:=b/a;
  6. EXCEPTION
  7. WHEN OTHERS THEN
  8. DBMS_OUTPUT.PUT_LINE(SQLCODE||','||SQLERRM);
  9. END;
  10. /
  11.  
Oct 4 '07 #2
debasisdas
8,127 Expert 4TB
You need to

1.Write the insert statment inside a procedure in ORACLE.
2.Handle the exception in the exception block of PL/SQL.
3.Captyre the error number of oracle from ASP.
4.Display the error message you want.
Oct 4 '07 #3
Use exception clause in plsql query.
Jan 8 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: John Benson | last post by:
Thanks much for help with the Oracle db connection problem. That, plus some local assistance getting the sqlnet.ora default domain right, got everything fixed. Now I'm connected, and have been able...
3
by: chelleybabyger | last post by:
my database, sqlplus oracle, has a column ccexpiry, whch is set to date. In my form in asp, there will always be an error whenever i pass in a date that is not in the DD MMM YYYY which is the...
1
by: Peter Monica | last post by:
I am trying to calculate distance from a point entered by a user usng a function in Access in a query that calls tables in an Oracle database as well as in Access. I am getting the following...
13
by: Chris Botha | last post by:
The machine is running XP Pro with all the latest service packs, etc. I must access an Oracle database so I installed the Oracle client stuff. I can query Oracle from a Windows app, no problem....
0
by: tickle | last post by:
Need to convert this PL/SQL script to Dynamic SQL Method 2 * copybook - celg02u3.sql SIR 24265 * * updates dt_deny for all rows in * * ...
0
by: faroz | last post by:
Hi everyone i have a question about updating some columns in oracle forms for e.g i have a page that show u items to buy something..firstly, customer have to enter the datas to order..after...
2
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
5
by: =?GB2312?B?17/HvyBaaHVvLCBRaWFuZw==?= | last post by:
Hi, I would like to have someone comments on what's the best practice defining error codes in C. Here's what I think: solution A: using enum pros: type safe. better for debug (some debugger...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.