Re: PL/SQL Newbie

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 21 Feb 2003 16:55:17 -0800
Message-ID: <92eeeff0.0302211655.7f7d160b_at_posting.google.com>


karl_72_at_msn.com (Karl) wrote in message news:<93c10f45.0302210653.1e319d50_at_posting.google.com>...
> Thanks in advance for everyones help. I have been thrown into
> assignment that I know just enough to get me in trouble. Here's my
> question/problem. We have a pre-existing table that we have just
> added an additional column to for a length of varchar 6 and populated
> with 0's. However, now i need to fill them with a value = to a value
> of a corresponding column in the same table.
> I just don't know the exact syntax to accomplish this. I'm thinking
> that I will first check to see if that column has all 0's. If it
> doesn't i will skip that row but if it doesn't I will go ahead with my
> update. Can anyone help. Or do you need more info?
> thanks

Why add another column if afterall, you are going to populate it with same value from a different column in the same table? Doesn't make sense but here is the sql,

UPDATE Blah

   SET new_column = another_column
   WHERE NVL(new_column, 0) = 0;

Regards
/Rauf Sarwar Received on Sat Feb 22 2003 - 01:55:17 CET

Original text of this message