Re: Select statement

Re: Select statement

 

  

Hi Gloria,

This is what I use when I create a script on the fly. I hope it works for
you.
#
# use these settings to make sure that there are no headings or extra
# stuff
#
set newpage 0
set space 0
set linesize 80
set pagesize 0
set echo off
set feedback off
set heading off

Joan



"Day Gloria " <oracledba-ezmlmshield-x66245002.[Email address protected]
12/02/2004 02:44 PM

To
"LazyDBA Discussion" <[Email address protected]
cc

Subject
Select statement






I have the following select statement to insert 1000 rows from shippers to
shippers2, the problem is that I get a break between the inserts .

Thanks for your help,

Gloria

select 'insert into shippers2 values (' ||shipperid
||','||companyname||','||phone|| ');'
from shippers;

here is part of the result:

'INSERTINTOSHIPPERS2VALUES('||SHIPPERID||','''||COMPANYNAME||''','||PHONE||');'
--------------------------------------------------------------------------------
insert into shippers2 values (980,'Shipper980',264-555-0980);
insert into shippers2 values (981,'Shipper981',266-555-0981);
insert into shippers2 values (982,'Shipper982',268-555-0982);
insert into shippers2 values (983,'Shipper983',270-555-0983);
insert into shippers2 values (984,'Shipper984',272-555-0984);
insert into shippers2 values (985,'Shipper985',274-555-0985);
insert into shippers2 values (986,'Shipper986',276-555-0986);
insert into shippers2 values (987,'Shipper987',278-555-0987);
insert into shippers2 values (988,'Shipper988',280-555-0988);
insert into shippers2 values (989,'Shipper989',282-555-0989);
insert into shippers2 values (990,'Shipper990',284-555-0990);

'INSERTINTOSHIPPERS2VALUES('||SHIPPERID||','''||COMPANYNAME||''','||PHONE||');'
--------------------------------------------------------------------------------
insert into shippers2 values (991,'Shipper991',286-555-0991);
insert into shippers2 values (992,'Shipper992',288-555-0992);
insert into shippers2 values (993,'Shipper993',290-555-0993);
insert into shippers2 values (994,'Shipper994',292-555-0994);
insert into shippers2 values (995,'Shipper995',294-555-0995);
insert into shippers2 values (996,'Shipper996',296-555-0996);
insert into shippers2 values (997,'Shipper997',298-555-0997);
insert into shippers2 values (998,'Shipper998',300-555-0998);
insert into shippers2 values (999,'Shipper999',302-555-0999);
insert into shippers2 values (1000,'Shipper1000',304-555-1000);

1000 rows selected.


--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these terms:
http://www.lazydba.com/legal.html



Oracle LazyDBA home page