Dynamic Structure Question?

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Dynamic Structure Question?

    Hi,

    I wanted to know if possible. Can I have a dynamic structure name?

    some generic query

    <cfquery name="qryTest" datasource="#request.dsn#">
    SELECT uniqueID, Name, Total
    FROM tablename
    WHERE status = 1
    </cfquery>

    <cfloop query="qryTest">
    <cfset #uniqueID# = StructNew()>
    </cfloop>

    So this would hopefully create "x" number of empty structures with their own
    UniqueID's...

    The plan is to put more keys in each of the newly created structures. Each of
    those keys will then have their corresponding values (ideally)

    Or do I have to use SetVariable() or something?

    Any help appreciated

    -WestSide



    <cfquery name="qryTest" datasource="#request.dsn#">
    SELECT uniqueID, Name, Total
    FROM tablename
    WHERE status = 1
    </cfquery>

    <cfloop query="qryTest">
    <cfset #uniqueID# = StructNew()>
    </cfloop>

    WestSide Guest

  2. Similar Questions and Discussions

    1. FMS app structure question
      Hi I'm still feeling my way with media server and need a little help. I'm making a chat app with multiple rooms. I need to have a directory...
    2. Site Structure Question
      I'm in the process of implemeting Contribute 3.1/CPS 1.1 under IIS6. Our organizational structure requires that user wear many hats, so in the site...
    3. Creating Dynamic Structure
      Hi, I want to create a dynamic structure of structures. I wrote the following code but I am getting errors with that. I have three entities...
    4. nested structure question....
      Hi, I posted a previous question somewhat similar to the one below, however, I am trying to determine if I can even use structures in this...
    5. DB structure question
      Access 2000. I'm trying to create a DB that stores records of books, but my understanding of DBases is very simple at best so, I have a table...
  3. #2

    Default Re: Dynamic Structure Question?

    <cfquery name="qryTest" datasource="#request.dsn#">
    SELECT uniqueID, Name, Total
    FROM tablename
    WHERE status = 1
    </cfquery>

    <cfset mystruct = structnew()>

    <cfloop query="qryTest">
    <cfset mystruct[uniqueID] = StructNew()>
    </cfloop>


    toniu27 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