Re: [DBD::Sybase] Date fileds and syb_date_fmt
[email protected] Thu, 1 Jun 2006 14:05:54 +0200
| Newsgroups | gmane.comp.lang.perl.modules.dbi.sybase |
|---|---|
| Message-ID | <[email protected]> |
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. Michael Internet [email protected]@peppler.org - 01/06/2006 13:42 Sent by: [email protected] To: sybperl-l cc: Subject: [DBD::Sybase] Date fileds and syb_date_fmt Hello, On http://www.annocpan.org/~MEWP/DBD-Sybase-1.07/Sybase.pm 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 ? -- Maxime MARAIS Kertel. 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.