Re: Strange results returned using Linux to MS SQL 2005 through Sybase and FreeTDS [SOLVED]
- From: moller.thomas@xxxxxxxxx (Moller Thomas)
- Date: Wed, 27 Feb 2008 16:26:41 +0100
Hi again,
Doh!!!
Well...Ehr...My only explanation is the classic:
"Sometimes you don't see the forest because of all the trees" hehe.
Actually, deep inside my head there was a buzz telling me that this
number perhaps may be a memory address due to some weird thing.
Well, there we have it, erroneous referencing.
It all works like a charm now!...Obviously.
Thanks for your help!
/Thomas
On Sun, Feb 24, 2008 at 8:24 AM, Michael Peppler <mpeppler@xxxxxxxxxxx> wrote:
Thomas Möller wrote:
> Hi all,
>
> I'm new to the usage of the FreeTDS and DBD::Sybase combination.
> I am seemingly able to connect to the DB correctly. It may perhaps
> be as simple as my MSSQL syntax is failing? I have verified that
> I am at all able to communicate correctly with the database by
> using the tool "tsql" which work like a charm giving me the
> expected results.
>
> However, when executing the classical test PERL script to fetch
> the server version:
>
if($sth->execute) {> @dat = $sth-fetchrow;
> print "@dat\n";
> }
If that's the actual script you ran then the error is in the fetchrow()
call above. You do
$sth-fetchrow;
instead of
$sth->fetchrow;
As you don't have "use strict", nor warnings, perl lets you do this
without complaining. In this case it interprets "fetchrow" as a string,
which evaluates to 0 in a numerical context ($sth - 0), which returns a
number.
Michael
--
Michael Peppler - Peppler Consulting SaRL
mpeppler@xxxxxxxxxxx - http://www.peppler.org
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com
Sybase on Linux FAQ - http://www.peppler.org/FAQ/linux.html
- Prev by Date: Re: Strange results returned using Linux to MS SQL 2005 through Sybase and FreeTDS
- Next by Date: Connecting to different named instances on MS SQL 2005 from Linux
- Previous by thread: Strange results returned using Linux to MS SQL 2005 through Sybase and FreeTDS
- Next by thread: Connecting to different named instances on MS SQL 2005 from Linux
- Index(es):