-1

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?

Roby Sottini
  • 2,117
  • 6
  • 48
  • 88

1 Answers1

1

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

Steve Leighton
  • 790
  • 5
  • 15