Discussion:
Sybperl and FreeTDS and MSSQL
Ed Avis
2009-07-23 14:03:45 UTC
Permalink
Is it possible to build and run Sybperl using FreeTDS instead of the Sybase libraries?

I am happily using DBD::Sybase with FreeTDS (connecting to MSSQL, in fact) and I
would like to run dbschema.pl too.
--
Ed Avis <***@waniasset.com>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Ed Avis
2009-07-23 16:21:11 UTC
Permalink
I'm not sure if you want to run dbschema against a mssql database.
Yes, that's what I want to do. If you have a modified dbschema program
which works better with MSSQL (even if it still craps out eventually)
I would be interested to see that.
(i'm using the sybase libraries on unix with Sybase's
DirectConnect to connecto to mssql, but that's irrelevant for
the error I get).
I am hoping that I can use FreeTDS rather than installing the Sybase
client libraries. The general question is whether Sybperl (comprising
Sybase::DBlib and Sybase::CTlib) will work with FreeTDS.
--
Ed Avis <***@waniasset.com>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Michael Peppler
2009-07-23 18:15:23 UTC
Permalink
Post by Ed Avis
I'm not sure if you want to run dbschema against a mssql database.
Yes, that's what I want to do. If you have a modified dbschema program
which works better with MSSQL (even if it still craps out eventually)
I would be interested to see that.
(i'm using the sybase libraries on unix with Sybase's
DirectConnect to connecto to mssql, but that's irrelevant for
the error I get).
I am hoping that I can use FreeTDS rather than installing the Sybase
client libraries. The general question is whether Sybperl (comprising
Sybase::DBlib and Sybase::CTlib) will work with FreeTDS.
Sybase::DBlib will certainly work with FreeTDS. And I seem to remember
that David Owen did in fact use dbschema.pl to interact with MS-SQL
servers (at least I believe that there are MS-SQL references in the
code).

Michael
Ed Avis
2009-07-24 10:20:24 UTC
Permalink
Post by Michael Peppler
Sybase::DBlib will certainly work with FreeTDS.
In that case my follow-up question is about this build error:

DBlib.xs: In function 'XS_Sybase__DBlib__DateTime_crack':
DBlib.xs:6068: error: 'DBDATEREC' has no member named 'dateyear'
DBlib.xs:6069: error: 'DBDATEREC' has no member named 'datemonth'
DBlib.xs:6070: error: 'DBDATEREC' has no member named 'datedmonth'

Looking at the file DBlib.c (which I assume is generated from DBlib.xs) there is
a definition for DBDATEREC, but it is inside a #ifndef DBBOTH conditional. The
definition that's used is from /usr/include/sybdb.h, which has

typedef struct dbdaterec
{
#ifdef MSDBLIB
DBINT year;
DBINT month;
DBINT day;
DBINT dayofyear;
DBINT weekday;
DBINT hour;
DBINT minute;
DBINT second;
DBINT millisecond;
DBINT tzone;
#else
DBINT dateyear;
DBINT datemonth;
DBINT datedmonth;
DBINT datedyear;
DBINT datedweek;
DBINT datehour;
DBINT dateminute;
DBINT datesecond;
DBINT datemsecond;
DBINT datetzone;
#endif
} DBDATEREC;

I suppose MSDBLIB is defined for some reason? Does DBlib.xs need adapting to
build with this set?
--
Ed Avis <***@waniasset.com>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Michael X Peppler
2009-07-24 10:29:49 UTC
Permalink
Hi,

I think the MSDBLIB macro was for use with Microsoft's DBlibrary implementation (which may not even exist anymore).

I think you should take this up on the freetds mailing list - I haven't touched the Sybase::DBlib code in ages and I really don't remember what the problems were...

Thanks,

Michael




-----Original Message-----
From: owner-sybperl-***@peppler.org [mailto:owner-sybperl-***@peppler.org] On Behalf Of Ed Avis
Sent: Friday, July 24, 2009 12:20 PM
To: Michael Peppler
Cc: sybperl-***@peppler.org
Subject: RE: Sybperl and FreeTDS and MSSQL
Post by Michael Peppler
Sybase::DBlib will certainly work with FreeTDS.
In that case my follow-up question is about this build error:

DBlib.xs: In function 'XS_Sybase__DBlib__DateTime_crack':
DBlib.xs:6068: error: 'DBDATEREC' has no member named 'dateyear'
DBlib.xs:6069: error: 'DBDATEREC' has no member named 'datemonth'
DBlib.xs:6070: error: 'DBDATEREC' has no member named 'datedmonth'

Looking at the file DBlib.c (which I assume is generated from DBlib.xs) there is
a definition for DBDATEREC, but it is inside a #ifndef DBBOTH conditional. The
definition that's used is from /usr/include/sybdb.h, which has

typedef struct dbdaterec
{
#ifdef MSDBLIB
DBINT year;
DBINT month;
DBINT day;
DBINT dayofyear;
DBINT weekday;
DBINT hour;
DBINT minute;
DBINT second;
DBINT millisecond;
DBINT tzone;
#else
DBINT dateyear;
DBINT datemonth;
DBINT datedmonth;
DBINT datedyear;
DBINT datedweek;
DBINT datehour;
DBINT dateminute;
DBINT datesecond;
DBINT datemsecond;
DBINT datetzone;
#endif
} DBDATEREC;

I suppose MSDBLIB is defined for some reason? Does DBlib.xs need adapting to
build with this set?
--
Ed Avis <***@waniasset.com>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.
Ed Avis
2009-07-24 12:33:58 UTC
Permalink
I have asked about this on the FreeTDS mailing list:
<http://article.gmane.org/gmane.comp.db.tds.freetds/11570>
--
Ed Avis <***@waniasset.com>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
Michael X Peppler
2009-07-24 12:40:31 UTC
Permalink
I had a quick look at the DBlib.xs source. It appears that if DBLIBVS is less than 420 then the DBDATEREC structure is defined directly in the code. So it may be a question of setting DBLIBVS in the CONFIG file, or something like that to get it to build.

Michael





-----Original Message-----
From: Ed Avis [mailto:***@waniasset.com]
Sent: Friday, July 24, 2009 2:34 PM
To: Michael X Peppler; Michael Peppler
Cc: sybperl-***@peppler.org
Subject: RE: Sybperl and FreeTDS and MSSQL

I have asked about this on the FreeTDS mailing list:
<http://article.gmane.org/gmane.comp.db.tds.freetds/11570>
--
Ed Avis <***@waniasset.com>

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
This communication is for informational purposes only. It is not
intended as an offer or solicitation for the purchase or sale of
any financial instrument or as an official confirmation of any
transaction. All market prices, data and other information are not
warranted as to completeness or accuracy and are subject to change
without notice. Any comments or statements made herein do not
necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.

Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to European legal entities.
Loading...