Reusing a Result Set

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

  1. #1

    Default Reusing a Result Set

    Hi,

    Lets say I have the following:
    <cfquery datasource="#data#" name="getData">
    Select * from emp
    </query>

    Within the page I can use this relsult set. I want to eliminate haveing to
    rerun the same query.
    Is there a way I can store thie result set and access in another form ?
    ex:
    <cfset session.query.ids = getData>
    Then use cfoutput etc to retrieve this data?

    Thanks

    Andy


    _andyK Guest

  2. Similar Questions and Discussions

    1. reusing RemoteObject methods
      Hi, I'm using a RemoteObject (userService.CFC) to return data to combo-boxes. I would like to populate several arrays using the same method with...
    2. Reusing Columns in the same row
      Hello, I need to do something like mentioned below: I have a table of 5 rows and 10 columns. I need to print the results (coming from db) in...
    3. Reusing Parameters across web methods
      I have a WSDL interface written by our customer. I want to create our own web service instance that we can test our software against. So I used...
    4. Reusing a _blank window
      Hi there, I have been stumped on trying to reuse a _blank window once it is up. I have a portfolio that has alot of swf.s and I want to reuse the...
    5. Reusing a user control within the same application
      I have created a user control that has a dropdown, and Add button, a text box and a datalist. A person can drop this into another user control or...
  3. #2

    Default Re: Reusing a Result Set

    If you mean access the results on another page, one option might be to store the query results in a session variable. However, this may not be the best option if the resultset is large.
    mxstu Guest

  4. #3

    Default Re: Reusing a Result Set

    Hi,

    think that I found the solution. Cahe the query then use query of queries to
    resort the results as needed.

    <cfquery cachedwithin="#createtimespan(0 0 15 0)#" name="mainRS">
    exec ....

    </cfquery>

    then

    <cfquery dbtype="query" name="differntsort">
    select * from mainRS where ....

    </cfquery>

    This should work.

    The thing I have to find out is how much memory to allocate.

    Thanks

    Andy



    _andyK Guest

  5. #4

    Default Re: Reusing a Result Set

    createtimespan(0, 0, 15, 0)
    BKBK Guest

  6. #5

    Default Re: Reusing a Result Set

    Thanks for all of the help


    Andy
    _andyK 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