Home » RDBMS Server » Server Administration » Read text file on server. (win xp, oracle 10G R2)
Read text file on server. [message #436095] Mon, 21 December 2009 08:33 Go to next message
JuicyFruit
Messages: 34
Registered: September 2009
Member

Hello!

What I have:

1. Machine with win xp and Oracle 10g r2 installed.
2. Text file on that machine. (e.g. in C:\2.txt).
3. DB on that machine.
4. I am located on remote machine, can only query sqlplus or smthg like that.

What I need:
1. Read all text from that file.
2. Get that text using some "select _____ from _____".

Any thoughts?
Thank you.
Re: Read text file on server. [message #436096 is a reply to message #436095] Mon, 21 December 2009 08:38 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Use external tables to load the file
or
UTL_FILE to load it with pl/sql.
In either case, you need certain DBA privs to create the external directory.
Search forum/google for more details.
Re: Read text file on server. [message #436098 is a reply to message #436095] Mon, 21 December 2009 08:45 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Create a Directory object pointing at the location of the file.
Grant Read on that directory to your user.
Use Utl_File to access the contents of the file.
Previous Topic: how can I get the redo log of one session
Next Topic: ORA-12154: error
Goto Forum:
  


Current Time: Mon Jul 01 00:34:57 CDT 2024