If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Informix Update statement - Syntax error - Simple question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-11-04, 20:54
MES MES is offline
Registered User
 
Join Date: Sep 2003
Posts: 4
Question Informix Update statement - Syntax error - Simple question

Hi ya'll,

I'm running the following update statement through informix but it comes up with a syntax error.
Can someone please enlighten me as to how this statement is wrong?

I think it's the update portion of the statement that may be incorrect not the where claus, but please correct me if i'm wrong!!!!

I normally work with SQL and ORACLE......so this sounds like a stupid question for all you informix gurus....

update orguffc set
suff2 = a.dsc_no1,
shortsuff2 = b.trn_grp
FROM aualrefn A, auglacta B, orgsuffc t
WHERE
trim(cast(A.ref_val as char)) = trim(cast(B.trn_grp as char)) and
cast(A.ref_typ as char) = 'trn_grp' and
trim(b.lgr_acc) = t.account + '.' + t.suffix
Reply With Quote
  #2 (permalink)  
Old 05-11-04, 21:39
tolosano tolosano is offline
Registered User
 
Join Date: May 2004
Posts: 2
You wrote :
http://www.dbforums.com/newreply.php...e=1&p=3675756#
Update table_2
set column_1 = value_1,
column_2 = value_2
from table_0 A, table_1 B, table_2 t
where < Join Conditions >

This is wrong.

It should have be written as follows :

Update table_2
set column_1 = (select value_1 from table_0 a, table_1 b
where << join condition between table_0 and table_1 >>
and << join condition with table_2 >>),
column_2 = (select value_2 from table_1 b, table_0 a
where << join condition between table_0 and table_1 (if necessary) >>
and << join condition with table_2 >> )

where exists (select "x" from table_0 a, table_1 b
where << join condition between table_0 and table_1 >>
and << join condition with table_2 >> )


Regards,

Eduardo (tolosano)
http://www.dbforums.com/newreply.php...e=1&p=3675756#
La Plata,
Prov. Buenos Aires.
Argentina
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On