Re: Question Regarding Select Into

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 22 Dec 2005 14:38:17 -0800
Message-ID: <1135291081.709017_at_jetspin.drizzle.com>


OracleNewbie wrote:
> Oracle Gurus,
>
> DECLARE
> A VARCHAR2 (30 BYTE);
> BEGIN
> A := '';
>
> SELECT FIELDNAME INTO A
> FROM EXCELTABLEDEF
> WHERE ROWNUM = 1 AND CST = 'RP_DAT' ';
> DBMS_OUTPUT.PUT_LINE (A);
> END;
>
> The above works fine if it finds a record. If there is no record then
> it throws up the following error
> ORA-01403: no data found
> ORA-06512: at line 6
>
> I can have the exception to handle it. But, is there a way where i can
> have some value if it doesn't return anything like ISNULL(A, 'TBLS')
>
> Again, ppl i'm new and my question might too simple or ultimate
> stupidity. If you know and can guide me do post else dont post some
> crap like what one of the guy "Frank" in this group do. He thinks he is
> an Big **le in Oracle.

www.psoug.org
click on Morgan's Library
click on Exceptions

-- 
Daniel A. Morgan
http://www.psoug.org
damorgan_at_x.washington.edu
(replace x with u to respond)
Received on Thu Dec 22 2005 - 23:38:17 CET

Original text of this message