Solved

INSERT into Oracle Database multiple text lines not from another DB

Posted on 2012-03-15
4
489 Views
Last Modified: 2012-03-15
have a DB with only one field (LINELN  - varch2 (100)) ... I would like to do a mass insert.
(I'm new to Oracle.  I'm using TOAD)

Example:

insert into my_database VALUES(' 03/01/2012  15:51');   -- works to insert one row.

I want to insert multiple rows (copied from a PDF file and format with required parameters at the beginning and end of each line.  then insert all)

insert into my_database VALUES(' 03/01/2012  15:51');
insert into my_database VALUES('line one of test data');
insert into my_database VALUES('line two of test data');    ---etc

Thanks!!!
0
Comment
Question by:lynn_harris
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:costaf
ID: 37725313
my advice is to use an excel workbook to build an sql insert script. define the main sql statement to run, then copy paste down the number of lines you need and modify the variables you need.
then , you might need to open the resulting sql designed in excel in a notepad ++ to remove the spaces that excel puts when you copy paste the lines , simply by find +replace and voila.
run the inserts statements in a pl/sql or toad and commit.

see the image attached
excel-sql-insert-build.PNG
notepad-replace-spaces.PNG
0
 

Author Comment

by:lynn_harris
ID: 37725657
Thank you... attachments were very helpful.  I was basically doing the same thing and coming up with a number of formatted lines like yourself.  

So ... maybe it is the way i'm executing it.  I cut and pasted all lines into TOAD editor and select execute.   However, it will only process the line my cursor is on.  (not mass insert all lines.)  

toad screen attached.


Thanks for you help!!
insert-doc.docx
0
 
LVL 2

Accepted Solution

by:
costaf earned 500 total points
ID: 37725664
for that you have to execute as script . use the icon with a sheet and a lightning bolt at the right of the normal excecute (green play) button.
0
 

Author Closing Comment

by:lynn_harris
ID: 37725694
Thank you!!!!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now