Home » RDBMS Server » Server Utilities » Text file
Text file [message #73340] Tue, 30 March 2004 00:18 Go to next message
Milly
Messages: 72
Registered: March 2004
Member
HI!

I have to export data from oracle to a text file...how can I do this?

thanks!!

 
Re: Text file [message #73341 is a reply to message #73340] Tue, 30 March 2004 03:07 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
'export' means something else in oracle terminology.
In order to create text files with oracle data queried from tables,
you can either
1. do a simple spooling.
bash-2.03$ sqlplus -s mag/mag
spool dummy.lst
select * from dept;

    DEPTNO DNAME          LOC
---------- -------------- -------------
        10 ACCOUNTING     NEW YORK
        20 RESEARCH       DALLAS
        30 SALES          CHICAGO
        40 OPERATIONS     BOSTON

spool off;
exit
bash-2.03$ cat dummy.lst

    DEPTNO DNAME          LOC                                                   
---------- -------------- -------------                                         
        10 ACCOUNTING     NEW YORK                                              
        20 RESEARCH       DALLAS                                                
        30 SALES          CHICAGO                                               
        40 OPERATIONS     BOSTON                                                


2. or use UTL_FILE , an oracle builtin package used read/write from OS files.
Re: Text file [message #73342 is a reply to message #73341] Tue, 30 March 2004 04:31 Go to previous messageGo to next message
Milly
Messages: 72
Registered: March 2004
Member
Thanks, but I have also another problem, I'd launch this export from vb....

Do you think that the exp utility of oracle can help me? And do I have to launch this by a Shell?

Thank you!!
Re: Text file [message #73343 is a reply to message #73342] Tue, 30 March 2004 05:37 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
again,
export utility will NOT export data in text format.
IT will export only in oracle proprietory binary format ( export / import are meant for other purposes)
u have to use UTL_FILE with some simple pl/sql.
call this pl/sql from ur VB.
Previous Topic: very urgent - Deleting Database Link in Oracle 9i
Next Topic: Do I need to ReIndex after Migration?
Goto Forum:
  


Current Time: Sat Jun 29 04:59:17 CDT 2024