problem with struct containing query

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default problem with struct containing query

    Hello all- I've been having a re-occurring issue involving queries stored
    within structures. I have a struct in which one of it's key's is a query. When
    I try to loop the query using cfoutput an error occurs. Is this some sort of
    bug, or am I just going crazy ? TIA, Aaron

    <!--- this returns YES --->
    #isQuery(application.department[dept].employees)#

    <!--- this returns "Attribute validation error for tag cfoutput" --->
    <cfoutput query="application.department[dept].employees)>

    <!--- this returns "Comples object types cannot be converted to simple values"
    --->
    <cfoutput query="#application.department[dept].employees#)>

    amiller Guest

  2. Similar Questions and Discussions

    1. Query Struct output
      Hi Experts, I want to Query Out data in list. MyList = john,mary,roger When I make a query Select * from login table where (userid in...
    2. Issues with declaring struct arrays inside of a struct
      I have the following C++ code: define MAXXPAXX 64 // Pack sub component of database struct. typedef PREFIX_PACKED struct { DWORD packid;...
    3. Calling fun taking struct and not pointer to struct?
      Robert Feldt wrote: I'm a little confused by the question... are you asking if: 1) The act of using a struct in the declaration of another...
    4. Fwd: Calling fun taking struct and not pointer to struct?
      Related to the recent thread about nested structs and Ruby/DL here is the answer from Ruby/DL's author: So that's what I ask you: Is inlining...
    5. Problem with class, struct, and to_s
      On Saturday, July 26, 2003, 2:54:28 AM, ts wrote: G>> irb(main):009:1> def to_s G>> irb(main):010:2> -15 G>> irb(main):011:2> end ...
  3. #2

    Default Re: problem with struct containing query

    Must be the 2nd option (or you're just tired). :-) You seem to have a syntax
    error. IS: <cfoutput query='application.department[dept].employees)> Should
    Be: <cfoutput query='application.department[dept].employees'> Regards, --
    MikeR

    MikerRoo Guest

  4. #3

    Default Re: problem with struct containing query

    Mike- Thanks for pointing that out. Unfortunately the typo is just in my
    attached code. I had a bunch of other code in between that I didn't want to
    post, so I just typed it. I've cut and pasted in another example, that is from
    actual code that results in the errors I mentioned before. I'm still hoping
    that I'm missing something here, I've just been looking at this code for so
    long I can't figure it out... Thanks again, Aaron

    <!--- returns YES --->
    <cfoutput>isQuery ?
    #isQuery(application.department[dept].employees)#</cfoutput>


    <table cellpadding="0" cellspacing="0" border="0" width="175">
    <!--- causes error --->
    <cfoutput query="application.department[dept].employees">

    amiller Guest

  5. #4

    Default Re: problem with struct containing query

    I new that was too easy! Anyway, it seems that CFOutput does not parse
    arrays correctly. I couldn't get your code to work without the dreaded
    Evaluate(). So use an intermediate variable. This can actually help debug
    and has the advantage of allowing you out of the application variable CFLOCK,
    that you are using (right?), quicker. Something like this: <CFSET
    qryLclEmployees = application.department[dept].employees> <!--- Array
    dereference in CFOutput does not work! ---> <cfoutput query='qryLclEmployees'>
    Regards, -- MikeR

    MikerRoo Guest

  6. #5

    Default Re: problem with struct containing query

    MikeR- Thanks again for the reply. Your idea worked just fine, however, I
    must assume that this is a bug since simply copying the var into another var
    works. Kinda defeats the purpose of having the information stored in the
    application scope if I need to copy it into a local variable each time I want
    to use it....Oh well, at least I now know I'm not completely nuts ! Thanks
    again, Aaron

    amiller 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