About select into [message #36945] |
Mon, 07 January 2002 03:14 |
orafan
Messages: 8 Registered: December 2001
|
Junior Member |
|
|
When using SELECT INTO statement in PL/SQL, NO_DATA_FOUND exception will be raised if query returns no row.
To handle this error, we have two ways:
1. handle it in the EXCEPTION part of the procedure
2. use SELECT COUNT(*) to determin if query will return no row or not first, then use SELECT INTO statement.
Which one is better( I prefer the first one)?
Is there any other method to handle this error?
|
|
|
|
|
Re: About select into [message #36994 is a reply to message #36945] |
Wed, 09 January 2002 11:13 |
Srinivas Konda
Messages: 29 Registered: October 2001
|
Junior Member |
|
|
Transform your SELECT statement into a cursor, CURSORs never raise a NO_DATA_FOUND EXCEPTION.
You can use your 1st. method but Writing a cursor is a good practice than a select statement.
|
|
|
Re: About select into [message #38189 is a reply to message #36994] |
Fri, 29 March 2002 08:52 |
Ellen
Messages: 5 Registered: April 2000
|
Junior Member |
|
|
select * into existing_tables from old_tables where id = 'adfd'
it did not work because it said "existing_tables" is already in the database.
Is there anyway can overwritten it?
Thanks
|
|
|