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.

Convert char "41,768.25" to float ASE 15.5

9 posts in General Discussion Last posting was on 2012-09-25 10:14:02.0Z
Michy Posted on 2012-09-21 00:03:28.0Z
Sender: 571e.505b5300.1804289383@sybase.com
From: Michy
Newsgroups: sybase.public.ase.general
Subject: Convert char "41,768.25" to float ASE 15.5
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <505baed0.714b.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 20 Sep 2012 17:03:28 -0700
X-Trace: forums-1-dub 1348185808 172.20.134.41 (20 Sep 2012 17:03:28 -0700)
X-Original-Trace: 20 Sep 2012 17:03:28 -0700, 172.20.134.41
Lines: 44
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31386
Article PK: 74276

Hi
Because en ASE 12.0 when execute



ASE 12.0
(Client isqlw windows 7)
declare @w_val_char char(10)
select @w_val_char = "41,768.25"
select convert(float,@w_val_char)

The result:
41.0


UNIX-HPUX 11iv1 isql
$ isql -Udba
Password:
1> declare @w_val_char char(10)
select @w_val_char = "41,768.25"
select convert(float,@w_val_char)2> 3> go
4> go
(1 row affected)
go

--------------------
41.000000

(1 row affected)
1>

IN ASE 15.5 present error:

ASE 15.5
declare @w_val_char char(10)
select @w_val_char ="41,768.25"
select convert(float,@w_val_char)


(1 row(s) affected)

Msg 249, Level 16, State 1
Syntax error during explicit conversion of CHAR value
'41,768.25 ' to a FLOAT field.


Rob V Posted on 2012-09-21 10:04:57.0Z
From: Rob V <rob@sypron.nl>
Reply-To: rob@sypron.nl
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
References: <505baed0.714b.1681692777@sybase.com>
In-Reply-To: <505baed0.714b.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <505c3bc9$1@forums-1-dub>
Date: 21 Sep 2012 03:04:57 -0700
X-Trace: forums-1-dub 1348221897 172.20.134.152 (21 Sep 2012 03:04:57 -0700)
X-Original-Trace: 21 Sep 2012 03:04:57 -0700, vip152.sybase.com
Lines: 73
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31387
Article PK: 74275


On 21-Sep-2012 02:03, Michy wrote:
> Hi
> Because en ASE 12.0 when execute
>
>
>
> ASE 12.0
> (Client isqlw windows 7)
> declare @w_val_char char(10)
> select @w_val_char = "41,768.25"
> select convert(float,@w_val_char)
>
> The result:
> 41.0
>
>
> UNIX-HPUX 11iv1 isql
> $ isql -Udba
> Password:
> 1> declare @w_val_char char(10)
> select @w_val_char = "41,768.25"
> select convert(float,@w_val_char)2> 3> go
> 4> go
> (1 row affected)
> go
>
> --------------------
> 41.000000
>
> (1 row affected)
> 1>
>
> IN ASE 15.5 present error:
>
> ASE 15.5
> declare @w_val_char char(10)
> select @w_val_char ="41,768.25"
> select convert(float,@w_val_char)
>
>
> (1 row(s) affected)
>
> Msg 249, Level 16, State 1
> Syntax error during explicit conversion of CHAR value
> '41,768.25 ' to a FLOAT field.
>

You will get this error in any ASE version, from 11.0.3 to 15.7 the
error is raised everywhere, as would be expected (I just verified).

You mention 'isqlw' as your client for the case where this works. That
is not a Sybase client program, but -if I'm not mistaken- for Microsoft
SQL Server. MS SQL may behave differently than ASE when it comes to
formatting aspects like these, you cannot compare them directly.

--
HTH,

Rob V.
-----------------------------------------------------------------
Rob Verschoor

Certified Professional DBA for Sybase ASE, IQ, Replication Server

Author of Sybase books (order online at www.sypron.nl/shop):
"Tips, Tricks & Recipes for Sybase ASE"
"The Complete Sybase IQ Quick Reference Guide"
"The Complete Sybase ASE Quick Reference Guide"
"The Complete Sybase Replication Server Quick Reference Guide"

rob@NO.SPAM.sypron.nl | www.sypron.nl | Twitter: @rob_verschoor
Sypron B.V., The Netherlands | Chamber of Commerce 27138666
-----------------------------------------------------------------


