p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

sql_language thread: Multiple Inserts With 1 Select Statement


Message #1 by rg1@h... on Wed, 6 Mar 2002 18:33:58
Hi.

I'm updating a SQL 7.0 table with rows that have a "COMMENTS" column 
(defined as VarChar(250)).

I have a COMMENT that is 1000 chars long and because of the length of the 
COMMENT column (I cannot increase it's size) I have to do 4 inserts 
instead of 1 (with the 1000 long comment broken down into 4 comments).

Currently I have 4 "INSERT into" statements, each one with it's 
own "SELECT FROM WHERE".

Now I'm thinking there has to be a more efficient way to do this so that I 
only do 1 "SELECT FROM WHERE" but 4 "INSERT into"s at the same time.

The WHERE clause stays the same for each SELECT FROM.

Any suggestions would be greatly appreciated!

Rita

  Return to Index