Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

sqlanywhere_fetch_field returns the wrong datatype

3 posts in General Discussion Last posting was on 2007-05-04 14:46:24.0Z
David Posted on 2007-05-03 12:02:55.0Z
Sender: 604.46309dfc.1804289383@sybase.com
From: David
Newsgroups: ianywhere.public.general
Subject: sqlanywhere_fetch_field returns the wrong datatype
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4639cf6f.1364.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 3 May 2007 05:02:55 -0700
X-Trace: forums-1-dub 1178193775 10.22.241.41 (3 May 2007 05:02:55 -0700)
X-Original-Trace: 3 May 2007 05:02:55 -0700, 10.22.241.41
Lines: 8
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5972
Article PK: 1944

sqlanywhere_fetch_field when called on columns with datatype
of numeric or decimal, it is returning as if they were
string.
Tinyint, SmallInt, integer are working fine, i.e. non
decimals are ok, but decimal data types are recognized as
strings!

Any solution for that?


Rob Waywell Posted on 2007-05-04 14:24:51.0Z
From: "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <4639cf6f.1364.1681692777@sybase.com>
Subject: Re: sqlanywhere_fetch_field returns the wrong datatype
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: rwaywell-xp2.sybase.com
X-Original-NNTP-Posting-Host: rwaywell-xp2.sybase.com
Message-ID: <463b4233@forums-1-dub>
Date: 4 May 2007 07:24:51 -0700
X-Trace: forums-1-dub 1178288691 10.25.98.235 (4 May 2007 07:24:51 -0700)
X-Original-Trace: 4 May 2007 07:24:51 -0700, rwaywell-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5973
Article PK: 1941

What version & build number?
What programming API?
ASA/SQL Anywhere or UltraLite?

--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

<David> wrote in message news:4639cf6f.1364.1681692777@sybase.com...
> sqlanywhere_fetch_field when called on columns with datatype
> of numeric or decimal, it is returning as if they were
> string.
> Tinyint, SmallInt, integer are working fine, i.e. non
> decimals are ok, but decimal data types are recognized as
> strings!
>
> Any solution for that?


"Nick Elson" < Posted on 2007-05-04 14:46:24.0Z
From: "Nick Elson" <@n@o@.@s@p@a@m@.@n@i@c@k@.@e@l@s@o@n@s@y@b@a@s@e@.@c@o@m@>
Newsgroups: ianywhere.public.general
References: <4639cf6f.1364.1681692777@sybase.com>
Subject: Re: sqlanywhere_fetch_field returns the wrong datatype
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
NNTP-Posting-Host: nicelson-m20.sybase.com
X-Original-NNTP-Posting-Host: nicelson-m20.sybase.com
Message-ID: <463b4740$1@forums-1-dub>
Date: 4 May 2007 07:46:24 -0700
X-Trace: forums-1-dub 1178289984 10.25.98.215 (4 May 2007 07:46:24 -0700)
X-Original-Trace: 4 May 2007 07:46:24 -0700, nicelson-m20.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5974
Article PK: 1942

I am not the PHP expert here but I beleive that is expected behaviour.

Since PHP is mostly a string environment [most users will
only be returning character data in the HTML content] and
since there is no *exact* PHP numeric datatype match for decimal
or numeric. You may be expecting a floating point value, but that
requires a conversion which introduces a possible loss of precision
[in the integral sense of that since floating point values are inheritently
imprecise on the least significant bits and there are decimal
values that are recorded precisely in BCD that are not
exact in float encodings.].

The character type we return is the most accurate and safest
approach overall. I believe you can convert that yourself though.

<David> wrote in message news:4639cf6f.1364.1681692777@sybase.com...
> sqlanywhere_fetch_field when called on columns with datatype
> of numeric or decimal, it is returning as if they were
> string.
> Tinyint, SmallInt, integer are working fine, i.e. non
> decimals are ok, but decimal data types are recognized as
> strings!
>
> Any solution for that?