-
October 14th, 2007, 12:39 PM
#1
SQL - write UPDATE script to read a text/excel file
I trying to use below two scripts to read a text/excel file and then implement a UPDATE sql command
This is to extract from filename in order to update every individual user's name. But i encounters two problems, can anyone help to solve???
1) When i run below script, the output turns out looping 1st name instead of populating the whole list in text/excel file. How to solve?
set serveroutput on;
declare
f utl_file.file_type;
s varchar2(200);
begin
f := utl_file.fopen('firedirectory','filename','R');
utl_file.get_line(f,s);
utl_file.fclose(f);
dbms_output.put_line(s);
end;
/
2) How should i use below UPDATE script to implement into above? Please advice.
UPDATE ocgen008individual
SET ind_imagepath_v = 'filename' + '.JPG'
WHERE ind_nricno_v = 'filename';
COMMIT;
-
January 17th, 2008, 09:43 AM
#2
Driver Terrier
Well Korito
From the looks of it you have copied this script but failed to read the accompanying explanation. The script just gets the first line of the text file... which is why your update always has the same name.
You need to put it in a loop and work out a way to terminate the loop when you reach eof. more on utl_file
Never, ever approach a computer saying or even thinking "I will just do this quickly."
Similar Threads
-
By thia in forum Windows 95/98/98SE/ME
Replies: 6
Last Post: March 15th, 2006, 02:10 PM
-
By TechZ in forum Tech News
Replies: 5
Last Post: December 1st, 2004, 12:28 AM
-
By marik in forum CD-ROM/CDR(-W)/DVD Drivers
Replies: 5
Last Post: September 16th, 2004, 03:55 AM
-
By bmb0704 in forum CD-ROM/CDR(-W)/DVD Drivers
Replies: 2
Last Post: July 30th, 2004, 07:54 AM
-
By ilovetheusers in forum Tech Lounge & Tales
Replies: 6
Last Post: July 23rd, 2002, 03:04 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks