Can you spot the syntax error?

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Can you spot the syntax error?

    <cfquery datasource="#VARIABLES.Datasource#">
    INSERT INTO Blogs (
    Subject, DateTime, Body, UserName)
    VALUES (
    '#Form.Subject#', <CFQUERYPARAM CFSQLTYPE="CF_SQL_TIMESTAMP"
    VALUE="#DateFormat(Now())# #TimeFormat(Now())#">,
    '#Form.Body#',
    '#VARIABLES.UserID#')</cfquery>

    Why is this throwing a syntax error?


    Roderick Rutlidge Guest

  2. Similar Questions and Discussions

    1. Syntax error
      I posted a question or two on this recently, and posts have been helpful. However, I have a new problem, and don't know what to do. To recap....
    2. Help on Syntax error please
      I'm new to MySQL. Sorry for asking for some probably very basic help. :( The following code is from a Dump of a php forums database (openBB...
    3. Syntax error?
      Hi, I'm developing an ASP.NET web application with MySql 5. I have a little problem: if i create a stored procedure like this one: CREATE...
    4. error : syntax error at or near $1 for over select rows
      This is the error i am getting when calling select * from cas_reset_qi_changedate('CAS','2003-02-03' ERROR: syntax error at or near "$1" at...
    5. syntax error ???
      Hi, on login.php , we can see that : (...) $sql = "SELECT Login FROM logins WHERE Login='$fusername'"; $result = mysql_query($sql) or...
  3. #2

    Default Re: Can you spot the syntax error?

    What exactly is the error? When debugging is on, is there any more
    details.

    One item that jumps out is the DateTime field. Try using
    #CreateODBCdatetime(Now())# instead.

    allen@oysterweb.com Guest

  4. #3

    Default Re: Can you spot the syntax error?


    <allen@oysterweb.com> wrote in message
    news:1128011017.446435.114670@g49g2000cwa.googlegr oups.com...
    > What exactly is the error? When debugging is on, is there any more
    > details.
    >
    > One item that jumps out is the DateTime field. Try using
    > #CreateODBCdatetime(Now())# instead.
    >

    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
    Access Driver] Syntax error in INSERT INTO statement. The error occurred
    in C:\CFusionMX\wwwroot\site\blog\submitentry.cfm: line 14

    12 : INSERT INTO Blogs (Subject,DateTime,Body,UserName)
    13 : VALUES
    14 : ('#Form.Subject#',<CFQUERYPARAM CFSQLTYPE="CF_SQL_TIMESTAMP"
    VALUE="#DateFormat(Now())#
    #TimeFormat(Now())#">,'#Form.Body#','#VARIABLES.Us erID#')
    15 : </cfquery>
    16 : our blog has been successfully submitted. To view or edit any of your
    entries, <a href="editentries.cfm">click here</a>.

    --------------------------------------------------------------------------------
    SQL INSERT INTO Blogs (Subject,DateTime,Body,UserName) VALUES
    ('test', (param 1) ,'test','test')
    DATASOURCE blog
    VENDORERRORCODE -3502
    SQLSTATE 42000


    Roderick Rutlidge Guest

  5. #4

    Default Re: Can you spot the syntax error?


    <allen@oysterweb.com> wrote in message
    news:1128011017.446435.114670@g49g2000cwa.googlegr oups.com...
    > What exactly is the error? When debugging is on, is there any more
    > details.
    >
    > One item that jumps out is the DateTime field. Try using
    > #CreateODBCdatetime(Now())# instead.
    >
    Nevermind, problem solved. DateTime is a reserved word. Special thanks to
    Bob Dively from alt.comp.lang.coldfusion


    Roderick Rutlidge 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