#!/usr/bin/perl use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use Oraperl; use db_tool; use Net::SMTP; use MIME::Base64 qw(encode_base64); my $lda = db_connect("dwh_maint") || die "$ora_errstr\n"; print header(-attachment=>'rfc.csv',-type=>'text/csv'); CSV_wird_generiert(); sub CSV_wird_generiert { my $stmt = qq~select M_AUFTRAGSNUMMER, M_LEISTUNGSART, M_PHASENDAUER, SAP_KST_SENDE, SAP_KST_EMPFANG from MAX_ABR where K_ABRECHNUNGSMONAT = '01.09.2002'~; my $cursor = &ora_open($lda,$stmt) or die "$ora_errstr\n"; while (my @row = &ora_fetch($cursor)){ $row[4] =~ tr/\n\r//d; print join(";",@row[0..4]),"\n"; } &ora_close($cursor); &ora_commit($lda) or die "$ora_errstr\n"; }