Michy Posted on 2012-09-22 13:28:31.0Z
Sender: 4c56.505dbb0e.1804289383@sybase.com
From: Michy
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <505dbcff.4c7f.1681692777@sybase.com>
References: <505c3bc9$1@forums-1-dub>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 22 Sep 2012 06:28:31 -0700
X-Trace: forums-1-dub 1348320511 172.20.134.41 (22 Sep 2012 06:28:31 -0700)
X-Original-Trace: 22 Sep 2012 06:28:31 -0700, 172.20.134.41
Lines: 133
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31388
Article PK: 74277

Hi

en ASE 12.0 command isql
HPUX PA-RISC 11iv1 (64bits)
$ uname -an
HP-UX rp7440 B.11.11 U 9000/800 1964952521 unlimited-user
license
$

1> select @@version
2> go

Adaptive Server Enterprise/12.0.0.8/P/EBF
12448 ESD4/HP9000-879/HP-UX 11.0/2079/64bit/FBO/Thu Mar 10
16:44:34 2005

(1 row affected)
1>
declare @w_val_char char(10)
select @w_val_char = "41,768.99"
select convert(float,@w_val_char)2> 3> 4> go
5> go
(1 row affected)
go
--------------------
41.000000

(1 row affected)
1> exit

$ isql -v
Sybase CTISQL Utility/12.0/P/hpux/HP-UX 11.00/1/OPT/Mon Oct
4 13:20:49 1999

Confidential property of Sybase, Inc.
Copyright 1987, 1999
Sybase, Inc. All rights reserved.
Unpublished rights reserved under U.S. copyright laws.

This software contains confidential and trade secret
information of Sybase,
Inc. Use, duplication or disclosure of the software and
documentation by
the U.S. Government is subject to restrictions set
forth in a license
agreement between the Government and Sybase, Inc. or
other written
agreement specifying the Government's rights to use the
software and any
applicable FAR provisions, for example, FAR 52.227-19.
Sybase, Inc. 6475 Christie Avenue, Emeryville, CA 94608, USA

> On 21-Sep-2012 02:03, Michy wrote:
> > Hi
> > Because en ASE 12.0 when execute
> >
> >
> >
> > ASE 12.0
> > (Client isqlw windows 7)
> > declare @w_val_char char(10)
> > select @w_val_char = "41,768.25"
> > select convert(float,@w_val_char)
> >
> > The result:
> > 41.0
> >
> >
> > UNIX-HPUX 11iv1 isql
> > $ isql -Udba
> > Password:
> > 1> declare @w_val_char char(10)
> > select @w_val_char = "41,768.25"
> > select convert(float,@w_val_char)2> 3> go
> > 4> go
> > (1 row affected)
> > go
> >
> > --------------------
> > 41.000000
> >
> > (1 row affected)
> > 1>
> >
> > IN ASE 15.5 present error:
> >
> > ASE 15.5
> > declare @w_val_char char(10)
> > select @w_val_char ="41,768.25"
> > select convert(float,@w_val_char)
> >
> >
> > (1 row(s) affected)
> >
> > Msg 249, Level 16, State 1
> > Syntax error during explicit conversion of CHAR value
> > '41,768.25 ' to a FLOAT field.
> >
>
> You will get this error in any ASE version, from 11.0.3 to
> 15.7 the error is raised everywhere, as would be expected
> (I just verified).
>
> You mention 'isqlw' as your client for the case where this
> works. That is not a Sybase client program, but -if I'm
> not mistaken- for Microsoft SQL Server. MS SQL may behave
> differently than ASE when it comes to formatting aspects
> like these, you cannot compare them directly.
>
> --
> HTH,
>
> Rob V.
> ----------------------------------------------------------
> ------- Rob Verschoor
>
> Certified Professional DBA for Sybase ASE, IQ, Replication
> Server
>
> Author of Sybase books (order online at
> www.sypron.nl/shop): "Tips, Tricks & Recipes for Sybase
> ASE" "The Complete Sybase IQ Quick Reference Guide"
> "The Complete Sybase ASE Quick Reference Guide"
> "The Complete Sybase Replication Server Quick Reference
> Guide"
>
> rob@NO.SPAM.sypron.nl | www.sypron.nl | Twitter:
> @rob_verschoor Sypron B.V., The Netherlands | Chamber of
> Commerce 27138666
> ----------------------------------------------------------
> -------


Rob V Posted on 2012-09-22 14:11:09.0Z
From: Rob V <rob@sypron.nl>
Reply-To: rob@sypron.nl
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
References: <505c3bc9$1@forums-1-dub> <505dbcff.4c7f.1681692777@sybase.com>
In-Reply-To: <505dbcff.4c7f.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <505dc6fd$1@forums-1-dub>
Date: 22 Sep 2012 07:11:09 -0700
X-Trace: forums-1-dub 1348323069 172.20.134.152 (22 Sep 2012 07:11:09 -0700)
X-Original-Trace: 22 Sep 2012 07:11:09 -0700, vip152.sybase.com
Lines: 144
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31389
Article PK: 74278

