PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: DateTime Values
Date: Nov 28 1997 5:39PM

Bernd.Brinkmann@Bertelsmann.DE wrote:
> 
> Michael Peppler wrote:
> 
> >A patch would be welcome :-)
> >
> >Michael
> 
> O.K. - here it is (just a description for a manual patch):
> 
> In the directory CTlib, you find the file CTlib.xs. Then you have to
> locate the function initialize() - in my Version 2.08.51 of Sybperl this
> is line 1585. In this function several routines are called and after the
> following:
> 
>     if((retcode = ct_config(context, CS_SET, CS_NETIO, &netio_type,
>                             CS_UNUSED, NULL)) != CS_SUCCEED)
>         croak("Sybase::CTlib initialize: ct_config(netio) failed");
> 
> you just have to insert this:
> 
>     if((retcode = cs_dt_info(context, CS_SET, NULL, CS_DT_CONVFMT,
>                             CS_UNUSED, "CS_DATES_LONG", 255, NULL)) !=
> CS_SUCCEED)
>         croak("Sybase::CTlib initialize: ct_dt_info() failed");
> 
> and after recompiling and installation, you'll get the whole datestring
> (on those locations, which did'nt supply this by default). Maybe this
> will go into Sybperl 2.09 ?!

I did it a little differently...

I added the cs_dt_info() api call, so now you can do 

#!/usr/local/bin/perl

use Sybase::CTlib;

cs_dt_info(CS_SET, CS_DT_CONVFMT, CS_UNUSED, "CS_DATES_LONG");

etc...

But also

cs_dt_info(CS_GET, CS_MONTH, 3, $buf);
print "$buf\b";    # prints 'April' for the default locale.

This will be in 2.08_52 which I may release today, as a quick
test before 2.09.

Michael
--
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler