Oracle - ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
Hello all
I have an error in the query bellow saying:
ORA-00932: inconsistent datatypes: expected NUMBER got CHAR
How can i fix this?
The value i have in that column is a rate. I want to have the format 0.00
Thanks again for your help
SELECT 'H', 'M', ROW_NUMBER() OVER (ORDER BY TLR.CARRIER_ID) as ROW_NUM, TLR.CARRIER_ID, LRN.FROM_KEY_NUM, LRN.FROM_LOW_KEY_VALUE, CASE LRN.FROM_HIGH_KEY_VALUE WHEN '0' THEN '' ELSE LRN.FROM_HIGH_KEY_VALUE END, LRN.FROM_COUNTRY, LRN.TO_KEY_NUM, LRN.TO_LOW_KEY_VALUE, CASE LRN.TO_HIGH_KEY_VALUE WHEN '0' THEN '' ELSE LRN.TO_HIGH_KEY_VALUE END, LRN.TO_COUNTRY, CASE TRD.UNLOAD_MILE_RATE WHEN '0' THEN '' ELSE TO_CHAR(TRD.UNLOAD_MILE_RATE,'fm99999.00') END, TRD.MAX_STOPSFROM TL_RATE TLR, TL_RATE_DETAIL TRD, LANE_RATE_NETWORK LRN
Ok, I was wrong about changing the function, go back to TO_CHAR. Change the THEN '' to THEN NULL, and try again.
SQL*Plus is a client-side terminal session. With the target username, password, target database (SID), and TCP/IP port, one can get into command line mode without any GUI interference. It's a separate discussion, plenty of how-to in the knowledge base and on Oracle.
FYI, if you use SQL*Plus to test the statement, the parser will indicate where the error was found -- a faster way to debug the code.