Progress DB casting a number to add a character

Discussão em 'StackOverflow' iniciado por fdantas, Dezembro 3, 2015.

  1. fdantas

    fdantas Administrator Moderador

    I don't know how to describe this so I'm going to do my best here...

    In a select:

    SELECT "PUB"."EMPLOYEEID" as IdNum from Users


    Works, and it pulls up a list of ID numbers. However, I need the numbers to have a leading 0 if they are only 4 characters long.

    So I wrote up a length checker and it was failing. So I dropped back and just attempted to add a zero to all to see if that was causing the issue and sure enough it was. It seems the column is a type number of some sort (I don't have access to the schema) so the command

    SELECT '0' + "PUB"."EmployeeID" as IdNum from Users


    Does not work... I can add the '0' to a name field with no issues. So I assume it's a casting issue of some sort. With MSSQL I can do this without converting fields.... Unfortunately, I'm not extremely versed in Progress...

    Continue reading...

Compartilhe esta Página