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.

Setiem problem in PB10

8 posts in DataWindow Last posting was on 2008-06-26 13:50:25.0Z
frankie lo Posted on 2008-06-25 07:26:48.0Z
From: "frankie lo" <frankiecblo@hotmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Setiem problem in PB10
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4861f338@forums-1-dub>
Date: 25 Jun 2008 00:26:48 -0700
X-Trace: forums-1-dub 1214378808 10.22.241.152 (25 Jun 2008 00:26:48 -0700)
X-Original-Trace: 25 Jun 2008 00:26:48 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87246
Article PK: 416503

Hi all,

There is an "address" field (char 45) on a datawindow with a length of 45
limited width in 'EDIT' tab setup, it is fine if user types address value
manually as datawindows don't allow that more than 45 char entered.

However, if providing "SetItem" for user to pickup the address value from
other system that address value we can't control.

e.g. dw_header.SetItem(1, "address", st_addess)

We find that if the value "st_addess" is larger than 45 say 50, there is no
"WARNING" until save to db with db error.

Do you know what happen?


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-06-25 13:09:34.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4861f338@forums-1-dub>
Subject: Re: Setiem problem in PB10
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4862438e$1@forums-1-dub>
Date: 25 Jun 2008 06:09:34 -0700
X-Trace: forums-1-dub 1214399374 10.22.241.152 (25 Jun 2008 06:09:34 -0700)
X-Original-Trace: 25 Jun 2008 06:09:34 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87248
Article PK: 416506

That's expected behavior. PB respects the programmer enough to accept
whatever the SetItem does. If your other system has a greater character
limit, try dw_header.SetItem(1, "address", Left(st_addess, 45)) or put an
insert/update trigger on the table to do a similar truncation.

"frankie lo" <frankiecblo@hotmail.com> wrote in message
news:4861f338@forums-1-dub...
> Hi all,
>
> There is an "address" field (char 45) on a datawindow with a length of 45
> limited width in 'EDIT' tab setup, it is fine if user types address value
> manually as datawindows don't allow that more than 45 char entered.
>
> However, if providing "SetItem" for user to pickup the address value from
> other system that address value we can't control.
>
> e.g. dw_header.SetItem(1, "address", st_addess)
>
> We find that if the value "st_addess" is larger than 45 say 50, there is
> no "WARNING" until save to db with db error.
>
> Do you know what happen?
>
>
>
>
>


frankie lo Posted on 2008-06-26 13:50:25.0Z
From: "frankie lo" <frankiecblo@hotmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4861f338@forums-1-dub> <4862438e$1@forums-1-dub>
Subject: Re: Setiem problem in PB10
Lines: 39
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.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48639ea1@forums-1-dub>
Date: 26 Jun 2008 06:50:25 -0700
X-Trace: forums-1-dub 1214488225 10.22.241.152 (26 Jun 2008 06:50:25 -0700)
X-Original-Trace: 26 Jun 2008 06:50:25 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87263
Article PK: 416519

Hi jerry,
In this, I would perfer set the validation in pre-update to pop up warning
to allow user to edit back.

Thanks for your advice

"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> wrote in message
news:4862438e$1@forums-1-dub...
> That's expected behavior. PB respects the programmer enough to accept
> whatever the SetItem does. If your other system has a greater character
> limit, try dw_header.SetItem(1, "address", Left(st_addess, 45)) or put an
> insert/update trigger on the table to do a similar truncation.
>
> "frankie lo" <frankiecblo@hotmail.com> wrote in message
> news:4861f338@forums-1-dub...
>> Hi all,
>>
>> There is an "address" field (char 45) on a datawindow with a length of 45
>> limited width in 'EDIT' tab setup, it is fine if user types address value
>> manually as datawindows don't allow that more than 45 char entered.
>>
>> However, if providing "SetItem" for user to pickup the address value from
>> other system that address value we can't control.
>>
>> e.g. dw_header.SetItem(1, "address", st_addess)
>>
>> We find that if the value "st_addess" is larger than 45 say 50, there is
>> no "WARNING" until save to db with db error.
>>
>> Do you know what happen?
>>
>>
>>
>>
>>
>
>


Chris Pollach Posted on 2008-06-25 16:01:08.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4861f338@forums-1-dub>
Subject: Re: Setiem problem in PB10
Lines: 43
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.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48626bc4$1@forums-1-dub>
Date: 25 Jun 2008 09:01:08 -0700
X-Trace: forums-1-dub 1214409668 10.22.241.152 (25 Jun 2008 09:01:08 -0700)
X-Original-Trace: 25 Jun 2008 09:01:08 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87253
Article PK: 416507

