Solved

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

Posted on 2008-10-26
3
1,204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Dave Ford
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

705 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