Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL Help??

Re: PL/SQL Help??

From: <schmidm_at_kta95.com>
Date: Fri, 17 Nov 2000 20:52:45 GMT
Message-ID: <8v45qq$5nt$1@nnrp1.deja.com>

I think this should work:
update empl set(cont_name_1, cont_phone_1, cont_rel_1) = (select contact, phone, relation from kta_emerg where num='1' and userid=empl.email_id); update empl set(cont_name_2, cont_phone_2, cont_rel_2) = (select contact, phone, relation from kta_emerg where num='2' and userid=empl.email_id);

but I am getting error:
ORA-01407: cannot update mandatory (NOT NULL) column to NULL even though I have set all null fields in kta_emerg =' '

Thanks
MS

In article <8v43t8$42d$1_at_nnrp1.deja.com>,   schmidm_at_kta95.com wrote:
> I have two tables:
> empl(...,email_id, cont_name_1, cont_name_2, cont_phone_1,
> cont_phone_2, cont_rel_1, cont_rel_2,...)
> kta_emerg(userid, contact, phone, relation,num)
>
> I need to update the empl table values from the values in kta_emerg.
> Specifically, I need:
> update empl set
> empl.cont_name_1=kta_emerg.contact,
> empl.cont_phone_1=kta_emerg.phone,
> empl.cont_rel_1=kta_emerg.relation
> where empl.email_id=kta_emerg.userid and kta_emerg.num='1';
> update empl set
> empl.cont_name_2=kta_emerg.contact,
> empl.cont_phone_2=kta_emerg.phone,
> empl.cont_rel_2=kta_emerg.relation
> where empl.email_id=kta_emerg.userid and kta_emerg.num='2';
>
> I know this isn't the proper syntax, but hopefully someone has a
 simple
> solution!
>
> Thanks
> MS
>
> --
> Martin Schmid
> Applications Developer
> KtaNet
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
Martin Schmid
Applications Developer
KtaNet


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Fri Nov 17 2000 - 14:52:45 CST

Original text of this message

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