SQLBase: is there a lpad function?

65 views Asked by At

I am using SQLBase and I have to complete a column with zeros.

This example works in PostgreSQL. I need to do the same in SQLBase but there isn't a function like lpad.

SELECT lpad(last_name, 10, '0')
FROM persons;

If last_name is Douglas, the result is:

000Douglas

Is there a way to define a function that can do the same as lpad?

1

There are 1 answers

0
Steve Leighton On BEST ANSWER

Select @REPEAT('0', 10 - @LENGTH(Last_Name) ) || Last_Name