Subject RE: [firebird-support] how to lpad in a stored procedure
Author Helen Borrie
At 11:30 AM 21/02/2005 +1100, Alan McDonald wrote:


>Are you wanting this for a primary key? If so I wouldn't advise it.

There's nothing wrong with a string for a primary key, provided it can be
depended on to be based on a generator and the base number is always a
generated number.

>Needless
>to say that you are changing the datatype here,... but in any case this
>padding of integers is better carried out on the client application if you
>just want to display padded numbers.

It appears that a "display fudge" wasn't what was required here. He seems
to need to match up a key that is generated by another dbms.

It's not very good advice to recommend calculating keys, whether primary or
not, in the client application, if they have to be stored. It will blow up
in your face the first time another application (including an interactive
tool) tries to insert a record.

./hb