Re: PERL DBI ORACLE DATABASE OUTPUT TO A FILE

2010-05-11 Thread Bruce Johnson
On May 11, 2010, at 12:25 PM, tech422 wrote: > Hi, > > I am trying to query an Oracle database and output the results to a > file using PERL but its not working. I have tried 2 approaches. 1 uses > bind the other does not. Could you please advise? This is my usual route: while (($col1,$col2,$c

RE: PERL DBI ORACLE DATABASE OUTPUT TO A FILE

2010-05-11 Thread Ian Harisay
I like using Text::CSV_XS for this sort of thing. If your columns in your select are ordered properly you could try the following. use Text::CSV_XS; use IO::File; my $csv = Text::CSV_XS->new({binary=>1, eol=>$/, always_quote=>1}); my $fh = IO::File->new(">somefile.csv"); if(defined $fh){ m

PERL DBI ORACLE DATABASE OUTPUT TO A FILE

2010-05-11 Thread tech422
Hi, I am trying to query an Oracle database and output the results to a file using PERL but its not working. I have tried 2 approaches. 1 uses bind the other does not. Could you please advise?: Using Bind: sub get_cms { $ENV{ORACLE_HOME} = "/usr/local/oracle/OraHome1"; my $unique = 0; open