SQL in DB2 for AS/400

280 pts.
Tags:
AS/400
DB2
SQL statements
What I have an error when I try to execute the following SQL statement:
UPDATE kfilasm/SCPF exception JOIN KFILasm/LDPF ON
SCAB = JUBBN and SCAN = JUBNO and SCAS = JUSFX
set SCRBA = SCRBA - JUHAMT, SCRBB = SCRBB - JUHAMT
WHERE SCAB||SCAN||SCAS
IN (SELECT JUBBN||JUBNO||JUSFX FROM QTEMP/JUPF2)

Answer Wiki

Thanks. We'll let you know when a new response is added.

You have a sequence error in your SQL Statement

First the UPDATE statement, then the SET, then the JOIN and finally the WHERE

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Messam

    the error massage say:

    Keyword EXCEPTION not expected. Valid tokens: SET.

    280 pointsBadges:
    report
  • ToddN2000
    Is this do be done in Oracle?
    107,975 pointsBadges:
    report
  • Messam
    Dear ToddN2000,

    thanks for kind reply no this is in DB2 DATABASE in AS/400

    280 pointsBadges:
    report
  • Messam

    I Try the following one with the order you advice

    UPDATE MESSAM/SCPF SET SCRBA= SCRBA - JUHAMT, SCRBB= SCRBB - JUHAMT
    A LEFT EXCEPTION JOIN B QTEMP/JUPF ON SCAB = JUBBN and SCAN = JUBNO
    and SCAS = JUSFX WHERE SCAB||SCAN||SCAS IN (SELECT                 
    JUBBN||JUBNO||JUSFX FROM QTEMP/JUPF2)                              

    and I have the error:-

    Token A was not valid. Valid tokens: USE SKIP WAIT WITH WHERE.

    280 pointsBadges:
    report
  • ToddN2000
    Check out IBM link on exception joins here
    107,975 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: