Doug Lawry wrote:
> Try not to post MIME, Dirk :-) A cleaned up version follows.
> Looks like you need to upgrade: LPAD is there in version 9.
>>
>> Oracle has an "lpad" function, to add characters to the left of a string
>> - what is the equivelant of this function in Informix ? Cannot find
>> lpad function in the SQL manuals ...
>>
>> The problem is, I don't want to concatenate, ||, the result must always
>> be to characters long.
>>
>> If cl_m_d_no is 0, I want 00
>> If cl_m_d_no is 9, I want 09
>> If cl_m_d_no is 11, it stays 11
>>
Assuming cl_m_d_no is a numeric datatype, you could write
trunc(cl_m_d_no / 10) || mod(cl_m_d_no, 10)
instead of lpad(cl_m_d_no, 2, "0")
or
trunc(cl_m_d_no / 100) || mod(trunc(cl_m_d_no / 10), 10) || mod(cl_m_d_no, 10)
instead of lpad(cl_m_d_no, 3, "0")
Regards
--
Roland Wintgen (Systemadministrator)
EVG Elektro-Vertriebs-Gesellschaft Martens GmbH & Co KG
Trompeterallee 244-246, D-41189 Moenchengladbach
Tel. +49 21 66 / 55 08 23, Fax +49 21 66 / 55 08 90
www.evg.de rw@evg.de