Solved

how can i convert a numeric field to a character field using as400 query

Posted on 2008-10-26
3
1,192 Views
Last Modified: 2013-12-06
I would like to know how to convert an numeric field to a character fiels using AS400 Query on an i5 OS
0
Comment
Question by:louva
  • 2
3 Comments
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 22808026
Hi there;

You have to use the DIGITS function to convert numeric to character first.
Then you can use SUBSTR if you like...

substr(digits(blabla, 2, 3))

Best regards...
0
 
LVL 12

Accepted Solution

by:
jazzIIIlove earned 500 total points
ID: 22808033
Of course:

You can't substring numerics. Convert it to a character first; then substring that result.

Best regards...

0
 
LVL 18

Expert Comment

by:daveslash
ID: 22813247

If you're using SQL (which is generally WAY easier and more powerful), then you can simply use the CHAR or VARCHAR functions.

e.g.

select char(aNumeric)

from   deleteme

;
 

HTH,

DaveSlash

Open in new window

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

#Citrix #POC #XenDesktop #vCenter #VMware #ESX
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now