WEB Coldfusion Crew... Question for you.

Discussion in 'OT Technology' started by brds, Aug 13, 2008.

  1. brds

    brds OT Supporter

    Joined:
    Jun 26, 2006
    Messages:
    17,643
    Likes Received:
    14
    Location:
    Atlanta
    I have an array of SQL commands that need to get run. To run them, i'm doing this:

    Code:
    <cfloop from="1" to="#arraylen(queries)#" index="i">
    
    <cfquery name="runquery" datasource="mydatasourcehere">
    <cfoutput>#queries[i]#</cfoutput>
    </cfquery>
    
    </cfloop>
    
    That should work, but for some reason, when the query is ran, all of the ' marks are changed to " marks. I did a dump on the array itself and, in the array, they are all ' marks.

    is there a way to either: 1) make sql run the command with " marks, or 2) make the output stop having " marks instead of ' marks?

    Thanks for the help! :wavey:
     
    Last edited: Aug 13, 2008
  2. fishbulb

    fishbulb Active Member

    Joined:
    Oct 29, 2001
    Messages:
    6,848
    Likes Received:
    4
    Location:
    md
    This is a long shot, but if you can control the creation of the array, are you using cfparam in them, which allows you to create SQL queries without the single quotation marks? Ie instead of WHERE name='someName'
    you use
    Code:
    WHERE name=<cfqueryparam value="someName"  CFSQLType="CF_SQL_VARCHAR" >
    
     
  3. jdw

    jdw New Member

    Joined:
    Dec 31, 2005
    Messages:
    4,429
    Likes Received:
    0
    Location:
    ND
    there's a coldfusion crew here? :eek:
     
  4. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,918
    Likes Received:
    10
    Location:
    Los Angeles
    .
     
  5. jdw

    jdw New Member

    Joined:
    Dec 31, 2005
    Messages:
    4,429
    Likes Received:
    0
    Location:
    ND
    on a side note, that's really weird... I can't figure out why it'd be changing the characters on you.

    Have you dumped the array by simply removing the cfquery tags to see if when looping through it it's changing the query string, or if it's when it's getting run?...

    second thing, you don't need to be wrapping the query string variable in cfoutput tags do you? Should be parsing out that variable becaues it's inside the cfquery tags. I doubt that's causing the problem though...
     
  6. jdw

    jdw New Member

    Joined:
    Dec 31, 2005
    Messages:
    4,429
    Likes Received:
    0
    Location:
    ND
    when I brought up coldfusion here when I first started my current job I got :ugh: from everyone...

    It's starting to grow on me.... like a fungus.
     
  7. gnat

    gnat New Member

    Joined:
    Jun 4, 2004
    Messages:
    28,371
    Likes Received:
    0
    in on the coldfusion crew... lol people hate it but for some reason I like it.
     
  8. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,918
    Likes Received:
    10
    Location:
    Los Angeles
    coldfusion, lol.
     
  9. jdw

    jdw New Member

    Joined:
    Dec 31, 2005
    Messages:
    4,429
    Likes Received:
    0
    Location:
    ND
    there are some things I really like...

    Others I don't..
     
  10. noon

    noon get high and teach me how to listen

    Joined:
    May 4, 2002
    Messages:
    3,384
    Likes Received:
    0
    Location:
    Lawrence, KS
    you dont need the cfoutput tags inside of the cfquery tags
     
  11. noon

    noon get high and teach me how to listen

    Joined:
    May 4, 2002
    Messages:
    3,384
    Likes Received:
    0
    Location:
    Lawrence, KS
    Code:
    <cfloop from="1" to="#arraylen(queries)#" index="i">
    
    <cfquery name="runquery" datasource="mydatasourcehere">
    #queries[i]#
    </cfquery>
    
    </cfloop>
     

Share This Page