Link to home
Start Free TrialLog in
Avatar of lulubell-b
lulubell-b

asked on

Update Query

I'm having quite the day, I'm unable to turn this access query into a pl/sql update query.

Please help :)
UPDATE CDB.PRJ_LM TIE 
    SET REC_CHNG_CD = 'U',
    MODIFIED_BY_ID = PARAM_0,
    MODIFIED_DT = SYSDATE,
    STAT_CD = 'I'
    WHERE EXISTS (SELECT T.P_ID P_ID, TIE.LM_ID ID, T.NM NAME,
'N/A' DEF_TX, FROM CDB.PRJ_T T LEFT JOIN CDB.PRJ_LM TIE ON (T.PUB_ID = TIE.PUB_ID) 
AND (T.ID = TIE.ID)
WHERE (((T.P_ID)= 1) 
AND ((T.CHNG_CD)='U') 
AND ((T.TMPLT_STAT_CD)='I') 
AND ((TIE.TIELM_STAT_CD)='A'))

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of hraja77
hraja77

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Naveen Kumar
There are lot of parenthesis missing/incorrect in the above version of your query. So corrected the same.

Try this to see if it works for you.

UPDATE CDB.PRJ_LM TIE
    SET REC_CHNG_CD = 'U',
    MODIFIED_BY_ID = PARAM_0,
    MODIFIED_DT = SYSDATE,
    STAT_CD = 'I'
WHERE EXISTS (SELECT 1 FROM CDB.PRJ_T T
WHERE T.PUB_ID = TIE.PUB_ID
AND T.ID = TIE.ID
and T.P_ID= 1
AND T.CHNG_CD='U'
AND T.TMPLT_STAT_CD='I'
AND TIE.TIELM_STAT_CD='A' )
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulubell-b
lulubell-b

ASKER

Thank you