develooper Front page | perl.dbi.users | Postings from February 2008

Re: Strange results returned using Linux to MS SQL 2005 through Sybase and FreeTDS [SOLVED]

From:
Thomas Möller
Date:
February 27, 2008 07:26
Subject:
Re: Strange results returned using Linux to MS SQL 2005 through Sybase and FreeTDS [SOLVED]
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@peppler.org> 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@peppler.org      -                  http://www.peppler.org
>  Sybase DBA/Developer      -   TeamSybase: http://www.teamsybase.com
>  Sybase on Linux FAQ       -   http://www.peppler.org/FAQ/linux.html
>



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About