Home » Developer & Programmer » Precompilers, OCI & OCCI » Handling Runtime Errors for Host Arrays
Handling Runtime Errors for Host Arrays [message #338383] Mon, 04 August 2008 16:10 Go to next message
samnyc
Messages: 2
Registered: August 2008
Junior Member
I am trying to update a table with a MERGE command using a Host Array and I am getting a unique constraint violation. According to the Oracle documentation "sqlerrd[2]holds the number of rows processed by the most recently executed SQL statement. However, if the SQL statement failed, the value of sqlca.sqlerrd[2] is undefined, with one exception. If the error occurred during an array operation, processing stops at the row that caused the error, so sqlca.sqlerrd[2] gives the number of rows processed successfully."

So when I catch the error and try to print out the offending row in the host array, it points to the incorrect row. If I change the MERGE command to just an INSERT, sqlerrd[2] now points correctly to the row in error. Is there an issue with MERGE in this respect? How can I get the correct row with MERGE?

Sam
Re: Handling Runtime Errors for Host Arrays [message #338418 is a reply to message #338383] Mon, 04 August 2008 23:38 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Version with 4 decimals for both client and server?

Regards
Michel
Re: Handling Runtime Errors for Host Arrays [message #338623 is a reply to message #338418] Tue, 05 August 2008 08:45 Go to previous message
samnyc
Messages: 2
Registered: August 2008
Junior Member
$ uname -s -r -v -p -i -o
Linux 2.6.9-42.0.3.ELsmp #1 SMP Mon Sep 25 17:24:31 EDT 2006 x86_64 x86_64 GNU/Linux

$ proc -version

Pro*C/C++: Release 10.2.0.3.0 - Production on Tue Aug 5 09:28:32 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.


$ sqlplus

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Aug 5 09:29:16 2008
Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

5 rows selected.

Previous Topic: oracle10g-pro C
Next Topic: Problem on compilation
Goto Forum:
  


Current Time: Tue Dec 17 20:16:43 CST 2024