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.

How to check if option ansi_integer_overflow works?

6 posts in General Discussion Last posting was on 2007-05-29 17:46:37.0Z
"Jimmy Liu" Posted on 2007-05-25 07:33:39.0Z
Reply-To: "Jimmy Liu" <kliu ATsybase DOTcom>
From: "Jimmy Liu" <kliu ATsybase DOTcom>
Newsgroups: ianywhere.public.general
Subject: How to check if option ansi_integer_overflow works?
Lines: 12
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
NNTP-Posting-Host: shardc16.sybase.com
X-Original-NNTP-Posting-Host: shardc16.sybase.com
Message-ID: <46569153@forums-1-dub>
Date: 25 May 2007 00:33:39 -0700
X-Trace: forums-1-dub 1180078419 10.42.33.116 (25 May 2007 00:33:39 -0700)
X-Original-Trace: 25 May 2007 00:33:39 -0700, shardc16.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6027
Article PK: 2490

There is a database option ansi_integer_overflow,how can
I know if the option works?
I run the following statement:
declare @abc integer
select @abc =99999999999999999999*999

It always returns same message
SQL Anywhere Error -158: Value 99899999999999999999001 out of range for
destination
Can I turn off the message by turn ansi_integer_overflow option off?


Rob Waywell Posted on 2007-05-25 14:07:35.0Z
From: "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com>
Newsgroups: ianywhere.public.general
References: <46569153@forums-1-dub>
Subject: Re: How to check if option ansi_integer_overflow works?
Lines: 44
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: <4656eda7@forums-1-dub>
Date: 25 May 2007 07:07:35 -0700
X-Trace: forums-1-dub 1180102055 10.25.98.235 (25 May 2007 07:07:35 -0700)
X-Original-Trace: 25 May 2007 07:07:35 -0700, rwaywell-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6029
Article PK: 2488

What behaviour do you want and why do you need it to be different?

The return value of SQLCode = -158 is the correct SQLCode value that
corresponds to SQLState= 22003. SQLCode and SQLState are 2 different
variables that are available to check return codes.

Are you upgrading an existing application that is already explicitly
handling a different return code for integer overflow errors?

--
-----------------------------------------------
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

"Jimmy Liu" <kliu ATsybase DOTcom> wrote in message
news:46569153@forums-1-dub...
> There is a database option ansi_integer_overflow,how can
> I know if the option works?
> I run the following statement:
> declare @abc integer
> select @abc =99999999999999999999*999
>
> It always returns same message
> SQL Anywhere Error -158: Value 99899999999999999999001 out of range for
> destination
> Can I turn off the message by turn ansi_integer_overflow option off?
>
>


"Jimmy Liu" Posted on 2007-05-28 01:23:51.0Z
Reply-To: "Jimmy Liu" <kliu ATsybase DOTcom>
From: "Jimmy Liu" <kliu ATsybase DOTcom>
Newsgroups: ianywhere.public.general
References: <46569153@forums-1-dub> <4656eda7@forums-1-dub>
Subject: Re: How to check if option ansi_integer_overflow works?
Lines: 56
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1807
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896
NNTP-Posting-Host: shardc16.sybase.com
X-Original-NNTP-Posting-Host: shardc16.sybase.com
Message-ID: <465a2f27$1@forums-1-dub>
Date: 27 May 2007 18:23:51 -0700
X-Trace: forums-1-dub 1180315431 10.42.33.116 (27 May 2007 18:23:51 -0700)
X-Original-Trace: 27 May 2007 18:23:51 -0700, shardc16.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6031
Article PK: 2489

Hi Rob,
Anyway,I got the expected result now.
Error doesn't show for the following statement when turn the option off.

insert into inttb values (99999999* 99999999)

Thanks

