<cfquery> syntax problem

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default <cfquery> syntax problem

    Guys can someone tell me whats wrong with the line I have put in bold? Im
    trying to run this query but I get an error telling me the syntax is wrong near
    the second insert. Here is my code: <cfquery name='insJobRecord'
    datasource='project'> insert into temp (ref, Description, Title, Salary,
    Location, Contract, CloseDate, IntDate, CurrentDate) values
    (<cfqueryparam value='#Links2#' cfsqltype='CF_SQL_VARCHAR'>,
    <cfqueryparam value='#thisJD2#' cfsqltype='CF_SQL_LONGTEXT'>, <cfqueryparam
    value='#thisTitle2#' cfsqltype='CF_SQL_VARCHAR'>, <cfqueryparam
    value='#thisSalary2#' cfsqltype='CF_SQL_VARCHAR'>, <cfqueryparam
    value='#thisLocation2#' cfsqltype='CF_SQL_VARCHAR'>, <cfqueryparam
    value='#thisContract2#' cfsqltype='CF_SQL_VARCHAR'>, <cfqueryparam
    value='#thisClosDate2#' cfsqltype='CF_SQL_DATE'>, <cfqueryparam
    value='#thisIntDate2#' cfsqltype='CF_SQL_VARCHAR'>, <cfqueryparam
    value='#now()#'>) insert into job (ref, Description, Title,
    Salary, Location, Contract, CloseDate, IntDate, CurrentDate) SELECT
    ref,Description,Title,Salary,Location,Contract,Clo seDate,IntDate,CurrentDate
    FROM MyTempTable WHERE NOT EXISTS ( SELECT Description
    FROM Job WHERE
    Replace(Replace(Replace(Replace(SUBSTRING(Job.Desc ription, 1, 5000),'
    ',''), Chr(9), ''), Chr(10), ''), Chr(13), '') =
    Replace(Replace(Replace(Replace(SUBSTRING(Temp.Des cription, 1, 5000),'
    ',''), Chr(9), ''), Chr(10), ''), Chr(13), '') ) DROP TABLE
    MyTempTable </cfquery>TextText

    samb1 Guest

  2. Similar Questions and Discussions

    1. Cfquery Update Syntax Suddenly bad???
      The following code has been working for 2yrs or so; And suddenly I get the following error; Error Executing Database Query. Syntax error in...
    2. CFQUERY problem
      I am passing three values from a form to a search application, miles, zip, and day. I want to test for database entries in which the day's field is...
    3. unusual cfquery problem
      This is an unusual problem. I am attempting to populate a grid from a query ("rec_count2") which has a "where" variable based the tab selected...
    4. double single quote problem in cfquery
      Hi, i've this problem with ColdFusion MX 6.1 Updater and MX 7 If i try to insert a text containing a single quote (for example TEST') all works...
    5. Javascript and CFquery problem
      Hi guys, im hoping you can help. Im currently working on a page that contains a single drop down list that is dynamically populated from the...
  3. #2

    Default Re: <cfquery> syntax problem

    You have to break these out into separate cfquery calls. It looks like you're
    doing 2 inserts and a table drop in one <cfquery> tag. Also, you don't put
    semicolons at the end of your query contained in a <cfquery>

    Kronin555 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