cancel
Showing results for 
Search instead for 
Did you mean: 

Using Delete in SQL_DML

Former Member
0 Kudos

Hi all,

I am Using 2 structures for update insert and delete.

All the records would be inserted first.and need to delete if Status=0 or O.

how to define structure for this and what is the SQL query.

Thanks,

Srinivasa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Refer SAP help doc for this

http://help.sap.com/saphelp_nw04/helpdata/en/64/ce4e886334ec4ea7c2712e11cc567c/frameset.htm



UPDATE dbTableName  SET col1=u2019val1u2019, col2=u2019val2newu2019 
WHERE ((col2=u2019val2oldu2019 AND col4=u2019val4u2019) OR (col2=u2019val2old2u2019))

<StatementName1>
 <dbTableName action=u201DUPDATEu201D | u201CUPDATE_INSERTu201D>
     <table>realDbTableName</table>
  <access>
       <col1>val1</col1>
       <col2>val2new</col2>
  </access>
  <key1>
       <col2>val2old</col2>
       <col4>val4</col4>
   </key1>
   <key2>
        <col2>val2old2</col2>
    </key2>
</dbTableName>
</StatementName1>

Thanks

Swarup

Edited by: Swarup Sawant on Dec 30, 2008 10:49 AM

Answers (1)

Answers (1)

former_member9864
Participant
0 Kudos

Hi Potharaju,

because you want to evaulate the return status of the first INSERT action, I would rather suggest you the following:

Use a Stored Procedure. How the structure looks like, you can refer to the sap help docu:

http://help.sap.com/SAPHELP_NW04S/helpdata/EN/2e/96fd3f2d14e869e10000000a155106/content.htm

Following blogs would be helpful:

Regards,

Chen