Exemple .SH pour générer un .CSV

sqlplus FYTR_$1/fy$1 < $0.txt
SET echo off
SET termout off
SET feedback off
SET linesize 530
SET trimspool on
SET pagesize 0
SET colsep ‘;’

spool /rmanbackup/octal/extraction/cloture_std_prmof.tmp
select ‘NUM_OF;STATUT_OF;DT_CREAT;DT_LANC;DT_SOLDE;MOIS;SITE;CENTRE;CODE_ARTICLE;LIBELLE_ARTICLE;QTE_LANC;QTE_LIVR;P_UNI_MAT;P_UNI_TAF;P_UNI_MO;P_UNI_TOT;P_LAN_MAT;P_LAN_TAF;P_LAN_MO;P_LAN_TOT;REA_MAT;REA_TAF;REA_MO;REA_TOT;P_LIV_MAT;P_LIV_TAF;P_LIV_MO;P_LIV_TOT;REA_TOT-P_LIV_TOTecart_reel_std;DIRECT_STD;FRAIS_STD;STD;DT_STD;Direct_MAT;Direct_MO;Direct_TAF;Frais_MAT;Frais_MO;Frais_TAF;PRMOF;DT_PRMOF’ titre from dual;

select * from VFY_CLOTURE_STD_PRMOF;
spool off
exit
EOSQL

rm $0.txt
# suppression des lignes SQL
grep -v SQL /rmanbackup/octal/extraction/cloture_std_prmof.tmp > /rmanbackup/octal/extraction/cloture_std_prmof_$1.csv

#rm /rmanbackup/octal/extraction/cloture_std_prmof.tmp

vtcopy -i /rmanbackup/octal/extraction/cloture_std_prmof_$1.csv -o e:\\exploitation_vtom\\extraction_octal\\

exit 0

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *