DB2 INSERT INTO vs SELECT INTO

In DB2 if you need to populate a table, you need to use INSERT INTO, like in this example:

INSERT INTO new_table
SELECT col1,col2 FROM source_table
WHERE col1='something';

and if you need to populate query variable, you need to use SELECT INTO, like in this example:

SELECT * INTO :var1, :var2, :var3FROM table_name
WHERE col1= 'something'; 

Source: DB2 Documentation

This entry was posted in DB2 and tagged , , , , , , , . Bookmark the permalink.

NewPush has solutions to fit your business needs.  For more than a decade, our focus has been to take on the technical challenges that are the hardest and most time-consumming.  Our goal is to free up your resources to focus on the core activities of your business and to drive your business performance.  Please visit our main site at newpush.com for more information or call us at +1-303-423-4500.