Cybersecurity
Nov 13, 2020
1 min
DB2 INSERT INTO vs SELECT INTO
N
NewPush TeamAuthor
In DB2 if you need to populate a table, you need to use INSERT INTO, like in this example:
INSERT INTO new_tableSELECT col1,col2 FROM source_tableWHERE 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_nameWHERE col1= 'something';
Source: DB2 Documentation