That's strange, I cannot reproduce that.
The only explanation I can think of is that this has something to do
with language settings in ASE and/or regional settings on Windows. But I
wouldn't immediately know how that would work.

R.

On 22-Sep-2012 15:28, Michy wrote:
> Hi
>
> en ASE 12.0 command isql
> HPUX PA-RISC 11iv1 (64bits)
> $ uname -an
> HP-UX rp7440 B.11.11 U 9000/800 1964952521 unlimited-user
> license
> $
>
> 1> select @@version
> 2> go
>
> Adaptive Server Enterprise/12.0.0.8/P/EBF
> 12448 ESD4/HP9000-879/HP-UX 11.0/2079/64bit/FBO/Thu Mar 10
> 16:44:34 2005
>
> (1 row affected)
> 1>
> declare @w_val_char char(10)
> select @w_val_char = "41,768.99"
> select convert(float,@w_val_char)2> 3> 4> go
> 5> go
> (1 row affected)
> go
> --------------------
> 41.000000
>
> (1 row affected)
> 1> exit
>
> $ isql -v
> Sybase CTISQL Utility/12.0/P/hpux/HP-UX 11.00/1/OPT/Mon Oct
> 4 13:20:49 1999
>
> Confidential property of Sybase, Inc.
> Copyright 1987, 1999
> Sybase, Inc. All rights reserved.
> Unpublished rights reserved under U.S. copyright laws.
>
> This software contains confidential and trade secret
> information of Sybase,
> Inc. Use, duplication or disclosure of the software and
> documentation by
> the U.S. Government is subject to restrictions set
> forth in a license
> agreement between the Government and Sybase, Inc. or
> other written
> agreement specifying the Government's rights to use the
> software and any
> applicable FAR provisions, for example, FAR 52.227-19.
> Sybase, Inc. 6475 Christie Avenue, Emeryville, CA 94608, USA
>
>
>
>> On 21-Sep-2012 02:03, Michy wrote:
>>> Hi
>>> Because en ASE 12.0 when execute
>>>
>>>
>>>
>>> ASE 12.0
>>> (Client isqlw windows 7)
>>> declare @w_val_char char(10)
>>> select @w_val_char = "41,768.25"
>>> select convert(float,@w_val_char)
>>>
>>> The result:
>>> 41.0
>>>
>>>
>>> UNIX-HPUX 11iv1 isql
>>> $ isql -Udba
>>> Password:
>>> 1> declare @w_val_char char(10)
>>> select @w_val_char = "41,768.25"
>>> select convert(float,@w_val_char)2> 3> go
>>> 4> go
>>> (1 row affected)
>>> go
>>>
>>> --------------------
>>> 41.000000
>>>
>>> (1 row affected)
>>> 1>
>>>
>>> IN ASE 15.5 present error:
>>>
>>> ASE 15.5
>>> declare @w_val_char char(10)
>>> select @w_val_char ="41,768.25"
>>> select convert(float,@w_val_char)
>>>
>>>
>>> (1 row(s) affected)
>>>
>>> Msg 249, Level 16, State 1
>>> Syntax error during explicit conversion of CHAR value
>>> '41,768.25 ' to a FLOAT field.
>>>
>>
>> You will get this error in any ASE version, from 11.0.3 to
>> 15.7 the error is raised everywhere, as would be expected
>> (I just verified).
>>
>> You mention 'isqlw' as your client for the case where this
>> works. That is not a Sybase client program, but -if I'm
>> not mistaken- for Microsoft SQL Server. MS SQL may behave
>> differently than ASE when it comes to formatting aspects
>> like these, you cannot compare them directly.
>>
>> --
>> HTH,
>>
>> Rob V.
>> ----------------------------------------------------------
>> ------- Rob Verschoor
>>
>> Certified Professional DBA for Sybase ASE, IQ, Replication
>> Server
>>
>> Author of Sybase books (order online at
>> www.sypron.nl/shop): "Tips, Tricks & Recipes for Sybase
>> ASE" "The Complete Sybase IQ Quick Reference Guide"
>> "The Complete Sybase ASE Quick Reference Guide"
>> "The Complete Sybase Replication Server Quick Reference
>> Guide"
>>
>> rob@NO.SPAM.sypron.nl | www.sypron.nl | Twitter:
>> @rob_verschoor Sypron B.V., The Netherlands | Chamber of
>> Commerce 27138666
>> ----------------------------------------------------------
>> -------


