Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: michael dot peppler at bnpparibas dot com
Subject: Re: [DBD::Sybase] Date fileds and syb_date_fmt
Date: Jun 1 2006 12:05PM

I believe that you are using DBD::Sybase with FreeTDS - and that is almost
certainly a problem with FreeTDS.
I can run this request without calling syb_date_fmt() using the Sybase
libraries with no problem.


Internet - 01/06/2006 13:42

Sent by:

To:    sybperl-l


Subject:    [DBD::Sybase] Date fileds and syb_date_fmt


On I can read
DBD::Sybase returns dates as 'LONG' format. This is the default option.
It appears "SELECT getdate()" runs into a segmentation fault if
syb_date_fmt is not ran to change to some other format (ex. 'ISO') prior
to fetch data from sql requests containing date fields.

Example :

1  use DBI ;
2  my $user = "me";
3  my $pass = "secret";
4  my $conn = 'DBI:Sybase:server=my_server';
5  my $dbh = DBI->connect($conn, $user, $pass);
6  $sth = $dbh->prepare("SELECT getdate()");
7  $sth->execute();
8  #### $dbh->syb_date_fmt('LONG');
9  $sth = $dbh->prepare("SELECT getdate()");
10 $sth->execute();
11 my @rows = $sth->fetchrow_array;
12 print "$rows[0]\n";

- This script crashes line 11.

- Removing sharps line 8 keeps the script crash too.

- Replacing line 8 with $dbh->syb_date_fmt('ISO') runs fine. The script
now displays 2006-06-01 13:00:00.000

Any idea ?


This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 


Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.