"Rob Waywell" <rwaywell_no_spam_please@ianywhere.com> wrote in message
news:4656eda7@forums-1-dub...
> What behaviour do you want and why do you need it to be different?
>
> The return value of SQLCode = -158 is the correct SQLCode value that
> corresponds to SQLState= 22003. SQLCode and SQLState are 2 different
> variables that are available to check return codes.
>
> Are you upgrading an existing application that is already explicitly
> handling a different return code for integer overflow errors?
>
> --
> -----------------------------------------------
> 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
>
> "Jimmy Liu" <kliu ATsybase DOTcom> wrote in message
> news:46569153@forums-1-dub...
> > There is a database option ansi_integer_overflow,how can
> > I know if the option works?
> > I run the following statement:
> > declare @abc integer
> > select @abc =99999999999999999999*999
> >
> > It always returns same message
> > SQL Anywhere Error -158: Value 99899999999999999999001 out of range for
> > destination
> > Can I turn off the message by turn ansi_integer_overflow option off?
> >
> >
>
>


Ivan T. Bowman Posted on 2007-05-28 13:56:22.0Z
From: "Ivan T. Bowman" <ibowman@ianywhere.NOSPAM.com>
Newsgroups: ianywhere.public.general
References: <46569153@forums-1-dub> <4656eda7@forums-1-dub> <465a2f27$1@forums-1-dub>
Subject: Re: How to check if option ansi_integer_overflow works?
Lines: 85
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: vpn-concord-052.sybase.com
X-Original-NNTP-Posting-Host: vpn-concord-052.sybase.com
Message-ID: <465adf86@forums-1-dub>
Date: 28 May 2007 06:56:22 -0700
X-Trace: forums-1-dub 1180360582 158.159.8.52 (28 May 2007 06:56:22 -0700)
X-Original-Trace: 28 May 2007 06:56:22 -0700, vpn-concord-052.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6032
Article PK: 2491

There is a difference between the ways that the following two are processed:

A) 99999999999999999999*999

and
B) 99999999* 99999999

In case A), the constant literal "99999999999999999999" is parsed as a
NUMERIC, the multiplication is performed in the NUMERIC domain, and there
will not be an integer overflow error. When assigning the value to the
destination an overflow is detected.

In case B), the constant literal "99999999" is parsed as a signed int, the
multiplication is done with signed ints, and the ansi_integer_overflow is
used.

--
Ivan T. Bowman
SQLAnywhere Research and Development

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at
http://www.ianywhere.com/developer

"Jimmy Liu" <kliu ATsybase DOTcom> wrote in message
news:465a2f27$1@forums-1-dub...
> Hi Rob,
> Anyway,I got the expected result now.
> Error doesn't show for the following statement when turn the option off.
>
> insert into inttb values (99999999* 99999999)
>
> Thanks
> "Rob Waywell" <rwaywell_no_spam_please@ianywhere.com> wrote in message
> news:4656eda7@forums-1-dub...
>> What behaviour do you want and why do you need it to be different?
>>
>> The return value of SQLCode = -158 is the correct SQLCode value that
>> corresponds to SQLState= 22003. SQLCode and SQLState are 2 different
>> variables that are available to check return codes.
>>
>> Are you upgrading an existing application that is already explicitly
>> handling a different return code for integer overflow errors?
>>
>> --
>> -----------------------------------------------
>> 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
>>
>> "Jimmy Liu" <kliu ATsybase DOTcom> wrote in message
>> news:46569153@forums-1-dub...
>> > There is a database option ansi_integer_overflow,how can
>> > I know if the option works?
>> > I run the following statement:
>> > declare @abc integer
>> > select @abc =99999999999999999999*999
>> >
>> > It always returns same message
>> > SQL Anywhere Error -158: Value 99899999999999999999001 out of range for
>> > destination
>> > Can I turn off the message by turn ansi_integer_overflow option off?
>> >
>> >
>>
>>
>
>


