Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to write native SQL for UPDATE

Former Member
0 Likes
3,662

Hi All,,

Now I need to write a native sql for updating fields in the database table.

when i write like this


 exec sql.
    UPDATE ZTAB_GLTR_DATA
       SET DOCUMENT_ID  = :w_id
     WHERE COMPANY_CODE = :fs_gltr_data-company_code and
               GLTRANID = :fs_gltr_data-gltranid and
                GLROWID = :fs_gltr_data-glrowid
  endexec.

it is working fine

now i need to update two fields for that i wrote like this


 exec sql.
    UPDATE ZTAB_GLTR_DATA
       SET DOCUMENT_ID  = :w_id, POST_DATE  = :w_date
     WHERE COMPANY_CODE = :fs_gltr_data-company_code and
               GLTRANID = :fs_gltr_data-gltranid and
                GLROWID = :fs_gltr_data-glrowid
  endexec.

which is leading to dump.

can any ony tell me how to write the code for updating two fields......

2 REPLIES 2
Read only

Former Member
0 Likes
1,255

Hi,

You check wheater :w_date field is having value while debugging.

Regards,

Joan

Read only

0 Likes
1,255

Yes w_date has value