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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Use of NULL in SELECT statement.

Re: Use of NULL in SELECT statement.

From: Malcolm Turner <mal_at_WCS.DNET.CO.UK>
Date: Sun, 28 Jan 1996 00:44:06 +0100
Message-Id: <9601280054.AA12114@alice.jcc.com>


arvind popli enquired
> Do explain the usage of the following SELECT statement :
>
> SELECT NULL FROM <table_name>;
>
>Thanks,
>arvind.
>

It's quite simple , Arvind.
This select tests whether a row exists, but doesn't have the overhead of retrieving a lot of data. If it's in a cursor, you can then test if cursor%found (or %notfound) and take appropriate action. This sort of select is very useful in a test e.g. is this code in use? Different people use a different syntax - I always use select 'X' to the same effect.

Hope that clarifies it somewhat

Best wishes

Malcolm Turner
Malcolm Turner

Developer,
Wellington Computer Systems
Belfast Received on Sat Jan 27 1996 - 19:54:20 CST

Original text of this message

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