Frankie;

As Jerry pointed out .. the SetItem ( ) method trusts the application to
provide the correct data.

May I suggest that if you have any doubts on the data's quality that you
use the SetText ( ) method instead. The ST method puts the data into the
keyboard buffer where the DW object will then process it with all its
validation rules and then fire the ItemChanged, etc events as if the end
user keyed in the value! :-)

HTH

--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com

"frankie lo" <frankiecblo@hotmail.com> wrote in message
news:4861f338@forums-1-dub...
> Hi all,
>
> There is an "address" field (char 45) on a datawindow with a length of 45
> limited width in 'EDIT' tab setup, it is fine if user types address value
> manually as datawindows don't allow that more than 45 char entered.
>
> However, if providing "SetItem" for user to pickup the address value from
> other system that address value we can't control.
>
> e.g. dw_header.SetItem(1, "address", st_addess)
>
> We find that if the value "st_addess" is larger than 45 say 50, there is
> no "WARNING" until save to db with db error.
>
> Do you know what happen?
>
>
>
>
>


Paul Horan[TeamSybase] Posted on 2008-06-25 16:17:34.0Z
From: "Paul Horan[TeamSybase]" <phoran_nospam@sybase.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4861f338@forums-1-dub> <48626bc4$1@forums-1-dub>
Subject: Re: Setiem problem in PB10
Lines: 66
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48626f9e$1@forums-1-dub>
Date: 25 Jun 2008 09:17:34 -0700
X-Trace: forums-1-dub 1214410654 10.22.241.152 (25 Jun 2008 09:17:34 -0700)
X-Original-Trace: 25 Jun 2008 09:17:34 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87254
Article PK: 416514

UGH! Calling the OO police!! Writing the validation logic into the
ItemChanged event of the datawindow control has always bothered me, as it
only handles one use case - the user enters data into a field and the
ItemChanged event fires...
The OP clearly needs to invoke THE SAME field-level validation in two
different places - the traditional ItemChanged event (where you validate the
contents of the edit buffer) and a pre-save event (where you validate the
current contents of any column in the datawindow).

One implementation (and I'm not claiming it's the "correct" one) would be to
define a set of NVOs that correspond to your data entities. n_cst_customer,
n_cst_order, etc. Write of_validate_<field> methods for each attribute of
the entity. Or, write ONE method, and pass in the field name as a
parameter. Put all the validation logic in there, and you can invoke the
same code from both places.

Paul Horan[TeamSybase]

"Chris Pollach" <cpollach@travel-net.com> wrote in message
news:48626bc4$1@forums-1-dub...
> Frankie;
>
> As Jerry pointed out .. the SetItem ( ) method trusts the application
> to provide the correct data.
>
> May I suggest that if you have any doubts on the data's quality that
> you use the SetText ( ) method instead. The ST method puts the data into
> the keyboard buffer where the DW object will then process it with all its
> validation rules and then fire the ItemChanged, etc events as if the end
> user keyed in the value! :-)
>
> HTH
>
> --
> Regards ... Chris
> ISUG - NA RUG Director
> http://chrispollach.pbdjmagazine.com
>
>
> "frankie lo" <frankiecblo@hotmail.com> wrote in message
> news:4861f338@forums-1-dub...
>> Hi all,
>>
>> There is an "address" field (char 45) on a datawindow with a length of 45
>> limited width in 'EDIT' tab setup, it is fine if user types address value
>> manually as datawindows don't allow that more than 45 char entered.
>>
>> However, if providing "SetItem" for user to pickup the address value from
>> other system that address value we can't control.
>>
>> e.g. dw_header.SetItem(1, "address", st_addess)
>>
>> We find that if the value "st_addess" is larger than 45 say 50, there is
>> no "WARNING" until save to db with db error.
>>
>> Do you know what happen?
>>
>>
>>
>>
>>
>
>


Chris Pollach Posted on 2008-06-25 16:43:42.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4861f338@forums-1-dub> <48626bc4$1@forums-1-dub> <48626f9e$1@forums-1-dub>
Subject: Re: Setiem problem in PB10
Lines: 78
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.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <486275be$1@forums-1-dub>
Date: 25 Jun 2008 09:43:42 -0700
X-Trace: forums-1-dub 1214412222 10.22.241.152 (25 Jun 2008 09:43:42 -0700)
X-Original-Trace: 25 Jun 2008 09:43:42 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87256
Article PK: 416512

I agree 100% - its whether Anna has the time to engineer it the correct way
if she is just starting to code this or whether she is on a tight timeline
and just modifying existing code.

