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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle DECODE not giving correct results in CF

Status
Not open for further replies.

mamabird

Programmer
Dec 19, 2006
15
US
I am using CFMX and Oracle 10g.

I am trying to populate a dropdown list from a database using the format "last name, first name". One of the values in the list of users is NA (there is an NA in both the first_name and last_name fields of the database). I don't want the NA record to display as "NA, NA" so I have the following select statement:

Code:
SELECT last_name || DECODE(first_name, 'NA', '', ' ,'||first_name) AS name
FROM users

When run in Toad or SQL Plus I get the following result which is what I want:

Code:
NA
Grouch, Oscar
Smith, Tom

When I run it from my CF app, the dropdown looks likes this:

Code:
NA
Grouch
Oscar
Smith
Tom

It's taking everything following the comma in my default value and putting it on the next line. This is not an Oracle issue as it works in an Oracle tool, but not in CF.

Any ideas?

Thank you!
mamabird
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top