Home » SQL & PL/SQL » SQL & PL/SQL » read txt file and update into db
read txt file and update into db [message #257890] Thu, 09 August 2007 07:39 Go to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
testtext.txt format is like

id ( position 1 - 10), name(position 11-50), address (position 51-200), status(position 211-213)

after read the text file , and then it has to update name and status data to the oracle table.

SQL:

Update addresses set (username = 'name from text file', add_status='status')
Where exists (SELECT id FROM addresses s, address ad WHERE s.id = ad.id )

How to read the data and update the value into table?
Re: read txt file and update into db [message #257897 is a reply to message #257890] Thu, 09 August 2007 07:53 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Some conditions are missing in your query but you can use external table for this.

Regards
Michel
Re: read txt file and update into db [message #257902 is a reply to message #257897] Thu, 09 August 2007 08:22 Go to previous messageGo to next message
bbvic
Messages: 24
Registered: October 2006
Junior Member
can i ask you what you mean by external table?
Re: read txt file and update into db [message #257904 is a reply to message #257902] Thu, 09 August 2007 08:32 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
http://www.oracle.com/pls/db102/search?remark=quick_search&word=external+table&tab_id=&format=ranked

Regards
Michel
Previous Topic: disadvantage of package in pl/sql
Next Topic: Splitting one column inti two columns
Goto Forum:
  


Current Time: Wed Dec 07 22:02:40 CST 2016

Total time taken to generate the page: 0.15578 seconds