Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
-none-

-none-

2005-02-24       - By -not available-
Reply:     <<     271     272     273     274     275     276     277     278     279     280     >>  

And then put the rest of your code after this.

Tom

-- --Original Message-- --
From: Guang Mei [mailto:GMei@(protected)]
Sent: Wednesday, February 23, 2005 1:23 PM
To: Oracle-L (E-mail)
Subject: how to capture the error when RID value not in the table (pl/sql
question)

I have the following code in a pl/sql procedure (oracle 9i), which is called
a lot.

-- RID is PK column on table Customers
-- p_name is a passed-in parameter
-- p_CustomerRID is a passed-in parameter

SAVEPOINT sp123;

UPDATE Customers
SET Name = p_name
WHERE RID = p_CustomerRID;

IF SQL%ROWCOUNT > 1 THEN
ROLLBACK WORK TO SAVEPOINT sp123;
RaiseError.TooManyUpdates( 'Customers ');
ELSIF SQL%ROWCOUNT = 0 THEN
RaiseError.NoRecordUpdated( 'Customers ');
END IF;

The code works fine now. But I would to change the update sql to

UPDATE Customers
SET Name = p_name
WHERE RID = p_CustomerRID
AND Name != p_name;

to avoid unnecessary redo writing. But if I check SQL%ROWCOUNT for this new
query and get 0, I would not know if it is due to a non-exist RID (Which I
want to capture this situation) or simply p_name already exists for that
RID. Is there a better way of doing this kind of thing, minimize redo
writing and capture the error the same time with only one sql run?

TIA.

Guang


*************************************************************************
PRIVILEGED AND CONFIDENTIAL:
This communication, including attachments, is for the exclusive use of
addressee and may contain proprietary, confidential and/or privileged
information. If you are not the intended recipient, any use, copying,
disclosure, dissemination or distribution is strictly prohibited. If you
are not the intended recipient, please notify the sender immediately by
return e-mail, delete this communication and destroy all copies.
*************************************************************************
--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l

*************************************************************************
PRIVILEGED AND CONFIDENTIAL:
This communication, including attachments, is for the exclusive use of
addressee and may contain proprietary, confidential and/or privileged
information. If you are not the intended recipient, any use, copying,
disclosure, dissemination or distribution is strictly prohibited. If you
are not the intended recipient, please notify the sender immediately by
return e-mail, delete this communication and destroy all copies.
*************************************************************************
--
http://www.freelists.org/webpage/oracle-l