PLZ help with sqlplus statement

Philip Greenspun's Homepage : Philip Greenspun's Homepage Discussion Forums : 6916 : One Thread
Notify me of new responses
I am trying to create an sql script that let me changes values more
easy . here is my script :
-------------------------------------------------------------------
variable NUM_CONTRAT varchar2(40);
alter session set nls_date_format='ddmmyyyy';
prompt '-- Verification du client --'
prompt '****************************'
accept NUM_CONTRAT NUMBER prompt 'Numero de Contrat : '

select ref_contrat, nom_rais, cod_sit, d_csr4 from contrat, client
where contrat.con_refcli=client.ref_client and ref_contrat in
('&NUM_CONTRAT');
---------------------------------------------------------------

I would like to insert an IF statement or something else if the
NUM_CONTRAT does not exist it will prompt an error message befor exit
but if exists it will show the result of the select statement and
then prompt you to continue.

thanks in advance

Excuse my english

-- samir chebli, November 27, 2002