Results 1 to 3 of 3

Thread: multirow

  1. #1
    Join Date
    Nov 2003
    Posts
    20

    Red face Unanswered: multirow

    Hi, I have created a query to update my table. I take the values to update it puting in join trhee tables. this join return to me 4 rows and the column to update are 4. It's possible to update my column with multi value (4 in this case)?

    this is my query...

    UPDATE DBFN01.CLIENT_BD_TOTAL AS TC
    SET TC.PERCCOERNOTCOER =
    (
    SELECT (PERCENTAGE-T.PERCTOTASSETCLASS) PERCCOERNOTCOER
    FROM DBFN01.CLIENT_BD_TOTAL T
    LEFT OUTER JOIN(
    SELECT * FROM DBFN01.CLIENT_BD_TOTAL T ,
    DBFN01.RPFPFMMULBANKID RPF,
    DBFN01.PFMASSCLASSBDENTRY P
    WHERE RPF.PROFILEID=T.RISKPROFILEID AND RULEID=1
    AND RPF.PTFID=P.PTFID AND T.ASSETCLASSID=P.ID) TEST
    ON (T.EXTERNALID=TEST.EXTERNALID)
    WHERE T.ACLEVEL =2 AND T.EXTERNALID = '001994275_REF'
    )

    WHERE ACLEVEL =2 AND EXTERNALID = '001994275_REF'

    thk

  2. #2
    Join Date
    Jul 2006
    Location
    Pune , India
    Posts
    433
    No,
    ur join shld return 1 value

  3. #3
    Join Date
    May 2006
    Posts
    82
    As rahul told you cannot do that. By the way what do you mean by
    "It's possible to update my column with multi value (4 in this case)?"

    If the select query in the SET clause results more than one value DB2 would through you some negative error code. It should fetch one and only one value. You cannot use FETCH FIRST 1 ROW ONLY also. The conditions in the WHERE predicate should be qualified for one row only.

Posting Permissions

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