Skip to Content
-1

Delete contents of table column

Hi,

I have a database table with approx 63 million records.

I have to delete the contents of 2 specific columns prior to running a piece of code.

Is there a delete statement for deleting the contents of only certain columns while still retaining the columns in the structure of the table?

Wouldn't the update statement have to be run for every row , thus affecting performance if used to replace data with a blank in a certian column?

Regards,

Cleo

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Mar 14 at 07:24 AM

    An Open SQL statement is at the end operated by your database system, so go to the forums/documentation of the software vendor (Oracle, SAP HANA, Microsoft Server SQL, IBM DB/2, etc.)

    But of course UPDATE ... SET ... is a well known SQL statement, which does a mass update, not one by one. In fact, technically, it will always be one by one, but it's not at the ABAP side of course, and it's always more performing than multiple updates.

    Note that you may also define in the DDIC an update database view so to select only the primary key and columns you want to update, and do the UPDATE ... FROM TABLE update_database_view.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14 at 07:29 AM

    Create a new DSO without the two fields. Create a transformation and DTP from DSO1 to DSO2 - direct map, push down to HANA if you're at the right level and are using HANA. Create another transformation and DTP from DSO2 to DSO1.

    Now, in your process chain, run the first DTP, drop DSO1 using CL_SQL_STATEMENT for native SQL, run the second DTP.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 13 at 01:09 PM
    -1

    I believe there is no another way to update each row in the table.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 14 at 01:25 AM
    -1

    Yes. There is no way without UPDATE SET statement.

    Add comment
    10|10000 characters needed characters exceeded