0 Replies - 6257 Views - Last Post: 21 February 2012 - 10:57 PM

#1 munitjsr2  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 35
  • Joined: 02-April 11

conditional statement for a nomber of records

Posted 21 February 2012 - 10:57 PM

I have got this update script updating certain columns

update oppar
set oppar_run_mode = 0,
    oppar_run_time = 0, 
    oppar_interval_ind = 'N' , 
    oppar_destination = '',
    oppar_run_date ='', 
    oppar_run_interval=''
    where ( oppar_job_name, oppar_job_rec ) 
    in 
     ( ('CSCLM' , 'XYZ')
   , ('ARCLEVEXT' , 'LMN'));



But there are cases where there is no record in the table oppar where the column oppar_job_rec is XYZ or LMN.

Now I need to verify the existence of oppar_job_name=CSCLM then if that exists i need to check the existence of the Job rec coresponding to CSCLM i.e oppar_job_rec=XYZ and if it does not exists i need to add a new record with these details.

[B]oppar_job_name=CSCLM
oppar_job_rec=XYZ
oppar_run_mode = 0
oppar_run_time = 0
oppar_interval_ind = 'N'
oppar_destination = ''
oppar_run_date =''
oppar_run_interval=''[/B]

if it exists then i need to update that row.

please help and tell me if you need more info.

but how do i perform the checking if it could be done and i need to do this on about 100 records with different values for oppar_job_rec .

Orcale9i Enterprise editon release 9.2.8.0 - 64 bit Production

This post has been edited by munitjsr2: 21 February 2012 - 11:01 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1