Michy Posted on 2012-09-22 16:02:41.0Z
Sender: 4d9e.505dc3d1.1804289383@sybase.com
From: Michy
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <505de121.53f2.1681692777@sybase.com>
References: <505dc6fd$1@forums-1-dub>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 22 Sep 2012 09:02:41 -0700
X-Trace: forums-1-dub 1348329761 172.20.134.41 (22 Sep 2012 09:02:41 -0700)
X-Original-Trace: 22 Sep 2012 09:02:41 -0700, 172.20.134.41
Lines: 165
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31390
Article PK: 74279

IN HPUX in files /sybase/locales/locales.dat I use in ASE 12
y ASE 15.5

[hp ux]
locale = default, us_english, iso_1
;locale = default, us_english, roman8

select @@language
us_english

ASE 12 and ASE 15.5 are on the same physical machine HPUX
11i v1
even I have on two different physical machines HPUX each
other with ASE 12 and ASE 15.5 and it is the same

ASE 15.5 version Adaptive Server Enterprise/15.5/EBF 18652
SMP ESD#4/P/HP9000-879/HP-UX
11.11/asear155/2545/64-bit/FBO/Thu Jun 16 09:50:24 2011

> That's strange, I cannot reproduce that.
> The only explanation I can think of is that this has
> something to do with language settings in ASE and/or
> regional settings on Windows. But I wouldn't immediately
> know how that would work.
>
> R.
>
>
> On 22-Sep-2012 15:28, Michy wrote:
> > Hi
> >
> > en ASE 12.0 command isql
> > HPUX PA-RISC 11iv1 (64bits)
> > $ uname -an
> > HP-UX rp7440 B.11.11 U 9000/800 1964952521
> > unlimited-user license
> > $
> >
> > 1> select @@version
> > 2> go
> >
> > Adaptive Server Enterprise/12.0.0.8/P/EBF
> > 12448 ESD4/HP9000-879/HP-UX 11.0/2079/64bit/FBO/Thu Mar
> > 10 16:44:34 2005
> >
> > (1 row affected)
> > 1>
> > declare @w_val_char char(10)
> > select @w_val_char = "41,768.99"
> > select convert(float,@w_val_char)2> 3> 4> go
> > 5> go
> > (1 row affected)
> > go
> > --------------------
> > 41.000000
> >
> > (1 row affected)
> > 1> exit
> >
> > $ isql -v
> > Sybase CTISQL Utility/12.0/P/hpux/HP-UX 11.00/1/OPT/Mon
> > Oct 4 13:20:49 1999
> >
> > Confidential property of Sybase, Inc.
> > Copyright 1987, 1999
> > Sybase, Inc. All rights reserved.
> > Unpublished rights reserved under U.S. copyright laws.
> >
> > This software contains confidential and trade secret
> > information of Sybase,
> > Inc. Use, duplication or disclosure of the software
> > and documentation by
> > the U.S. Government is subject to restrictions set
> > forth in a license
> > agreement between the Government and Sybase, Inc.
> > or other written
> > agreement specifying the Government's rights to use
> > the software and any
> > applicable FAR provisions, for example, FAR 52.227-19.
> > Sybase, Inc. 6475 Christie Avenue, Emeryville, CA 94608,
> USA >
> >
> >
> >> On 21-Sep-2012 02:03, Michy wrote:
> >>> Hi
> >>> Because en ASE 12.0 when execute
> >>>
> >>>
> >>>
> >>> ASE 12.0
> >>> (Client isqlw windows 7)
> >>> declare @w_val_char char(10)
> >>> select @w_val_char = "41,768.25"
> >>> select convert(float,@w_val_char)
> >>>
> >>> The result:
> >>> 41.0
> >>>
> >>>
> >>> UNIX-HPUX 11iv1 isql
> >>> $ isql -Udba
> >>> Password:
> >>> 1> declare @w_val_char char(10)
> >>> select @w_val_char = "41,768.25"
> >>> select convert(float,@w_val_char)2> 3> go
> >>> 4> go
> >>> (1 row affected)
> >>> go
> >>>
> >>> --------------------
> >>> 41.000000
> >>>
> >>> (1 row affected)
> >>> 1>
> >>>
> >>> IN ASE 15.5 present error:
> >>>
> >>> ASE 15.5
> >>> declare @w_val_char char(10)
> >>> select @w_val_char ="41,768.25"
> >>> select convert(float,@w_val_char)
> >>>
> >>>
> >>> (1 row(s) affected)
> >>>
> >>> Msg 249, Level 16, State 1
> >>> Syntax error during explicit conversion of CHAR value
> >>> '41,768.25 ' to a FLOAT field.
> >>>
> >>
> >> You will get this error in any ASE version, from 11.0.3
> to >> 15.7 the error is raised everywhere, as would be
> expected >> (I just verified).
> >>
> >> You mention 'isqlw' as your client for the case where
> this >> works. That is not a Sybase client program, but
> -if I'm >> not mistaken- for Microsoft SQL Server. MS SQL
> may behave >> differently than ASE when it comes to
> formatting aspects >> like these, you cannot compare them
> directly. >>
> >> --
> >> HTH,
> >>
> >> Rob V.
> >>
> ----------------------------------------------------------
> >> ------- Rob Verschoor >>
> >> Certified Professional DBA for Sybase ASE, IQ,
> Replication >> Server
> >>
> >> Author of Sybase books (order online at
> >> www.sypron.nl/shop): "Tips, Tricks & Recipes for Sybase
> >> ASE" "The Complete Sybase IQ Quick Reference Guide"
> >> "The Complete Sybase ASE Quick Reference Guide"
> >> "The Complete Sybase Replication Server Quick Reference
> >> Guide"
> >>
> >> rob@NO.SPAM.sypron.nl | www.sypron.nl | Twitter:
> >> @rob_verschoor Sypron B.V., The Netherlands | Chamber
> of >> Commerce 27138666
> >>
> ----------------------------------------------------------
> >> -------
>
>


