View the contents of a query in certain order

What is the best way to list the content of a query in a particular order; for example, two parts in stock first; Then, the first to the fifth. The thing is that in this situation special that I have only a cfoutput because of other things that surround inside a table thank you for your comments...


To be more precise:
say this is my regular cfoutput - two columns: OID and name; Oracle DB
-------------------------------------------------
OID / name
1A
1 a
3 C
1.
5 E
--------------------------------------------------
but in fact, I want it to appear as follows:
--------------------------------------------------
OID / name
5 E
1.
1A
1 a
3 C
--------------------------------------------------
I did the following to the above; but do not get the result I want:)
--------------------------------------------------
< CFSCRIPT >
arrDecision1 = ArrayNew (1);

for (i = 1; i LTE 3; i = i + 1) {}

Temp = StructNew ();
Temp.decision_id = qryDecision.decision_id ;
Temp.Decision = qryDecision.Decision
;

ArrayAppend (arrDecision1, temp);
}

arrDecision2 = ArrayNew (1);
Temp = StructNew ();
Temp.decision_id = 5;
Temp.Decision = "Nothing";
Temp.decision_id = 4;
Temp.Decision = "do something";

ArrayAppend (arrDecision2, temp);

ArrayAppend (arrDecision2, arrDecision1);

< / CFSCRIPT >


< cfoutput >
< index CFLOOP = 'i' = '1' to = "#Arraylen (arrDecision2) #" >

#arrDecision2 .decision_id #-#arrDecision2.the # < br >

< / cfloop >
< / cfoutput >

The correct way to proceed is to add a column to your database, 'SortOrder '. You would then order by SortOrder in your initial query.

A single CF solution (your funeral) should look like this:

Tags: ColdFusion

