tags:

views:

53

answers:

1

Here is my query:

UPDATE TBL_LABELS SET TMP.column_value = LBL.label_desc, TMP.info_value=LBL.helptext
       FROM TBL_LABELS TMP
       INNER JOIN hh_label_mast LBL ON TMP.column_name=LBL.lbl_id
       WHERE page_id in(as_page_id ,'HHGENPGID')
       AND lang_cd= as_langcd;

While executing this I am getting an error like "right syntax to use near FROM TBL_LABELS TMP INNER JOIN hh_label_mast LBL ON TMP.column_name=LBL.lbl_"

Can you please give me the right syntax?

+3  A: 

There shouldn't be a FROM clause in the UPDATE syntax. You may want to try:

UPDATE      tbl_labels TMP
INNER JOIN  hh_label_mast LBL ON (TMP.column_name = LBL.lbl_id)
SET         TMP.column_value = LBL.label_desc, 
            TMP.info_value = LBL.helptext
WHERE       page_id IN(as_page_id ,'HHGENPGID') AND lang_cd = as_langcd;
Daniel Vassallo
thanks for your answer
narenderreddy
@narenderreddy: You may want to mark the answer as accepted if it was helpful. You can do this by clicking on the green tick on the left.
Daniel Vassallo