5 Replies Latest reply on Jul 6, 2007 1:18 PM by Dan Bracuk

    Does anyone know why....

    Anthony Spears Level 1
      You can't put write query cells (<cfset temp = QuerySetCell) inside of <cfif> tags? Whenever I try it the code won't run. It just skips that portion completely.

      Thanks in advance,

      Anthony
        • 1. Re: Does anyone know why....
          Level 7
          Anthony Spears wrote:
          > You can't put write query cells (<cfset temp = QuerySetCell) inside of <cfif> tags? Whenever I try it the code won't run. It just skips that portion completely.
          >
          > Thanks in advance,
          >
          > Anthony

          Can you show some code? I can not say I have ever tried this exact
          concept. But I can't see why it would be a problem.
          • 2. Re: Does anyone know why....
            Level 7
            never had a problem with having querysetcell inside a cfif/cfelse block.

            make sure:
            a) your cfif condition validates to true so the code inside (the
            querysetcell code) is executed
            b) you are not forgetting the queryaddrow() part before querysetcell()


            ---
            Azadi Saryev
            Sabai-dee.com
            http://www.sabai-dee.com
            • 3. Re: Does anyone know why....
              Dan Bracuk Level 5
              quote:

              Originally posted by: Anthony Spears
              You can't put write query cells (<cfset temp = QuerySetCell) inside of <cfif> tags? Whenever I try it the code won't run. It just skips that portion completely.

              Thanks in advance,

              Anthony

              When stuff like that happens to me, it is pretty much always because the condition of the cfif tag is not met.
              • 4. Re: Does anyone know why....
                Anthony Spears Level 1
                The coditions of the cfif are being met. Other code within the tag is being executed. I actually populated an array inside in of same cfif tag.

                Yes, I did the queryaddrow. The code works just fine outside of the cfif tag.

                There is no fancy code. Just querysetcells inside of a cfif tag. The query is created outside of the cfif tag. This is not the first time I have encountered it. I wasn't looking for a solution. More of looking to see if anyone else has experienced this. Perhaps this is a bug/limitation in cold fusion.
                • 5. Re: Does anyone know why....
                  Dan Bracuk Level 5
                  quote:

                  Originally posted by: Anthony Spears
                  The coditions of the cfif are being met. Other code within the tag is being executed. I actually populated an array inside in of same cfif tag.

                  Yes, I did the queryaddrow. The code works just fine outside of the cfif tag.

                  There is no fancy code. Just querysetcells inside of a cfif tag. The query is created outside of the cfif tag. This is not the first time I have encountered it. I wasn't looking for a solution. More of looking to see if anyone else has experienced this. Perhaps this is a bug/limitation in cold fusion.

                  When I run this code (sisi is an oracle db),
                  <cfquery name="x" datasource="sisi">
                  select 'a' as aaa from dual
                  </cfquery>
                  <cfdump var="#x#">
                  <cfif true>
                  <cfset temp = QuerySetCell(x, "aaa", "b")>
                  </cfif>
                  <cfdump var="#x#">

                  I see a on the first dump and b on the second. What happens when you try it, or something similar if you don't use oracle?