NJS Posted on 2012-09-23 00:13:12.0Z
From: NJS <NJS@optonline.net>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
References: <505dc6fd$1@forums-1-dub> <505de121.53f2.1681692777@sybase.com>
In-Reply-To: <505de121.53f2.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <505e5418$1@forums-1-dub>
Date: 22 Sep 2012 17:13:12 -0700
X-Trace: forums-1-dub 1348359192 172.20.134.152 (22 Sep 2012 17:13:12 -0700)
X-Original-Trace: 22 Sep 2012 17:13:12 -0700, vip152.sybase.com
Lines: 177
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31391
Article PK: 74280

Interesting.. same as Rob, i cannot reproduce this anywhere.

BTW, the convert() works if you use "money" instead of "float".

There used to be a 3rd parameter in convert() which accepted commas in
numerics, but I guess, SYBASE does not support it anymore.

sorry, no valued added here, but it was interesting to try and help.

On 9/22/2012 12:02 PM, Michy wrote:
> IN HPUX in files /sybase/locales/locales.dat I use in ASE 12
> y ASE 15.5
>
> [hp ux]
> locale = default, us_english, iso_1
> ;locale = default, us_english, roman8
>
> select @@language
> us_english
>
> ASE 12 and ASE 15.5 are on the same physical machine HPUX
> 11i v1
> even I have on two different physical machines HPUX each
> other with ASE 12 and ASE 15.5 and it is the same
>
> ASE 15.5 version Adaptive Server Enterprise/15.5/EBF 18652
> SMP ESD#4/P/HP9000-879/HP-UX
> 11.11/asear155/2545/64-bit/FBO/Thu Jun 16 09:50:24 2011
>
> > That's strange, I cannot reproduce that.
>> The only explanation I can think of is that this has
>> something to do with language settings in ASE and/or
>> regional settings on Windows. But I wouldn't immediately
>> know how that would work.
>>
>> R.
>>
>>
>> On 22-Sep-2012 15:28, Michy wrote:
>>> Hi
>>>
>>> en ASE 12.0 command isql
>>> HPUX PA-RISC 11iv1 (64bits)
>>> $ uname -an
>>> HP-UX rp7440 B.11.11 U 9000/800 1964952521
>>> unlimited-user license
>>> $
>>>
>>> 1> select @@version
>>> 2> go
>>>
>>> Adaptive Server Enterprise/12.0.0.8/P/EBF
>>> 12448 ESD4/HP9000-879/HP-UX 11.0/2079/64bit/FBO/Thu Mar
>>> 10 16:44:34 2005
>>>
>>> (1 row affected)
>>> 1>
>>> declare @w_val_char char(10)
>>> select @w_val_char = "41,768.99"
>>> select convert(float,@w_val_char)2> 3> 4> go
>>> 5> go
>>> (1 row affected)
>>> go
>>> --------------------
>>> 41.000000
>>>
>>> (1 row affected)
>>> 1> exit
>>>
>>> $ isql -v
>>> Sybase CTISQL Utility/12.0/P/hpux/HP-UX 11.00/1/OPT/Mon
>>> Oct 4 13:20:49 1999
>>>
>>> Confidential property of Sybase, Inc.
>>> Copyright 1987, 1999
>>> Sybase, Inc. All rights reserved.
>>> Unpublished rights reserved under U.S. copyright laws.
>>>
>>> This software contains confidential and trade secret
>>> information of Sybase,
>>> Inc. Use, duplication or disclosure of the software
>>> and documentation by
>>> the U.S. Government is subject to restrictions set
>>> forth in a license
>>> agreement between the Government and Sybase, Inc.
>>> or other written
>>> agreement specifying the Government's rights to use
>>> the software and any
>>> applicable FAR provisions, for example, FAR 52.227-19.
>>> Sybase, Inc. 6475 Christie Avenue, Emeryville, CA 94608,
>> USA >
>>>
>>>
>>>> On 21-Sep-2012 02:03, Michy wrote:
>>>>> Hi
>>>>> Because en ASE 12.0 when execute
>>>>>
>>>>>
>>>>>
>>>>> ASE 12.0
>>>>> (Client isqlw windows 7)
>>>>> declare @w_val_char char(10)
>>>>> select @w_val_char = "41,768.25"
>>>>> select convert(float,@w_val_char)
>>>>>
>>>>> The result:
>>>>> 41.0
>>>>>
>>>>>
>>>>> UNIX-HPUX 11iv1 isql
>>>>> $ isql -Udba
>>>>> Password:
>>>>> 1> declare @w_val_char char(10)
>>>>> select @w_val_char = "41,768.25"
>>>>> select convert(float,@w_val_char)2> 3> go
>>>>> 4> go
>>>>> (1 row affected)
>>>>> go
>>>>>
>>>>> --------------------
>>>>> 41.000000
>>>>>
>>>>> (1 row affected)
>>>>> 1>
>>>>>
>>>>> IN ASE 15.5 present error:
>>>>>
>>>>> ASE 15.5
>>>>> declare @w_val_char char(10)
>>>>> select @w_val_char ="41,768.25"
>>>>> select convert(float,@w_val_char)
>>>>>
>>>>>
>>>>> (1 row(s) affected)
>>>>>
>>>>> Msg 249, Level 16, State 1
>>>>> Syntax error during explicit conversion of CHAR value
>>>>> '41,768.25 ' to a FLOAT field.
>>>>>
>>>>
>>>> You will get this error in any ASE version, from 11.0.3
>> to >> 15.7 the error is raised everywhere, as would be
>> expected >> (I just verified).
>>>>
>>>> You mention 'isqlw' as your client for the case where
>> this >> works. That is not a Sybase client program, but
>> -if I'm >> not mistaken- for Microsoft SQL Server. MS SQL
>> may behave >> differently than ASE when it comes to
>> formatting aspects >> like these, you cannot compare them
>> directly. >>
>>>> --
>>>> HTH,
>>>>
>>>> Rob V.
>>>>
>> ----------------------------------------------------------
>>>> ------- Rob Verschoor >>
>>>> Certified Professional DBA for Sybase ASE, IQ,
>> Replication >> Server
>>>>
>>>> Author of Sybase books (order online at
>>>> www.sypron.nl/shop): "Tips, Tricks & Recipes for Sybase
>>>> ASE" "The Complete Sybase IQ Quick Reference Guide"
>>>> "The Complete Sybase ASE Quick Reference Guide"
>>>> "The Complete Sybase Replication Server Quick Reference
>>>> Guide"
>>>>
>>>> rob@NO.SPAM.sypron.nl | www.sypron.nl | Twitter:
>>>> @rob_verschoor Sypron B.V., The Netherlands | Chamber
>> of >> Commerce 27138666
>>>>
>> ----------------------------------------------------------
>>>> -------
>>
>>


