Insert Into problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Robere
    New Member
    • Dec 2007
    • 2

    Insert Into problems

    Hello Experts,

    I have a table app.ca. I have another table app.cb. app.cb has 6 required fields. app.ca contains 5 of those 6 fields. I want the other field to simply be 1. I can not think of how to get the records recorded into app.cb. Here is what I've come up with so far. Can you help me?

    Code:
     INSERT 
    INTO 
        APP.CB 
        (
            EIACODXA, 
            LSACONXB, 
            ALTLCNXB, 
            LCNTYPXB, 
            TASKCDCA, 
            SUBNUMCB
        ) 
        VALUES 
        (
            (
            SELECT 
                APP.CA.EIACODXA 
            FROM 
                APP.CA
            )
            , 
            ( 
            SELECT 
                APP.CA.LSACONXB 
            FROM 
                APP.CA
            )
            , 
            ( 
            SELECT 
                APP.CA.ALTLCNXB 
            FROM 
                APP.CA
            )
            , 
            ( 
            SELECT 
                APP.CA.LCNTYPXB 
            FROM 
                APP.CA
            )
            , 
            ( 
            SELECT 
                APP.CA.TASKCDCA 
            FROM 
                APP.CA 
            )
            ,
            ('1')
        )
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    you may try this

    insert to target_table select f1,f2,f3,'1' from source_table;

    Comment

    • Robere
      New Member
      • Dec 2007
      • 2

      #3
      Originally posted by debasisdas
      you may try this

      insert to target_table select f1,f2,f3,'1' from source_table;
      Sir, this worked. Thank you very much.

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by Robere
        Sir, this worked. Thank you very much.
        you are most welcome .
        i am glad that i could help you.

        Comment

        Working...