MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » July 2008

Re: SQL character field to numeric and back



fixed

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

I was wondering. Are you using AS/400 (DB2) syntax for what you are
trying to do or are you trying to use syntax for say Sql Server?

I have got burned on that on before.

The statement you enter is sent to the AS/400 as is. I would try
creating the sql statement on the AS/400 to get it to work and taking
that statement to the .net application. If it won't work on the AS/400
then it won't work in .Net.






Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact