× 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.



Hi,

You problem is, the numeric values get left adjusted without leading zeros
or blanks.
You need the values right adjusted with leading zeros, isn't it?

If the new file is already filled, you might use the following
update-statement to correct the column value:
With the following statement the numeric value in MyCol get right adjusted
with leading zeros.

Update mytable2
set MyCol = translate(space(length(MyCol)-length(Trim(MyCol))),
'0', ' ') concat MyCol

If you want to change the column in your insert statement, you may use the
following conversation:
Insert ....
Select Col1, Col2, ...., '0' concat Digits(MyCol), ....
From ....

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and loosing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von David FOXWELL
Gesendet: Friday, 03. October 2008 11:46
An: Midrange Systems Technical Discussion
Betreff: SQL insert character field into numeric

Hi!

insert into modifiedFile
select *from originalFile

I just discovered that I can do this, having changed the key in the file
from 6,0 to 7character. Only, in the modified file I need to keep my leading
zeros. Is there a way of doing this?

Thanks!

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.