Skip to Content
avatar image
Former Member

I want to insert only 2 fields using insert stmt....

Hi All,

I want to insert only 2 fields into a database table from a work area. How can i do it using an insert statement. i sont want other fields to be affected.

Tell me if its possible thru an insert stmt or ihave no other option except using a modify statement

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Aug 22, 2007 at 01:08 PM

    Hi,

    u can make use of update statement...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 01:12 PM

    Hi,

    you can use like this UPDATE with SET option

    UPDATE ZTABLE 
                  SET FIELD5 = wa_field5
                         FIELD6 = wa=field6
                  where FIELD1 =  Wa_field1 and
                           FIELD2 =  Wa_field2 and
                           FIELD3 =  Wa_field3 and
                           FIELD4 =  Wa_field4.

    Regards

    Sudheer

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 01:15 PM

    You can use update statement.

    UPDATE tablename SET fieldname = value

    WHERE based on the conditions.

    Thanks,

    Sriram Ponna.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 01:26 PM

    Using Insert statement u can only add new record to the databse.

    Using Update u can only change an existing record.

    Using Modify

    if record doesnt exist it will be inserted.

    if esixts then it will be modified.

    i.e. insert+update.

    Now if u like to insert only two fields then populate only two fields in the work area kepping rest of the fields blank. then insert into table.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 22, 2007 at 01:27 PM

    Hey...guys, i want to insert a new record if tat record does not exists.

    Assume tat no record by tat ket exists, then i want to insert tat work area contents to database table, with only 2 fileds. think there r 10 fields in database table and i want to insert a new record wit only 2 fields i it?

    Add comment
    10|10000 characters needed characters exceeded