Lynn Harris
asked on
INSERT into Oracle Database multiple text lines not from another DB
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!!!
(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!!!
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!!!!
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