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.

Column Type Wrong in upgrade from ASA 8 to SA 11

2 posts in DataWindow Last posting was on 2009-01-14 02:14:02.0Z
jclanton Posted on 2009-01-13 21:12:31.0Z
From: jclanton <jclanton@propertyboss.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Column Type Wrong in upgrade from ASA 8 to SA 11
Date: Tue, 13 Jan 2009 13:12:31 -0800 (PST)
Organization: http://groups.google.com
Lines: 42
Message-ID: <53fcc838-0348-4041-bd2f-4cb00e96d9fc@v4g2000vbb.googlegroups.com>
NNTP-Posting-Host: 68.115.199.198
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1231881152 9974 127.0.0.1 (13 Jan 2009 21:12:32 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 13 Jan 2009 21:12:32 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: v4g2000vbb.googlegroups.com; posting-host=68.115.199.198; posting-account=gzV4VwoAAAD-g_7GnvW_RQhNH-5Fr_FT
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB5; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
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!v4g2000vbb.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88594
Article PK: 417848

We are using PowerBuilder 10.21 Build 9948. We have been using ASA
8.03 for several years. In 8.03 we used a convention when creating
computed columns to get the correct number of decimal positions in the
column type for a datawindow.

The following SQL

Select
account_amount,
cc_dec = if 0=1 then 1.23 else null endif,
cc_string = if 0=1 then space(20) else null endif
from sometable

generated column values in the datawindow of

account_amount decimal(2)
cc_dec decimal(2)
cc_string char(20)

In SQLAnywhere 11, evidently they've done substantial work on the
optimizer and it is now smarter than us. We now get

account_amount decimal(2)
cc_dec decimal(0)
cc_string char(32766)

If we change the SQL to

Select
cc_dec = if 1=1 then 1.23 else null endif
cc_string = if 1=1 then space(20) else null endif
from sometable

then cc_dec is created as decimal(2).
Evidently Space(20) never is evaluated correctly as we always get char
(32766) even if we say cc_string=space(20).

What's a good way to set a computed column's data type to get the
desired data type?

While our way wasn't elegant it at least always worked and we could
define computed columns to be the correct size.


"Paul Horan[Sybase]" <phoran_remove Posted on 2009-01-14 02:14:02.0Z
From: "Paul Horan[Sybase]" <phoran_remove@remove_sybase.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <53fcc838-0348-4041-bd2f-4cb00e96d9fc@v4g2000vbb.googlegroups.com>
Subject: Re: Column Type Wrong in upgrade from ASA 8 to SA 11
Lines: 52
Organization: Sybase
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <496d4a6a$1@forums-1-dub>
Date: 13 Jan 2009 18:14:02 -0800
X-Trace: forums-1-dub 1231899242 10.22.241.152 (13 Jan 2009 18:14:02 -0800)
X-Original-Trace: 13 Jan 2009 18:14:02 -0800, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:88595
Article PK: 417849

Cast( <column name> as <datatype> ) as alias

--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com

"jclanton" <jclanton@propertyboss.com> wrote in message
news:53fcc838-0348-4041-bd2f-4cb00e96d9fc@v4g2000vbb.googlegroups.com...
> We are using PowerBuilder 10.21 Build 9948. We have been using ASA
> 8.03 for several years. In 8.03 we used a convention when creating
> computed columns to get the correct number of decimal positions in the
> column type for a datawindow.
>
> The following SQL
>
> Select
> account_amount,
> cc_dec = if 0=1 then 1.23 else null endif,
> cc_string = if 0=1 then space(20) else null endif
> from sometable
>
> generated column values in the datawindow of
>
> account_amount decimal(2)
> cc_dec decimal(2)
> cc_string char(20)
>
> In SQLAnywhere 11, evidently they've done substantial work on the
> optimizer and it is now smarter than us. We now get
>
> account_amount decimal(2)
> cc_dec decimal(0)
> cc_string char(32766)
>
> If we change the SQL to
>
> Select
> cc_dec = if 1=1 then 1.23 else null endif
> cc_string = if 1=1 then space(20) else null endif
> from sometable
>
> then cc_dec is created as decimal(2).
> Evidently Space(20) never is evaluated correctly as we always get char
> (32766) even if we say cc_string=space(20).
>
> What's a good way to set a computed column's data type to get the
> desired data type?
>
> While our way wasn't elegant it at least always worked and we could
> define computed columns to be the correct size.