Breck Carter [Team iAnywhere] Posted on 2007-05-29 14:39:30.0Z
From: "Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: How to check if option ansi_integer_overflow works?
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <6neo531nq35jelr3394gulqtbg2uddra5r@4ax.com>
References: <46569153@forums-1-dub> <4656eda7@forums-1-dub> <465a2f27$1@forums-1-dub> <465adf86@forums-1-dub>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: bcarter.sentex.ca
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
Date: 29 May 2007 07:39:30 -0700
X-Trace: forums-1-dub 1180449570 64.7.134.118 (29 May 2007 07:39:30 -0700)
X-Original-Trace: 29 May 2007 07:39:30 -0700, bcarter.sentex.ca
Lines: 32
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6035
Article PK: 2493

Would this be a good time to ask for full documentation of all the
datatype conversion rules, implied and otherwise?

When you have a free moment... <bg>

Breck

On 28 May 2007 06:56:22 -0700, "Ivan T. Bowman"

<ibowman@ianywhere.NOSPAM.com> wrote:

>There is a difference between the ways that the following two are processed:
>
>A) 99999999999999999999*999
>
>and
>B) 99999999* 99999999
>
>In case A), the constant literal "99999999999999999999" is parsed as a
>NUMERIC, the multiplication is performed in the NUMERIC domain, and there
>will not be an integer overflow error. When assigning the value to the
>destination an overflow is detected.
>
>In case B), the constant literal "99999999" is parsed as a signed int, the
>multiplication is done with signed ints, and the ansi_integer_overflow is
>used.

--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
breck.carter@risingroad.com


Jason Hinsperger Posted on 2007-05-29 17:46:37.0Z
From: "Jason Hinsperger" <NO_jason_hinsperger_SPAM@hotmail.com>
Newsgroups: ianywhere.public.general
References: <46569153@forums-1-dub> <4656eda7@forums-1-dub> <465a2f27$1@forums-1-dub> <465adf86@forums-1-dub> <6neo531nq35jelr3394gulqtbg2uddra5r@4ax.com>
Subject: Re: How to check if option ansi_integer_overflow works?
Lines: 53
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: hinsperg-d620.sybase.com
X-Original-NNTP-Posting-Host: hinsperg-d620.sybase.com
Message-ID: <465c66fd$1@forums-1-dub>
Date: 29 May 2007 10:46:37 -0700
X-Trace: forums-1-dub 1180460797 10.25.99.225 (29 May 2007 10:46:37 -0700)
X-Original-Trace: 29 May 2007 10:46:37 -0700, hinsperg-d620.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6037
Article PK: 2500

Start with this (if you haven't already read it):
http://www.ianywhere.com/downloads/whitepapers/mixeddomain.pdf


--
Jason Hinsperger
Product Manager
iAnywhere

SQL Anywhere Developer Community
http://www.ianywhere.com/developer

"Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com> wrote in
message news:6neo531nq35jelr3394gulqtbg2uddra5r@4ax.com...
> Would this be a good time to ask for full documentation of all the
> datatype conversion rules, implied and otherwise?
>
> When you have a free moment... <bg>
>
> Breck
>
> On 28 May 2007 06:56:22 -0700, "Ivan T. Bowman"
> <ibowman@ianywhere.NOSPAM.com> wrote:
>
>>There is a difference between the ways that the following two are
>>processed:
>>
>>A) 99999999999999999999*999
>>
>>and
>>B) 99999999* 99999999
>>
>>In case A), the constant literal "99999999999999999999" is parsed as a
>>NUMERIC, the multiplication is performed in the NUMERIC domain, and there
>>will not be an integer overflow error. When assigning the value to the
>>destination an overflow is detected.
>>
>>In case B), the constant literal "99999999" is parsed as a signed int, the
>>multiplication is done with signed ints, and the ansi_integer_overflow is
>>used.
>
> --
> Breck Carter [Team iAnywhere]
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com
> The book:
> http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
> breck.carter@risingroad.com