Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    4

    Question Unanswered: 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

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •