467,209 Members | 1,319 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,209 developers. It's quick & easy.

Insert values into a table B based on a flag on table A

I am totally new to db2 scripting.

I have a doubt. Please help
We have DB2 on our AIX machine. I have two tables (A and B). Table A has a column 'ACTIVE'. There are like 200 rows of data in this Table A. If column 'ACTIVE' =true, then i have to insert few rows of 'Table A' and some other constants in 'Table B'.

Can anyone please provide some sample code to do this.

Appreiciate your help in advance.

Thanks
Sam
Aug 8 '07 #1
  • viewed: 1378
Share:
3 Replies
Insert into tableb (select col1, col2 from tablea where column = 'active');
Aug 8 '07 #2
Motoma
Expert 2GB
Insert into tableb (select col1, col2 from tablea where column = 'active');
Thanks for the help Hevan!
Aug 9 '07 #3
8TB
Insert into tableb (select col1, col2 from tablea where column = 'active');
I rather think they were looking for

Expand|Select|Wrap|Line Numbers
  1. Insert into tableb (select col1, col2  from tablea where active = true);
Aug 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

16 posts views Thread by Philip Boonzaaier | last post: by
7 posts views Thread by David Bear | last post: by
7 posts views Thread by Kevin Lawrence | last post: by
6 posts views Thread by rn5a@rediffmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.