"Paul Horan[TeamSybase]" <phoran_nospam@sybase.com> wrote in message
news:48626f9e$1@forums-1-dub...
> UGH! Calling the OO police!! Writing the validation logic into the
> ItemChanged event of the datawindow control has always bothered me, as it
> only handles one use case - the user enters data into a field and the
> ItemChanged event fires...
> The OP clearly needs to invoke THE SAME field-level validation in two
> different places - the traditional ItemChanged event (where you validate
> the contents of the edit buffer) and a pre-save event (where you validate
> the current contents of any column in the datawindow).
>
> One implementation (and I'm not claiming it's the "correct" one) would be
> to define a set of NVOs that correspond to your data entities.
> n_cst_customer, n_cst_order, etc. Write of_validate_<field> methods for
> each attribute of the entity. Or, write ONE method, and pass in the field
> name as a parameter. Put all the validation logic in there, and you can
> invoke the same code from both places.
>
> Paul Horan[TeamSybase]
>
>
> "Chris Pollach" <cpollach@travel-net.com> wrote in message
> news:48626bc4$1@forums-1-dub...
>> Frankie;
>>
>> As Jerry pointed out .. the SetItem ( ) method trusts the application
>> to provide the correct data.
>>
>> May I suggest that if you have any doubts on the data's quality that
>> you use the SetText ( ) method instead. The ST method puts the data into
>> the keyboard buffer where the DW object will then process it with all its
>> validation rules and then fire the ItemChanged, etc events as if the end
>> user keyed in the value! :-)
>>
>> HTH
>>
>> --
>> Regards ... Chris
>> ISUG - NA RUG Director
>> http://chrispollach.pbdjmagazine.com
>>
>>
>> "frankie lo" <frankiecblo@hotmail.com> wrote in message
>> news:4861f338@forums-1-dub...
>>> Hi all,
>>>
>>> There is an "address" field (char 45) on a datawindow with a length of
>>> 45 limited width in 'EDIT' tab setup, it is fine if user types address
>>> value manually as datawindows don't allow that more than 45 char
>>> entered.
>>>
>>> However, if providing "SetItem" for user to pickup the address value
>>> from other system that address value we can't control.
>>>
>>> e.g. dw_header.SetItem(1, "address", st_addess)
>>>
>>> We find that if the value "st_addess" is larger than 45 say 50, there is
>>> no "WARNING" until save to db with db error.
>>>
>>> Do you know what happen?
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>


"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel Posted on 2008-06-25 16:27:16.0Z
From: "Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4861f338@forums-1-dub> <48626bc4$1@forums-1-dub> <48626f9e$1@forums-1-dub>
Subject: Re: Setiem problem in PB10
Lines: 75
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <486271e4@forums-1-dub>
Date: 25 Jun 2008 09:27:16 -0700
X-Trace: forums-1-dub 1214411236 10.22.241.152 (25 Jun 2008 09:27:16 -0700)
X-Original-Trace: 25 Jun 2008 09:27:16 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87255
Article PK: 416513

It might be belt and suspenders in this case, but I've also seen validation
done in triggers, which will also cleanse data entered via other utilities
or SQL.

"Paul Horan[TeamSybase]" <phoran_nospam@sybase.com> wrote in message
news:48626f9e$1@forums-1-dub...
> UGH! Calling the OO police!! Writing the validation logic into the
> ItemChanged event of the datawindow control has always bothered me, as it
> only handles one use case - the user enters data into a field and the
> ItemChanged event fires...
> The OP clearly needs to invoke THE SAME field-level validation in two
> different places - the traditional ItemChanged event (where you validate
> the contents of the edit buffer) and a pre-save event (where you validate
> the current contents of any column in the datawindow).
>
> One implementation (and I'm not claiming it's the "correct" one) would be
> to define a set of NVOs that correspond to your data entities.
> n_cst_customer, n_cst_order, etc. Write of_validate_<field> methods for
> each attribute of the entity. Or, write ONE method, and pass in the field
> name as a parameter. Put all the validation logic in there, and you can
> invoke the same code from both places.
>
> Paul Horan[TeamSybase]
>
>
> "Chris Pollach" <cpollach@travel-net.com> wrote in message
> news:48626bc4$1@forums-1-dub...
>> Frankie;
>>
>> As Jerry pointed out .. the SetItem ( ) method trusts the application
>> to provide the correct data.
>>
>> May I suggest that if you have any doubts on the data's quality that
>> you use the SetText ( ) method instead. The ST method puts the data into
>> the keyboard buffer where the DW object will then process it with all its
>> validation rules and then fire the ItemChanged, etc events as if the end
>> user keyed in the value! :-)
>>
>> HTH
>>
>> --
>> Regards ... Chris
>> ISUG - NA RUG Director
>> http://chrispollach.pbdjmagazine.com
>>
>>
>> "frankie lo" <frankiecblo@hotmail.com> wrote in message
>> news:4861f338@forums-1-dub...
>>> Hi all,
>>>
>>> There is an "address" field (char 45) on a datawindow with a length of
>>> 45 limited width in 'EDIT' tab setup, it is fine if user types address
>>> value manually as datawindows don't allow that more than 45 char
>>> entered.
>>>
>>> However, if providing "SetItem" for user to pickup the address value
>>> from other system that address value we can't control.
>>>
>>> e.g. dw_header.SetItem(1, "address", st_addess)
>>>
>>> We find that if the value "st_addess" is larger than 45 say 50, there is
>>> no "WARNING" until save to db with db error.
>>>
>>> Do you know what happen?
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>


