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: Simple Select Return Record

Re: Simple Select Return Record

From: Vlad Sadilovskiy <vlovsky_at_gmail.com>
Date: Thu, 9 Jun 2005 00:26:26 -0400
Message-ID: <df9f25d505060821263bcbf40b@mail.gmail.com>


try:

select count(*)=20
from dual
where exists (select null from employee_tbl where employeeid=3D5);

On 6/8/05, Kean Jacinta <jacintakean_at_yahoo.com> wrote:
> hi,
>=20
> Trying to query a select statement to check if return
> record existed or not existed.
>=20
> select employeeid from employee_tbl
> where employeeid=3D5;
>=20
> If i type this in SQL*PLus, or sql worksheet , i can
> easily know if the record is found or record not
> existed in the table.Becoz it will display result if
> found .
>=20
> How to know if a record is found or not found in
> programming code.I need the sql statement to return 0
> if not found and return 1 if found.
>=20
>=20
>=20
>=20
>=20
>=20
>=20
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> --
> http://www.freelists.org/webpage/oracle-l
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Jun 09 2005 - 00:31:27 CDT

Original text of this message

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