Similar Questions

  • Can you view the contents of subfolders when you have a selected folder in windows Explorer?

    You have a folder called folder.

    You have a sub folder called folder B.

    In windows Explorer if you have the one selected folder is it possible to view the contents of the folder B then that file is still selected?

    Hi Goatberg,

    Unfortunately, there is no way to show contents of the folder when the parent folder is always selected.

  • How can I view the contents of the .iso files?

    How can I view the contents of the .iso files?

    How can I view the contents of the .iso files?

    http://www.ehow.com/how_7307521_iso-file.html

  • My request is not getting screolled or slide down. Please keep scrollview so that the user can scroll upwards and downwards and view the content.

    My request is not getting screolled or slide down. Please keep scrollview so that the user can scroll upwards and downwards and view the content

    Here is my code that need to be kept scrollview

    
    http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >
    
        
    
            
    
                
    
                
                
    
                
    
                    
    
                        
    
                        
                    
    
                    
    
                        
    
                        
                        
                    
    
                    
    
                
    
                
    
                    
                
            
        
    
    
    

    I just need the view scrollbar or scroll with which users users can scroll vertically in the App and can see full

    content of the app.

    Solved

  • View the contents of the URL

    Hi all

    Currently I am developing an application in which I need to view the contents of the data from the URL to the screen. I mean I don't want to open the URL in the default browser of BB. I want to display the field that is added to the screen.

    Is it possible to view the contents of the URL without using browser...? Please give some suggestions.

    Thank you best regards &,.

    Craig

    Hello

    Thanks a lot for your valuable response. Now, I got the universal application. In fact, I want the limited functionality. So now reference that I can change my request.

    Thank you again...

    Kind regards

    Craig

  • We get the following 'error' in eSign: you are not authorized to view the content of this agreement

    We have an end user with a valid account that receives a request to approve the document, but when he opens the eSign link, it says it is not "authorized to view the content of this document of.  This could be the cause of this problem?

    Thank you.

    Tammy

    The answer is:

    Go to 'visibility limited document' account-> Account settings-> global settings and uncheck the option 'Signatories will see only files containing input fields, acronyms or signed data that a. summer', save changes and send a new transaction, the problem will disappear.

  • How to create a PDF file of a Web site that requires a login to view the content?

    Hello

    I want to create a PDF from a thread on a forum.  However, the forum requires a login to view the content of the thread.  When I paste the URL in acrobat to create the PDF file, it creates a PDF of the login page (not wire).  Is there a way to achieve this?

    Thank you.

    Go to the web page and use the file > Print > printer Adobe PDF?

  • I have 10 pdf files I want to merge to make 1 large pdf. I want to be able to search the content of each of them, in order to make 1 large pdf let me do this... I hope. Which product do I need to merge and create this big 1 pdf in Adobe?

    I have 10 pdf files I want to merge to make 1 large pdf. I want to be able to search the content of each of them, in order to make 1 large pdf let me do this... I hope. Which product do I need to merge and create this big 1 pdf in Adobe?

    You can use Acrobat Pro to combine multiple PDFs into a single PDF.

    You may be able to use Acrobat Standard as well - not sure.

    In my view, there is also a the Adobe online subscription service hosts that combine multiple PDFs into a single PDF.

    As for search. To make available content of every PDF should be text with a font mapping of characters of the regular police having families (each character we see ("glyph") represents a specific numerical value, which is held in the file under the hood) which in turn has a correct mapping to Unicode.  If there are pages that are the output of text parser image then make sure you use OCR to get the result of the OCR to support search/search.

    With all the 'one' PDF support find simple. Using Acrobat Pro, you can embed a search Index. This is a simple step. For full service advanced search use Acrobat Pro to create a stand alone catalogue Index (see the help file).

    Be well...

  • Difficult to view the content of some Web sites

    I'm currently under firefox 26.0 on a laptop. On some websites, I am unable to see the content. The page will just keep loading continuously and the only way I can view content is by pressing the button reload every time. Why is this happening? It is a new installation of mozilla on a computer that completely has been reset.

    Start the computer in safe mode Windows with network support (on the startup screen, press F8) as a test to see if that helps.

    See also:

    You can try to reset (power off / on) of the router.

  • TDMS files viewer and view the contents of the DDHN does not give the same answers.

    I am hoping that there is a simple explanation for this problem.  If I use the PDM File Viewer, it can successfully open my data files large experiment.  The contents are listed without any problem.  Now, if I use the VI of PDM list content, I expect to see the names of groups and channels without data in an indicator.  Instead, I get only 1 group and its associated channels.  Why this discrepancy? Thank you.

    *.Tdms_index always write protected files? Could you try to delete the index files and open the files without them tdms (LabVIEW will generate new files to index if you do that)?

    Herbert

  • view the contents of the sqlite database

    Hey

    Have created a sqlite database and entries stored in the database, I'm stuck all trying to display the contents of the database on the screen.

    I tried thi, but it does not work.

    Try
    {
    D database;
    Var myURI = URI.create ("file:///SDCard/Databases/SQLite_Guide/" +)
    "MyTestDatabase.db");
    d = DatabaseFactory.open (myURI, true);
    Statement st = d.createStatement ("SELECT * FROM data ;"); ")
    St.Prepare ();
    St.Execute ();
    St.Close ();
    d.Close ();
    }

    Can someone tell me please on how should I proceed?

    Thank you very much.

    Remove the rank r = c.getRow (); exposed outside the while loop and check.

    because, it is the 1st row in the result set is assigned to the r. If the query returns only one record, the while loop will not run.

    Before you ensure that the data are available in the table.

  • How to make a statement online to view the content rather than the blank PDF form?

    I use my Mac 10.9.3 with Adobe Reader XI in my browser Safari 7.0.4.  I don't have problems to view the PDF instructions with my bank or other locations OTHER than Ford Credit.  Whenever I connect to Ford credit discovers statements and attempt to download, all I get on screen is their blank form with headers and titles - no content.  When this has happened once before over a year ago with my old Mac computer, I found my answer online through Adobe Reader my default player instead of the preview.  At this time, it worked.  This time, his does not work.  I contacted Ford credit and they said that their online account manager performs best using Internet Explorer.  The only answer they had for me was this notice or to contact Adobe.  So here, I'm looking for answers.  Any help provided is already popular.

    Well, I think I found it finally and "fixed" my problem in this "round about sort of way.  This same fixed icons of the Virgin white sheet on my desk, which also now show 100% of content statement thus:

    Using Firefox, I log in Ford credit.

    I click on the link to see the statements.

    I click on the link that says "print statement.  The declaration appears in a new window of the tab and even if it is empty without content, I proceed to the next step.

    I click on the small "arrow download" next to the "printer" icon and that States opens a pop-up box of "you have chosen to open: 0.pdf.»  What should Firefox do with this file? »

    Undo the default button that says 'save file' and click on the button above him who gives the choice of 'Open with Adobe Reader (default)' and then check the box that says "Do this automatically for files like this in the future".

    Click 'OK' and the document opens in a new window with the form document and 100% of its display of the content information.  ;-)

    Using the toolbar under 'File' Adobe Reader, scroll down and click on "Save as."  The usual pop-up window appears to "save a copy...". "and I continue from there to save my statement under a document name different than what Credit Ford offers.  I have usually to save my words using the date of the statement and place it in a folder in my documents labeled Ford Credit.

    Fact!

    Fixed!

    Achievable!

    Happy!

    And now, on to the rest of my life...

  • After my 10 updated iOS even if I am connected to view the content I have cloud and iCloud when I try it asks me to put in place when already established sound upward. Help, please

    After the last update of iOS10. Even though I am connected to iCloud when I try to display the content he asks me to implement the iCloud. Can anyone help please.

    Try to perform a restart- restart your iPhone, iPad or iPod touch - Apple Support

  • black box in each Web page saying "a plugin is required to view the content.

    In each Web page (also in google home page), I have black box saying "a plugin is required to view this content" when I click on this box, nothing happened...

    Hello, you can try to reproduce this behavior when you start firefox in safe mode, once? If not, perhaps an addon intrudes here...

    Troubleshoot extensions, themes, and issues of hardware acceleration to resolve common problems of Firefox

  • How can I view the content on the screen of my iMac on a TV 50 '' screen?

    How can I see the contents of the screen of my iMac on a 50 "(non-"Smart") screen Samsung TV that I want to use as a monitor?"

    Depending on what link interfaces your TV, you would use

    some type of adapter MiniDisplay Port.

