Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

True not a valid identifier

Status
Not open for further replies.

enuss

MIS
Mar 16, 2004
37
0
0
US
I am getting ORA-00904 Error when running the below expression :

DECODE(CEXRPTSUMMARYDETAIL,0,False,True) AS ExceptionSummary

Does anyone know what the correct identifier is for a boolean expression like this?

Erich
 
There is no simple answer. It depends on what is in the column CEXRPTSUMMARYDETAIL. It could be 'Y' or 'N'/0 or 1/'T' or 'F', or something else entirely. Try doing "select distinct CEXRPTSUMMARYDETAIL from table" and see what you get back.

 
Erich,

As you know, TRUE and FALSE, in and of themselves, are BOOLEAN expressions. Oracle's DECODE function is not prepared to use either TRUE or FALSE as any of its arguments or resulting-expression value. Therefore, the best that you can hope for is to produce CHARACTER expressions (via single quotes) that represent TRUE or FALSE values. You can say:
Code:
DECODE(CEXRPTSUMMARYDETAIL,0,'False','True') AS ExceptionSummary
...or...
Code:
DECODE(CEXRPTSUMMARYDETAIL,0,'F','T') AS ExceptionSummary
...or...
Code:
DECODE(CEXRPTSUMMARYDETAIL
        ,0,'<any other value that represents FALSE>'
        ,'<any other value that represents TRUE>')
        AS ExceptionSummary
Let us know if this is useful to you.


[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I can provide you with low-cost, remote Database Administration services: see our website and contact me via www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top