Home » RDBMS Server » Server Utilities » wanted information about UTL_FILE or TEST_IO
wanted information about UTL_FILE or TEST_IO [message #69495] Mon, 21 January 2002 22:42 Go to next message
Shrirang
Messages: 8
Registered: October 2000
Junior Member
Dear Friends,
I have came to know (thr' this message board itself )that there exists 2 packages namely UTL_FILE(server side) and TEXT_IO(client side) with the help of which we can convert the oracle database to a text file with
whatever separator we want.
I just wanted to know that where do I find these packages and how do i pass parameters to them.
Urgent help is highly appreciated.
Thnaks in Advance.
Re: wanted information about UTL_FILE or TEST_IO [message #69499 is a reply to message #69495] Tue, 22 January 2002 03:21 Go to previous messageGo to next message
Vijay Kamath
Messages: 4
Registered: January 2002
Junior Member
Use SQL loader utility to convert tables to Text format . Use UTL_FILE only to read/write from files. They are available to all schemas.
Here are some of the function availbale under this:
UTL_FILE.FOPEN (
location IN VARCHAR2,
filename IN VARCHAR2,
open_mode IN VARCHAR2)
RETURN UTL_FILE.FILE_TYPE;

UTL_FILE.IS_OPEN (
file IN FILE_TYPE)
RETURN BOOLEAN;

UTL_FILE.FCLOSE (
file IN OUT FILE_TYPE);

See Oracle Documentation available with Oracle Database, under Oracle Supplied Packages
Re: wanted information about UTL_FILE or TEST_IO [message #69503 is a reply to message #69499] Tue, 22 January 2002 04:39 Go to previous messageGo to next message
Shrirang
Messages: 8
Registered: October 2000
Junior Member
hi,
i have used SQL loader to load a textfile format data (separated by comma) into oracle.But i dont know how to do vice a versa(i.e. how do i get table fields into textformat as we get it in foxpro thr' some commands.)
If u can help me how to use SQL laoder to do thsi that would be a great help to me!
Thanks in advance.
Re: wanted information about UTL_FILE or TEST_IO [message #69507 is a reply to message #69495] Tue, 22 January 2002 23:32 Go to previous messageGo to next message
jitendra
Messages: 11
Registered: January 2002
Junior Member
Getting the data from oracle table to text file can be done as :

Write the following into one file and run that file.

set heading off
set term off
set line 1000
spool tab1.dat
select * from tab1;
spool off
set term on
Re: wanted information about UTL_FILE or TEST_IO [message #69529 is a reply to message #69499] Sun, 27 January 2002 09:36 Go to previous messageGo to next message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
spool data into text file using SPOOL command in SQLPLUS

SQL> spool xyz.txt
SQL> select empno,ename from emp;

SQL>spool off
Re: wanted information about UTL_FILE or TEST_IO [message #69946 is a reply to message #69499] Thu, 21 March 2002 09:44 Go to previous message
vijay jadhav
Messages: 1
Registered: March 2002
Junior Member
I am using the UTL_FILE facility I have written program but error is comming that is "Unhandle
User Exception " and error number is 74.
i am not getting. Please send me Proper information .I am waiting for your reply.
Previous Topic: Steps for registering database in recovery catalog
Next Topic: Re: Sqlplus password problem
Goto Forum:
  


Current Time: Fri Mar 29 08:46:44 CDT 2024