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.

expression exponentiation

6 posts in DataWindow Last posting was on 2008-08-21 15:39:30.0Z
GregD Posted on 2008-08-20 21:20:51.0Z
From: "GregD" <greg@pdccorpnospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: expression exponentiation
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ac8ab3$1@forums-1-dub>
Date: 20 Aug 2008 14:20:51 -0700
X-Trace: forums-1-dub 1219267251 10.22.241.152 (20 Aug 2008 14:20:51 -0700)
X-Original-Trace: 20 Aug 2008 14:20:51 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87600
Article PK: 416856

All:

The following expression is working in PB8:
( field1 + field2 ) ^ field2
all fields are decimal(3)

In PB 10.5.1 build 6684 the same expression fails with "Expecting NUMBER
expression".
If I change the expression to use a number for the exponent then it passes:
( field1 + field2 ) ^ 2
When I change the exponent to any "number" field it fails. If I try to
change the type of the field (dec(s)) then validation fails that "s" is not
a string.

Help.


GregD Posted on 2008-08-20 22:09:54.0Z
From: "GregD" <greg@pdccorpnospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48ac8ab3$1@forums-1-dub>
Subject: Re: expression exponentiation
Lines: 39
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ac9632$1@forums-1-dub>
Date: 20 Aug 2008 15:09:54 -0700
X-Trace: forums-1-dub 1219270194 10.22.241.152 (20 Aug 2008 15:09:54 -0700)
X-Original-Trace: 20 Aug 2008 15:09:54 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87601
Article PK: 416855

FYI using:
( field1 + field2 ) ^ 1.2012 works as well.

I thought maybe PowerBuilder was not allowing decimal exponents. Since the
following passed:
( field1 + field2 ) ^ int( field2 )

We need to preserve the decimal exponent. So truncating to an int is not an
option.

Seems to just not like fields as an exponent any more.

Verified to still be an issue in PB 11.2 build 8407.

Help.

"GregD" <greg@pdccorpnospam.com> wrote in message
news:48ac8ab3$1@forums-1-dub...
> All:
>
> The following expression is working in PB8:
> ( field1 + field2 ) ^ field2
> all fields are decimal(3)
>
> In PB 10.5.1 build 6684 the same expression fails with "Expecting NUMBER
> expression".
> If I change the expression to use a number for the exponent then it
> passes:
> ( field1 + field2 ) ^ 2
> When I change the exponent to any "number" field it fails. If I try to
> change the type of the field (dec(s)) then validation fails that "s" is
> not a string.
>
> Help.
>


