Skip to main content
Participant
March 20, 2009
Question

Dynamic table name from Arguments in <cfquery />

  • March 20, 2009
  • 2 replies
  • 333 views


I'm trying to use dynamic table names in a cfc but seem to have hit upon a wall as my calling methods from flash keep hitting my _error methods - Code attached to show what I'm trying to achieve; if anyone can give me some pointers it would be a great help. I've seen numerous by using the Form with the arguments but this is coming into a gateway used by a flash component and doesn't work no matter how much I fiddle the code.

Thanks in advance

    This topic has been closed for replies.

    2 replies

    Inspiring
    March 22, 2009
    In addition to BKBK's answer, the back quotes around the word object probably don't do you any good.

    You also have more code than you need. You don't need to to convert your arguments to local variables. Just use them in the query. Also, if you use cfqueryparam the quotes will take care of themselves.

    Also, declaring local variables with the var keyword has to take place immediately after the cfargument tags. You have a cfquery tag, with some rather strange sql before yours.

    Finally, and this might not matter, I would specify type = "string" for your two arguments.
    BKBK
    Community Expert
    Community Expert
    March 22, 2009
    You mistakenly apply single-quotes twice around var_eNo.