Chris Pollach Posted on 2008-06-25 16:45:33.0Z
From: "Chris Pollach" <cpollach@travel-net.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <4861f338@forums-1-dub> <48626bc4$1@forums-1-dub> <48626f9e$1@forums-1-dub> <486271e4@forums-1-dub>
Subject: Re: Setiem problem in PB10
Lines: 85
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.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4862762d$1@forums-1-dub>
Date: 25 Jun 2008 09:45:33 -0700
X-Trace: forums-1-dub 1214412333 10.22.241.152 (25 Jun 2008 09:45:33 -0700)
X-Original-Trace: 25 Jun 2008 09:45:33 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:87257
Article PK: 416511

Another excellent idea .. unless, the application spans multiple DBMS's and
the Trigger approach becomes harder to maintain than a single NVUO/DWO
approach in PB. Trade-offs - don't you just love em? :-)

"Jerry Siegel [TeamSybase]" <jNOsSPAMsiegel@yahoo!.com> wrote in message
news:486271e4@forums-1-dub...
> It might be belt and suspenders in this case, but I've also seen
> validation done in triggers, which will also cleanse data entered via
> other utilities or SQL.
>
> "Paul Horan[TeamSybase]" <phoran_nospam@sybase.com> wrote in message
> news:48626f9e$1@forums-1-dub...
>> UGH! Calling the OO police!! Writing the validation logic into the
>> ItemChanged event of the datawindow control has always bothered me, as it
>> only handles one use case - the user enters data into a field and the
>> ItemChanged event fires...
>> The OP clearly needs to invoke THE SAME field-level validation in two
>> different places - the traditional ItemChanged event (where you validate
>> the contents of the edit buffer) and a pre-save event (where you validate
>> the current contents of any column in the datawindow).
>>
>> One implementation (and I'm not claiming it's the "correct" one) would be
>> to define a set of NVOs that correspond to your data entities.
>> n_cst_customer, n_cst_order, etc. Write of_validate_<field> methods for
>> each attribute of the entity. Or, write ONE method, and pass in the
>> field name as a parameter. Put all the validation logic in there, and
>> you can invoke the same code from both places.
>>
>> Paul Horan[TeamSybase]
>>
>>
>> "Chris Pollach" <cpollach@travel-net.com> wrote in message
>> news:48626bc4$1@forums-1-dub...
>>> Frankie;
>>>
>>> As Jerry pointed out .. the SetItem ( ) method trusts the application
>>> to provide the correct data.
>>>
>>> May I suggest that if you have any doubts on the data's quality that
>>> you use the SetText ( ) method instead. The ST method puts the data into
>>> the keyboard buffer where the DW object will then process it with all
>>> its validation rules and then fire the ItemChanged, etc events as if the
>>> end user keyed in the value! :-)
>>>
>>> HTH
>>>
>>> --
>>> Regards ... Chris
>>> ISUG - NA RUG Director
>>> http://chrispollach.pbdjmagazine.com
>>>
>>>
>>> "frankie lo" <frankiecblo@hotmail.com> wrote in message
>>> news:4861f338@forums-1-dub...
>>>> Hi all,
>>>>
>>>> There is an "address" field (char 45) on a datawindow with a length of
>>>> 45 limited width in 'EDIT' tab setup, it is fine if user types address
>>>> value manually as datawindows don't allow that more than 45 char
>>>> entered.
>>>>
>>>> However, if providing "SetItem" for user to pickup the address value
>>>> from other system that address value we can't control.
>>>>
>>>> e.g. dw_header.SetItem(1, "address", st_addess)
>>>>
>>>> We find that if the value "st_addess" is larger than 45 say 50, there
>>>> is no "WARNING" until save to db with db error.
>>>>
>>>> Do you know what happen?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>