> -----Original Message-----
> From: Mark Riehl [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, January 13, 2002 4:29 PM
> To: [EMAIL PROTECTED]
> Subject: dump_results() Question
>
>
> All - I'm running under ActiveState on Win2k and using MySQL.
>
> I'm using dump_results() to print the results of a database
> query. I need to print the same result to multiple files
> with different delimiters and formats.
>
> Questions
> 1. Is there a way to use the same statement handle result set
> without calling another execute()? Do I need an execute()
> for each dump_results() call? I'd like to make one execute
> call, and write the results to multiple files.
Yes, you will have to execute on each dump, since all dump does is
iterates through the database with fetch() and dumps while it does that.
You can easily solve this by redirecting STDOUT to a string, and then
printing this string to multiple files.
>
> 2. I'm trying to tab delimit the file, and used the following
> statement:
>
> my $rows = $sth->dump_results(80, '\n', '\t', $SH);
>
> However, I end up with '\t' (single quote \t single quote) as
> my delimiter, not an actual tab.
That's because you are single quoting it. Use "\t" instead.
Ilya
>
> Any suggestions?
>
> Thanks for the help,
> Mark
>