Copy link to clipboard
Copied
Hi,
I have a query that I use in a drop down form. NOMEN.GENERIC_NOMEN is the values that I want displayed in the drop down
While the value I want to select is NOMEN.NOMENCLATURE_ID.
Here is the underlying Query (notice it is sorted by the form values that I want to display)
<cfquery name="NOMEN" datasource="ilmf_parts_dev" blockfactor="100">
SELECT *
FROM NOMEN_TABLE
ORDER BY GENERIC_NOMEN ASC
</cfquery>
Here is the code for that part of the form:
<td width="96" class="style1">Nomenclature</td>
<td width="379" class="style1"><cfselect name="Add_Inv_Nomen">
<cfoutput query="NOMEN">
<option value="#NOMEN.NOMENCLATURE_ID#">#NOMEN.GENERIC_NOMEN#</option>
</cfoutput>
</cfselect> </td>
For some reason, the drop down displays the text in the order of the table index instead of alphabetically in ASC order.
Any Ideas?
Eric
Ps Running off of Oracle 11g DB.
Copy link to clipboard
Copied
What's the outcome if you cfdump the query results?
Copy link to clipboard
Copied
It does not come out in alphabetical order (seems like it should !)
Look at how the Printer entries are broken up...
Eric
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CACHED | false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EXECUTIONTIME | 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SQL | SELECT * FROM NOMEN_TABLE ORDER BY GENERIC_NOMEN ASC |
Copy link to clipboard
Copied
Another simple/dumb question but will help trace the issue...
Can you run the same statement directly inside of the oracle environment, apart from coldfusion, and see what the result set is if you haven't already?
Copy link to clipboard
Copied
I haven't used blockfactor but I guess I would try to drop that and see what happens. I don't see it causing issues but if we can strip down to the very basics it may be a better starting point. (Again, you may have tried this)
Copy link to clipboard
Copied
Removing "Blockfactor" has no effect on the problem.
I also ran the query directly in Oracle SQL Developer and it sorted in the same incorrect order.
I think it has something to do with sorting on VARCHAR2 feild types...
Eric
Copy link to clipboard
Copied
Yep, that'd be the cause. I know you can use some decode/replace functionality within the sql to sort a varchar2 but I'm not positive of the structure of those statements. Sorry I couldn't be of any additional help. Good luck.
Copy link to clipboard
Copied
For the benifit of others with this problem, I will expose myself as an idiot and reveal the solution...
There was a space character before 3 of the PRINTER entries in the table. This is why
those three did not sort correctly. I did not notice this initially as I did not have my glasses.
Eric