Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Column order

    Hi, I have a problem , I can't retreive the fields in the same order (like in
    the table) when I use the CFDump
    I have the column in a alphabetique order but not in the same order like the
    table.
    I just want to have a CFQuery and display the data in the same order (like
    the table)

    Thank's for your help

    PS: sorry for my bad english ;)

    t047554 Guest

  2. Similar Questions and Discussions

    1. Creating CSV File in Column Order
      We have the following code that creates a csv file. Problem is the code exports columns in alpha order instead of the table column order. Any...
    2. multi column index and order by
      Hello, "order by a asc b desc" how can I create an index for this? Mage ---------------------------(end of...
    3. ArrayList and Column Order (position)
      Hello there, Windows application. I have an ArrayList as datasource. Each object on my list has three properties A,B and C (all are strings)....
    4. Column and line order
      If I have for example: 3 lines and 3 columns Data grid is constructed like this: first line: first column, second column, third colum second...
    5. SQL: is it possible to ORDER BY just the column number?
      Hello, Is it possible to write an SQL statement that references a column number in a database and not the name of the column? Instead of this:...
  3. #2

    Default Re: Column order

    Hopefully you have an autonumber primary key. If you do just add the line ORDER
    BY primary_key to your query. You can also do ORDER BY primary_key asc or desc.
    Using asc or desc can change the order in which you will see it displayed.

    rmorgan Guest

  4. #3

    Default Re: Column order

    Thank you for the replie, but I think it have nothing to do with the column order but with the data order (I think)
    t047554 Guest

  5. #4

    Default Re: Column order

    This is what order by function is for, its been awhile since I used cfdump,
    cant remember its parameters or if changes the data order by default.

    Check it out and see what it does, it should give you what you want.

    rmorgan Guest

  6. #5

    Default Re: Column order

    CFDUMP is going to give you your columns in alpha order. You can use cfgrid and
    use cfgridcolumn tags to specify your column order, or you can use a table in
    the same way, or you can just use cfoutput with a guery attribute, and list
    your column names in the order in which you wish for them to appear.

    Phil

    paross1 Guest

  7. #6

    Default Re: Column order

    Thank's Paross1, but I want to find some think like CFDUMP but with no change
    in the column order.
    If I use CFDUMP, I don't need to specifie all the columns name for the output.
    Or is it possible to retreive in a easy way the columns name in the original
    way (not aphabetique order).
    My problem is that I have made a query that can use differente table, and the
    table don't have all the same structure (columns name)

    Thank's for your help

    t047554 Guest

  8. #7

    Default Re: Column order

    It appears as if you are trying to use cfdump in a production app. cfdump is
    not intended for this, its purpose is for troubleshooting only, it just shows
    the data so you can see if the data you are looking for is at least there. This
    is why you are seeing limitations, this tag just does not have many attributes
    built into it, 3 if i recall. You should rethink what you are trying to do, and
    use another tag. Like paross suggested, there are a couple options, cfgrid and
    its child tags, and a dynamic table should work just fine for you, the other
    tags are more than capable of displaying your data the way you want.

    rmorgan Guest

  9. #8

    Default Re: Column order

    FYI, one thing that I discovered recently is that using CFGRID without any
    CFGRIDCOLUMN tags will return all of the columns in the same order as they
    appear in your query when using CFMX 7. (CFMX 6.x will return the columns in
    alpha order, so this looks like something that was "fixed" with MX 7.)

    Phil

    paross1 Guest

  10. #9

    Default Re: Column order

    [url]http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=3&threadid=961231[/url]
    JMGibson3 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139