This content has been marked as final. Show 2 replies
You can do this either with a simple sql script within sqlplsu or write some pl/sql procedure using utl_file - there is no default tool that explicitly is used for unloading data into text file.
Try this as a start point in sqlplus - just update the SQL you want to use.
set colsep '&|'
set pages 0
set heading off
set feedback off
select 'XX','XX','$#' from dual;
You can use UTL FIle concept. Sample code as below. make sure you are providing both read and right grants to dba_directory and also make sure you have enough buffer size for UTL. You can flush out utl buffer at regular interval inside script
OUTPUT_File VARCHAR2(provide size):= 'filename.txt';
FILE_OUTPUT := UTL_FILE.FOPEN ('DBA_DIRECTORY_NAME',OUTPUT_File,'W');
FOR CUR_OUT IN (
SELECT COL1 || 'Delimeter' || .. COLn record_set from tablename