× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



THANKS ALL,, the one below worked first time out from the 400, let y'all
know later on it working from the .NET app

On Thu, Jul 10, 2008 at 5:24 PM, CRPence <CRPbottle@xxxxxxxxx> wrote:

Mark Allen wrote:
Situation is I have a 13 byte alpha field in a vendor supplied table
on the 400.

The first 9 positions are a next number field as 000123456 followed
by 4 blanks.

We are putting a .NET app together that needs to update/increment
the numeric portion of the data by 2 (in this example it would then
be 000123458).. We've tried various combinations of CAST, CONVERT,
SUBSTRING etc without any luck

Given that is a thorough and accurate representation of the data in
all rows for the field [i.e. valid representation of a numeric using
character digits, sign, decimal separator, and only leading or trailing
blanks], since I believe v5r3 which has implicit casting between numeric
and character, then the following example shows all that should be
required. See the update:

create table vfile (a13 char (13))
;
insert into table vfile values('000123456 ')
;
update vfile set a13=digits(decimal((a13+2), 9, 0)
-- the parentheses around the addition are optional
;
select count(*) from vfile where a13=12345678
-- that should return one, for the one updated row

Regards, Chuck
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.