Rob V Posted on 2012-09-23 10:00:13.0Z
From: Rob V <rob@sypron.nl>
Reply-To: rob@sypron.nl
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
References: <505dc6fd$1@forums-1-dub> <505de121.53f2.1681692777@sybase.com>
In-Reply-To: <505de121.53f2.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <505eddad$1@forums-1-dub>
Date: 23 Sep 2012 03:00:13 -0700
X-Trace: forums-1-dub 1348394413 172.20.134.152 (23 Sep 2012 03:00:13 -0700)
X-Original-Trace: 23 Sep 2012 03:00:13 -0700, vip152.sybase.com
Lines: 172
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31392
Article PK: 74281

Weird. It must be some environmental factor but I don't have a better
suggestion than that right now.

Rob V.

On 22-Sep-2012 18:02, Michy wrote:
> IN HPUX in files /sybase/locales/locales.dat I use in ASE 12
> y ASE 15.5
>
> [hp ux]
> locale = default, us_english, iso_1
> ;locale = default, us_english, roman8
>
> select @@language
> us_english
>
> ASE 12 and ASE 15.5 are on the same physical machine HPUX
> 11i v1
> even I have on two different physical machines HPUX each
> other with ASE 12 and ASE 15.5 and it is the same
>
> ASE 15.5 version Adaptive Server Enterprise/15.5/EBF 18652
> SMP ESD#4/P/HP9000-879/HP-UX
> 11.11/asear155/2545/64-bit/FBO/Thu Jun 16 09:50:24 2011
>
> > That's strange, I cannot reproduce that.
>> The only explanation I can think of is that this has
>> something to do with language settings in ASE and/or
>> regional settings on Windows. But I wouldn't immediately
>> know how that would work.
>>
>> R.
>>
>>
>> On 22-Sep-2012 15:28, Michy wrote:
>>> Hi
>>>
>>> en ASE 12.0 command isql
>>> HPUX PA-RISC 11iv1 (64bits)
>>> $ uname -an
>>> HP-UX rp7440 B.11.11 U 9000/800 1964952521
>>> unlimited-user license
>>> $
>>>
>>> 1> select @@version
>>> 2> go
>>>
>>> Adaptive Server Enterprise/12.0.0.8/P/EBF
>>> 12448 ESD4/HP9000-879/HP-UX 11.0/2079/64bit/FBO/Thu Mar
>>> 10 16:44:34 2005
>>>
>>> (1 row affected)
>>> 1>
>>> declare @w_val_char char(10)
>>> select @w_val_char = "41,768.99"
>>> select convert(float,@w_val_char)2> 3> 4> go
>>> 5> go
>>> (1 row affected)
>>> go
>>> --------------------
>>> 41.000000
>>>
>>> (1 row affected)
>>> 1> exit
>>>
>>> $ isql -v
>>> Sybase CTISQL Utility/12.0/P/hpux/HP-UX 11.00/1/OPT/Mon
>>> Oct 4 13:20:49 1999
>>>
>>> Confidential property of Sybase, Inc.
>>> Copyright 1987, 1999
>>> Sybase, Inc. All rights reserved.
>>> Unpublished rights reserved under U.S. copyright laws.
>>>
>>> This software contains confidential and trade secret
>>> information of Sybase,
>>> Inc. Use, duplication or disclosure of the software
>>> and documentation by
>>> the U.S. Government is subject to restrictions set
>>> forth in a license
>>> agreement between the Government and Sybase, Inc.
>>> or other written
>>> agreement specifying the Government's rights to use
>>> the software and any
>>> applicable FAR provisions, for example, FAR 52.227-19.
>>> Sybase, Inc. 6475 Christie Avenue, Emeryville, CA 94608,
>> USA >
>>>
>>>
>>>> On 21-Sep-2012 02:03, Michy wrote:
>>>>> Hi
>>>>> Because en ASE 12.0 when execute
>>>>>
>>>>>
>>>>>
>>>>> ASE 12.0
>>>>> (Client isqlw windows 7)
>>>>> declare @w_val_char char(10)
>>>>> select @w_val_char = "41,768.25"
>>>>> select convert(float,@w_val_char)
>>>>>
>>>>> The result:
>>>>> 41.0
>>>>>
>>>>>
>>>>> UNIX-HPUX 11iv1 isql
>>>>> $ isql -Udba
>>>>> Password:
>>>>> 1> declare @w_val_char char(10)
>>>>> select @w_val_char = "41,768.25"
>>>>> select convert(float,@w_val_char)2> 3> go
>>>>> 4> go
>>>>> (1 row affected)
>>>>> go
>>>>>
>>>>> --------------------
>>>>> 41.000000
>>>>>
>>>>> (1 row affected)
>>>>> 1>
>>>>>
>>>>> IN ASE 15.5 present error:
>>>>>
>>>>> ASE 15.5
>>>>> declare @w_val_char char(10)
>>>>> select @w_val_char ="41,768.25"
>>>>> select convert(float,@w_val_char)
>>>>>
>>>>>
>>>>> (1 row(s) affected)
>>>>>
>>>>> Msg 249, Level 16, State 1
>>>>> Syntax error during explicit conversion of CHAR value
>>>>> '41,768.25 ' to a FLOAT field.
>>>>>
>>>>
>>>> You will get this error in any ASE version, from 11.0.3
>> to >> 15.7 the error is raised everywhere, as would be
>> expected >> (I just verified).
>>>>
>>>> You mention 'isqlw' as your client for the case where
>> this >> works. That is not a Sybase client program, but
>> -if I'm >> not mistaken- for Microsoft SQL Server. MS SQL
>> may behave >> differently than ASE when it comes to
>> formatting aspects >> like these, you cannot compare them
>> directly. >>
>>>> --
>>>> HTH,
>>>>
>>>> Rob V.
>>>>
>> ----------------------------------------------------------
>>>> ------- Rob Verschoor >>
>>>> Certified Professional DBA for Sybase ASE, IQ,
>> Replication >> Server
>>>>
>>>> Author of Sybase books (order online at
>>>> www.sypron.nl/shop): "Tips, Tricks & Recipes for Sybase
>>>> ASE" "The Complete Sybase IQ Quick Reference Guide"
>>>> "The Complete Sybase ASE Quick Reference Guide"
>>>> "The Complete Sybase Replication Server Quick Reference
>>>> Guide"
>>>>
>>>> rob@NO.SPAM.sypron.nl | www.sypron.nl | Twitter:
>>>> @rob_verschoor Sypron B.V., The Netherlands | Chamber
>> of >> Commerce 27138666
>>>>
>> ----------------------------------------------------------
>>>> -------
>>
>>


