Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: I need to test whether I am getting a result back from a query is it possible?

Re: I need to test whether I am getting a result back from a query is it possible?

From: Arati Vijay <vijayj_at_singnet.com.sg>
Date: Sun, 3 Oct 1999 16:36:22 +0800
Message-ID: <7t74p5$l6p$1@coco.singnet.com.sg>

It is not clear where you are firing the query from.

If it is from within a PL/SQL block - you could check the cursor variable %ROWCOUNT (assuming you're using an implicit cursor).

Alternately, you can track it in the exception no_data_found.

Lastly, you could fire a SELECT COUNT(*) first, and check the value before firing the actual query for the result set, though this is the most inefficient

Regards,
VJ

tony <ramdan_at_mailexcite.com> wrote in message news:CmNI3.14388$q8.473394_at_newscene.newscene.com...
>
>
>
> But how do i determine that no row is returned from the query. I am not
> getting a NULL back. For example
>
> SELECT DECODE(D2_HOLIDAY, NULL , 'x', 'a' ) FROM D2_HOLIDAYS WHERE
D2_HOLIDAY
> = 'cccchristmas_evee'
>
> returns nothing (not a null) when the match does not work)
>
>
> How do I test what came back, since null doesn't work
>
>
>
>
>
> In article <7t00iu$gmn$1_at_newsmaster.pathcom.com>, "John Chiu"
> <johnc_at_relsol.com> wrote:
> >Yes, because there is no row returned from the query.
> >
> >John Chiu
> >
> >
> >tony wrote in message ...
> >>I need to determine if I get a value back from a query, it there is a
value
> >I
> >>use it, otherwise I want to put a string value. I tried
> >>
> >>decode(A.SUPPLIER, NULL, 'NFP', A.SUPPLIER)
> >>
> >>and
> >>
> >>nvl(A.SUPPLIER, 'NFP')
> >>
> >>but I get no results back.
> >>
> >>is that because when there is no data I don't really get a null? what
can I
> >>look for to do this
> >
> >
Received on Sun Oct 03 1999 - 03:36:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US