Search code examples
sqldatabaseoracle-databaseora-01722

Combining two columns into one column returning ORA-01722: invalid number


SELECT X.FIRSTNAME + ' ' + X.LASTNAME as names FROM B_CUSTOMERS X;

returns the error:

ORA-01722: invalid number 01722. 00000 - "invalid number" *Cause:
*Action:

All research I have done indicates that this is a perfectly viable method for combining columns.


Solution

  • Use ||

    SELECT X.FIRSTNAME || ' ' || X.LASTNAME as names 
    FROM B_CUSTOMERS X