Bret Halford Posted on 2012-09-24 16:43:58.0Z
From: Bret Halford <bret.halford@sap.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
References: <505dc6fd$1@forums-1-dub> <505de121.53f2.1681692777@sybase.com> <505eddad$1@forums-1-dub>
In-Reply-To: <505eddad$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <50608dce$1@forums-1-dub>
Date: 24 Sep 2012 09:43:58 -0700
X-Trace: forums-1-dub 1348505038 172.20.134.152 (24 Sep 2012 09:43:58 -0700)
X-Original-Trace: 24 Sep 2012 09:43:58 -0700, vip152.sybase.com
Lines: 19
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31394
Article PK: 74283


On 9/23/2012 4:00 AM, Rob V wrote:> Weird. It must be some environmental

factor but I don't have a better
> suggestion than that right now.
>
> Rob V.

See CR 470287. There was a change in the Open Server common library
routine that performs the actual conversion between 12.5.4 ESD 4 and ESD
5 and later. The more recent behavior (of raising an error)
is considered correct when the string contains unexpected characters
(the comma is not expected for a FLOAT value).

-bret


Rob V Posted on 2012-09-25 10:14:02.0Z
From: Rob V <rob@sypron.nl>
Reply-To: rob@sypron.nl
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version: 1.0
Newsgroups: sybase.public.ase.general
Subject: Re: Convert char "41,768.25" to float ASE 15.5
References: <505dc6fd$1@forums-1-dub> <505de121.53f2.1681692777@sybase.com> <505eddad$1@forums-1-dub> <50608dce$1@forums-1-dub>
In-Reply-To: <50608dce$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <506183ea$1@forums-1-dub>
Date: 25 Sep 2012 03:14:02 -0700
X-Trace: forums-1-dub 1348568042 172.20.134.152 (25 Sep 2012 03:14:02 -0700)
X-Original-Trace: 25 Sep 2012 03:14:02 -0700, vip152.sybase.com
Lines: 30
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:31395
Article PK: 74284


On 24-Sep-2012 18:43, Bret Halford wrote:
>
>
> On 9/23/2012 4:00 AM, Rob V wrote:> Weird. It must be some environmental
> factor but I don't have a better
> > suggestion than that right now.
> >
> > Rob V.
>
> See CR 470287. There was a change in the Open Server common library
> routine that performs the actual conversion between 12.5.4 ESD 4 and ESD
> 5 and later. The more recent behavior (of raising an error)
> is considered correct when the string contains unexpected characters
> (the comma is not expected for a FLOAT value).
>
> -bret
>
>
>
>

Great catch, Bret!

This is not an entirely trivial matter if I understand it correctly, and
the ASE versions where the error is (incorrectly) not raised, would be
very specific ones. That would explain why I'm getting an error in any
combination I try; the OP probably has just that version where no error
is raised.

Rob V.