A third option would converting the date columns, in your
select, to a character string.  It would look like:

SELECT TO_CHAR(DATECOLUMNNAME,'YYYY') FROM TABLE...

This will output it as a 4 digit year.

Alan




On Fri, 9 Mar 2001 12:09:27 -0500 
 "Price, Pauline" <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am a recent returnee to the Perl fold.  I last used
> perl 4 and sybperl.  
> Now several years later I am using the latest perl and
> DBI.  Obviously
> I am quite new to the current environment.  I have the
> following code:
> 
> while (my @fetchData = $stBankAccountH->fetchrow_array())
> { 
>       if (!($stBankAccountH->err)) { 
> 
>               my $output = join ("|",@fetchData);
>               print OUT "$output\n";
> 
>       } else {
> 
>               return $flag;
> 
>       }
> 
> My @fetchData array contains 110 columns of which 5 are
> dates.  The string
> $output represents those dates in the format DD-MMM-YY.
> I need to have a
> 4 digit year.  I tried neat_list - same problem, only
> worse, as all values
> were
> quoted as well as separated, which is not good.
> 
> In reading the documentation I have seen that NAME and
> TYPE are available,
> and I think that that could help.  I prefer to iterate
> though the results
> and just
> test the type.  If the type is date, format it
> especially, otherwise just
> concatenate
> the results.  However, I haven't seen any examples in the
> docs so far that
> show
> how to format a returned date.  Or my only recourse to
> format the date in my
> SQL 
> code?    Not Ideal, I'm doing "select *" - and then the
> solution wouldn't be
> general. 
> 
> Of course if the format that I am getting currently,
> DD-MMM-YY, is
> controlled by
> some Perl default, please point me at the setting - I'd
> be so happy.
> 
> Thank you, 
> 
> Pauli   

Reply via email to