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 -> Simple Update Question

Simple Update Question

From: EnderW <ender29_at_my-deja.com>
Date: Thu, 30 Dec 1999 15:26:30 GMT
Message-ID: <84fsv4$lvh$1@nnrp1.deja.com>


Hi,
  I know my sql stinks and I don't want to write a pl/sql block for a simple update. I need two update statements. I will run them one after another. The problem is I don't want the update statements to put a null value in the column if there is no corresponding value. Here's the update

update tmp_combined_rpt_defn tcrd

   set hier_nbr = (

       select distinct cy.class_id
         from class_yr cy
        where cy.class_nbr = tcrd.class_nbr )
The problem is there are occasions when there is no matching class_id for some rows. In that case, I donot want the hier_nbr to be updated. I tried something like

select distinct nvl(cy.class_id, hier_nbr) and it didnot work. Any presents for the christmas.

--
Ender Wiggin

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Thu Dec 30 1999 - 09:26:30 CST

Original text of this message

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