Link to home
Start Free TrialLog in
Avatar of Rita060297
Rita060297

asked on

ORA-01432 error

I have the following error in my pro-c program.
(ORA-01423: error encountered while checking for extra rows in exact rows in exact fetch in "select no into :b0 from num@aaa"

num table has and will alway have 1 row of data only.  
The thing is that this error occurs at abnormal times.  At times, it is okay and at other times, the error occurs.
What could be the problem?   This seems to happen after I added the dblink.  Could this affect it?
Avatar of vlad_impala
vlad_impala

The db link will affect it if you do not have the permissions you need.  Are you sure you have the appropriate (SELECT) permissions on "num@aaa", can you select from it via SQL*Plus?
You should get a following error. Check the error stack, and then take the appropriate action...

YOann.
Hi Rita,

Check your alert log file.It will have the error messages.

Run this program and check the alert log immedialtey , You should have more details as to why this is happening.I also supsect that it is due to your permission problems of the database link.

Bye
Somu
Avatar of Rita060297

ASKER

I am able to select statement from SQLPLUS without any errors.

There was no alert log when I ran my program again with this error.

I've removed the dblink in my program and so far the error has not occurred since.   I need to have the dblink in my program.  Was the error related to the dblink?  

Hi Rita,

I think you might not have handled the logic correctly did you check that you have only one record always or do you have more record sometimes , which has not been handled properly.

Bye
Somu
The table always has only one record.  Is there other syntax for selecting only one row from the table?  The table does not have any primary key at all.   The table has a number will increment  and a timestamp.
>The table always has only one record.  Is there other syntax for selecting only one row  >from the
 > table?  The table does not have any primary key at all.   The table has a number will
  >    increment  and a timestamp.

Hai Rita

To select always one row from the table include ROWNUM = 1 in WHERE condition
i.e.,
"select no
    into :b0 from num@aaa WHERE ROWNUM = 1;"
I hope this will work.
JESUS LOVES YOU - sganta
ASKER CERTIFIED SOLUTION
Avatar of sganta
sganta

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The "solution" given by sganta does not resolve the problem. If the table realy has only one row, then there is no need to use ROWNUM=1. However, if there is more than one row in the table, or the wrong table is being accessed, then limiting your select by ROWNUM=1 will only hide the real problem. I'd suggest that you check if the right table is always accessed and that it always has one row. To make sure it contains only one row, you may want to add to it a unique field and define a PK constraint on it. This may help you make sure there is only one record in this table.