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



One of my programmers sent this to me:

***********************************************************************
""Oracle PLSQL has a function called LPAD

For example,
lpad(src, n, p) Returns src, left-padded to length n with the string p
lpad('Hello', 10, '0') = '00000Hello'

I couldn't find a lpad function for DB2. I am trying to pad the location ID with leading zeros so it is a total of 9 characters. I googled some DB2 forums and found something like this:

repeat('0',9-length(rtrim(char(UTLCID)))) || rtrim(char(UTLCID))

It works, but I just wanted to check with you to make sure there wasn't some other kind of function out there that would be better to use."
************************************************************************
Even though there is an SQL Reserved word REPEAT, it seems to be only used in Triggers or code in some language, not as an inherent function of DB2 or DB2/400. Did I miss something?

Thanks in advance,

Dave Odom


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.