I would like to export in .csv
file results of the following query using a SQL Script (not using a Toad tool).
The objective is to use this SQL script by an external tool : eControl-M Workload Automation - BMC This tool just has to execute this sql Query + export script Can you please help me ?
SELECT * FROM TABLE
I found this script. What do you think about this script?
SET COLSEP ";"
COL colonne1 FORMAT A25
COL colonne2 FORMAT A30
COL colonne3 FORMAT A30
COL colonne4 FORMAT A12
COL colonne5 FORMAT A20
COL colonne6 FORMAT A25
SET TERM OFF
SET AUTOTRACE OFF
SET VERIFY OFF
SET ECHO OFF
SET FEEDBACK OFF
SET HEAD ON
SET LINESIZE 1000
SET PAGESIZE 5000
SET TRIMSPOOL ON
SPOOL &1; --- Mettre la destination du fichier en lieu et place du &1 ---
--- ta requete ---
select....
SPOOL OFF;
EXIT;
-- Normalement tu vas pouvoir te débrouiller avec ça