Maybe you are looking for

  • I get this message and the site does not load "OCSP is not yet valid" How can I solve this

    MY system including firefox comes not to trust to all sites at all. I need to confirm the exceptions on Web sites. All certificates are bad "firefox" and after a while, I get the OCSP is not yet valid error message too. What's going to happen? This c

  • Reader of fingerprints of Qosmio X 500-12 L randomly refuses to work

    I have a pretty annoying bug on the 500-12 L X. The fingerprint reader is no longer random. I can put my computer to sleep 4 days in a row, the fifth day, when activated, no more fingerprints than reading. And just try login PASSWORD will result in a

  • How to get rid of Windows 8 and replace it with Windows 7

    I bought my HP Pavilion laptop G6 in December 2012, when all the they had was Windows 8 machines.  So I thought I would give it a try.  Well, I have 8 months now and I still hate Windows 8 .  I want to replace it with Windows 7, the latest stable kno

  • Post Virus Fix problems

    I was just recently hijacked by a virus that blocked internet access after 1 or 2 attempts with false security warnings Windows. I could go initially to my yahoo.ca homepage, but any attempt to go beyond and I was blocked by the above. The rest of th

  • VPN router to the problem of the ASA

    Hello world. I am doing a VPN between a router and a series of ASA5500 and difficulties. The router part is 100% correct because it is a daily task, but miss me something on the side of the ASA of the things. The ASA also has remote via IPsec tunnels