[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Help in getting data into CSV file



possibly, just possibly,  he does not have access to Perl in his workplace and 
is forced by circumstance to use SQR? Another reason might be that he has no 
training in Perl. One would think that if he had Perl training and the ability 
to use it in his workplace, he wouldn't have been posting here in the first 
place, no?

>>> George Jansen <GJANSEN@AFLCIO.ORG> 2001/10/23 9:13:44 am >>>
Why use SQR for this? Why not use Perl DBI? SQR is fine for many
purposes, but for dynamic manipulation of text and of lists of dynamic
length, a scripting language such as Perl, Python, or Tcl will be a lot
quicker.

my $stmt_txt = &build_statement($dbh, $var1, $var2);

my $sth = $dbh->execute($stmt_txt);

while (my @fields = $sth->fetchrow_array()) {
   print '"', join('","', @fields), '"', "\n";
}


Of course this omits considerations such as special characters in you
fields, which is like omitting consideration of bends in the road, other
cars, etc. while you are driving, but it gives you something to start
with.



>>> ashish_bhatt@HOTMAIL.COM 10/22/01 07:55PM >>>
Hi Peoplesoft and SQR Gurus,

I hope you are doing fine today.

I have in  $select_statement all my column names, table name and the
condition.

My $select_statement is as below. It returns multiple rows.

let $select_statement  = "select
EMPLOYER_APPROVED,PREV_SABB_ELIG_DT,AUDIT_OPRID from PS_AUDIT_ABS_HIST
where AUDIT_STAMP < SYSDATE - 1300;"

I want to run this in SQR and get data in CSV (Comma Separated) file.

In the above statement fields and tables are dynamically created -
meaning that no fix number of columns. The columns comes from
ALL_TAB_COLUMNS.

Is it possible in SQR ? Please reply.

Thanks in advance.

Have a nice day and great weekend.

Regards.

Ashish Bhatt.