Solved

INSERT into Oracle Database multiple text lines not from another DB

Posted on 2012-03-15
4
496 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

627 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