Jeremy Lakeman Posted on 2008-08-21 00:36:56.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: expression exponentiation
Date: Wed, 20 Aug 2008 17:36:56 -0700 (PDT)
Organization: http://groups.google.com
Lines: 49
Message-ID: <842fea12-d488-4815-8e68-e9c8b4727a39@w7g2000hsa.googlegroups.com>
References: <48ac8ab3$1@forums-1-dub> <48ac9632$1@forums-1-dub>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1219279016 18841 127.0.0.1 (21 Aug 2008 00:36:56 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 21 Aug 2008 00:36:56 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: w7g2000hsa.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!nntp1.phx1.gblx.net!nntp.gblx.net!nntp.gblx.net!border2.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!w7g2000hsa.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87604
Article PK: 416860


On Aug 21, 7:09 am, "GregD" <g...@pdccorpnospam.com> wrote:
> FYI using:
> (  field1 +  field2 ) ^ 1.2012 works as well.
>
> I thought maybe PowerBuilder was not allowing decimal exponents. Since the
> following passed:
> (  field1 +  field2 ) ^ int( field2 )
>
> We need to preserve the decimal exponent. So truncating to an int is not an
> option.
>
> Seems to just not like fields as an exponent any more.
>
> Verified to still be an issue in PB 11.2 build 8407.
>
> Help.
>
> "GregD" <g...@pdccorpnospam.com> wrote in message
>
> news:48ac8ab3$1@forums-1-dub...
>
> > All:
>
> > The following expression is working in PB8:
> > ( field1 +  field2 ) ^  field2
> > all fields are decimal(3)
>
> > In PB 10.5.1 build 6684 the same expression fails with "Expecting NUMBER
> > expression".
> > If I change the expression to use a number for the exponent then it
> > passes:
> > ( field1 +  field2 ) ^  2
> > When I change the exponent to any "number" field it fails. If I try to
> > change the type of the field (dec(s)) then validation fails that "s" is
> > not a string.
>
> > Help.

Hmmm, that's odd.
I know PB has an exponent operator for each numeric type. Each value
must be the same type but the compiler is supposed to implicitly
convert them. Perhaps the datawindow expression parser can't determine
the type of the first value correctly?

Have you tried;
dec( field1 + field2 ) ^ dec(field2)


Ken Balakrishnan Posted on 2008-08-21 13:54:55.0Z
From: "Ken Balakrishnan" <kNOeSPAMn@cpsREMOVEME92.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48ac8ab3$1@forums-1-dub> <48ac9632$1@forums-1-dub> <842fea12-d488-4815-8e68-e9c8b4727a39@w7g2000hsa.googlegroups.com>
Subject: Re: expression exponentiation
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ad73af@forums-1-dub>
Date: 21 Aug 2008 06:54:55 -0700
X-Trace: forums-1-dub 1219326895 10.22.241.152 (21 Aug 2008 06:54:55 -0700)
X-Original-Trace: 21 Aug 2008 06:54:55 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87606
Article PK: 416863

I think the dec datawindow function is only for converting strings to
decimals, but just adding 0 to the field seems to work:

(field1 + field2) ^ (field3 + 0)

Ken

"Jeremy Lakeman" <jeremy.lakeman@gmail.com> wrote in message
news:842fea12-d488-4815-8e68-e9c8b4727a39@w7g2000hsa.googlegroups.com...

On Aug 21, 7:09 am, "GregD" <g...@pdccorpnospam.com> wrote:
> FYI using:
> ( field1 + field2 ) ^ 1.2012 works as well.
>
> I thought maybe PowerBuilder was not allowing decimal exponents. Since the
> following passed:
> ( field1 + field2 ) ^ int( field2 )
>
> We need to preserve the decimal exponent. So truncating to an int is not
> an
> option.
>
> Seems to just not like fields as an exponent any more.
>
> Verified to still be an issue in PB 11.2 build 8407.
>
> Help.
>
> "GregD" <g...@pdccorpnospam.com> wrote in message
>
> news:48ac8ab3$1@forums-1-dub...
>
> > All:
>
> > The following expression is working in PB8:
> > ( field1 + field2 ) ^ field2
> > all fields are decimal(3)
>
> > In PB 10.5.1 build 6684 the same expression fails with "Expecting NUMBER
> > expression".
> > If I change the expression to use a number for the exponent then it
> > passes:
> > ( field1 + field2 ) ^ 2
> > When I change the exponent to any "number" field it fails. If I try to
> > change the type of the field (dec(s)) then validation fails that "s" is
> > not a string.
>
> > Help.

Hmmm, that's odd.
I know PB has an exponent operator for each numeric type. Each value
must be the same type but the compiler is supposed to implicitly
convert them. Perhaps the datawindow expression parser can't determine
the type of the first value correctly?

Have you tried;
dec( field1 + field2 ) ^ dec(field2)


"Jason 'Bug' Fenter [TeamSybase]" <NO_SPAMMING_jason.fenter_ Posted on 2008-08-21 14:16:03.0Z
From: "Jason 'Bug' Fenter [TeamSybase]" <NO_SPAMMING_jason.fenter_@_teamsybase.com>
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: expression exponentiation
References: <48ac8ab3$1@forums-1-dub> <48ac9632$1@forums-1-dub> <842fea12-d488-4815-8e68-e9c8b4727a39@w7g2000hsa.googlegroups.com> <48ad73af@forums-1-dub>
In-Reply-To: <48ad73af@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: <48ad78a3$1@forums-1-dub>
Date: 21 Aug 2008 07:16:03 -0700
X-Trace: forums-1-dub 1219328163 10.22.241.152 (21 Aug 2008 07:16:03 -0700)
X-Original-Trace: 21 Aug 2008 07:16:03 -0700, vip152.sybase.com
Lines: 67
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87607
Article PK: 416862

I often use dec() and int() on numbers to get them to cast to the right
data type. It is not only for string conversion.

I know I shouldn't be, but throwing an int into the middle of things
concerns me. Does it still work if you add 0.0 instead of just 0?

To the OP: While we continue to search for a workaround, I would
strongly suggest reporting this to Sybase as a bug.

Ken Balakrishnan wrote:
> I think the dec datawindow function is only for converting strings to
> decimals, but just adding 0 to the field seems to work:
>
> (field1 + field2) ^ (field3 + 0)
>
> Ken
>
> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> wrote in message
> news:842fea12-d488-4815-8e68-e9c8b4727a39@w7g2000hsa.googlegroups.com...
> On Aug 21, 7:09 am, "GregD" <g...@pdccorpnospam.com> wrote:
>> FYI using:
>> ( field1 + field2 ) ^ 1.2012 works as well.
>>
>> I thought maybe PowerBuilder was not allowing decimal exponents. Since the
>> following passed:
>> ( field1 + field2 ) ^ int( field2 )
>>
>> We need to preserve the decimal exponent. So truncating to an int is not
>> an
>> option.
>>
>> Seems to just not like fields as an exponent any more.
>>
>> Verified to still be an issue in PB 11.2 build 8407.
>>
>> Help.
>>
>> "GregD" <g...@pdccorpnospam.com> wrote in message
>>
>> news:48ac8ab3$1@forums-1-dub...
>>
>>> All:
>>> The following expression is working in PB8:
>>> ( field1 + field2 ) ^ field2
>>> all fields are decimal(3)
>>> In PB 10.5.1 build 6684 the same expression fails with "Expecting NUMBER
>>> expression".
>>> If I change the expression to use a number for the exponent then it
>>> passes:
>>> ( field1 + field2 ) ^ 2
>>> When I change the exponent to any "number" field it fails. If I try to
>>> change the type of the field (dec(s)) then validation fails that "s" is
>>> not a string.
>>> Help.
>
> Hmmm, that's odd.
> I know PB has an exponent operator for each numeric type. Each value
> must be the same type but the compiler is supposed to implicitly
> convert them. Perhaps the datawindow expression parser can't determine
> the type of the first value correctly?
>
> Have you tried;
> dec( field1 + field2 ) ^ dec(field2)
>
>


GregD Posted on 2008-08-21 15:39:30.0Z
From: "GregD" <greg@pdccorpnospam.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <48ac8ab3$1@forums-1-dub> <48ac9632$1@forums-1-dub> <842fea12-d488-4815-8e68-e9c8b4727a39@w7g2000hsa.googlegroups.com> <48ad73af@forums-1-dub> <48ad78a3$1@forums-1-dub>
Subject: Re: expression exponentiation
Lines: 79
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48ad8c32$1@forums-1-dub>
Date: 21 Aug 2008 08:39:30 -0700
X-Trace: forums-1-dub 1219333170 10.22.241.152 (21 Aug 2008 08:39:30 -0700)
X-Original-Trace: 21 Aug 2008 08:39:30 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87610
Article PK: 416866

Adding a 0 or 0.0 does work!

I will report this to Sybase.

Thank you all.


"Jason 'Bug' Fenter [TeamSybase]"

<NO_SPAMMING_jason.fenter_@_teamsybase.com> wrote in message
news:48ad78a3$1@forums-1-dub...
>I often use dec() and int() on numbers to get them to cast to the right
>data type. It is not only for string conversion.
>
> I know I shouldn't be, but throwing an int into the middle of things
> concerns me. Does it still work if you add 0.0 instead of just 0?
>
> To the OP: While we continue to search for a workaround, I would strongly
> suggest reporting this to Sybase as a bug.
>
>
>
> Ken Balakrishnan wrote:
>> I think the dec datawindow function is only for converting strings to
>> decimals, but just adding 0 to the field seems to work:
>>
>> (field1 + field2) ^ (field3 + 0)
>>
>> Ken
>>
>> "Jeremy Lakeman" <jeremy.lakeman@gmail.com> wrote in message
>> news:842fea12-d488-4815-8e68-e9c8b4727a39@w7g2000hsa.googlegroups.com...
>> On Aug 21, 7:09 am, "GregD" <g...@pdccorpnospam.com> wrote:
>>> FYI using:
>>> ( field1 + field2 ) ^ 1.2012 works as well.
>>>
>>> I thought maybe PowerBuilder was not allowing decimal exponents. Since
>>> the
>>> following passed:
>>> ( field1 + field2 ) ^ int( field2 )
>>>
>>> We need to preserve the decimal exponent. So truncating to an int is not
>>> an
>>> option.
>>>
>>> Seems to just not like fields as an exponent any more.
>>>
>>> Verified to still be an issue in PB 11.2 build 8407.
>>>
>>> Help.
>>>
>>> "GregD" <g...@pdccorpnospam.com> wrote in message
>>>
>>> news:48ac8ab3$1@forums-1-dub...
>>>
>>>> All:
>>>> The following expression is working in PB8:
>>>> ( field1 + field2 ) ^ field2
>>>> all fields are decimal(3)
>>>> In PB 10.5.1 build 6684 the same expression fails with "Expecting
>>>> NUMBER
>>>> expression".
>>>> If I change the expression to use a number for the exponent then it
>>>> passes:
>>>> ( field1 + field2 ) ^ 2
>>>> When I change the exponent to any "number" field it fails. If I try to
>>>> change the type of the field (dec(s)) then validation fails that "s" is
>>>> not a string.
>>>> Help.
>>
>> Hmmm, that's odd.
>> I know PB has an exponent operator for each numeric type. Each value
>> must be the same type but the compiler is supposed to implicitly
>> convert them. Perhaps the datawindow expression parser can't determine
>> the type of the first value correctly?
>>
>> Have you tried;
>> dec( field1 + field2 ) ^ dec(field2)