3 Replies Latest reply on Feb 17, 2017 8:57 AM by WolfShade

    SQL command not properly ended - grrr argh..

    WolfShade Level 4

      Hello, all,

       

      I've got a query that isn't running within my CFM document; however, if I copy/paste the SQL from the error message into SQL Developer, it does just fine.

       

      Windows Server 2012 with Oracle 12 and Windows Server 2012 with CF10 Server.

       

      I'm creating a query object from scratch (QueryNew()) and trying to insert that data into a table.

       

      My code is:

      <cfquery name="insertData" datasource="#application.dsn#">
          INSERT ALL
          <cfloop query="myQuery">  into tableA(ID, ORG_ID, NAME, CITY, STATE, ZIP) VALUES ('#varA', '#varB', '#varC', '#varD', '#varE', '#varF')
          </cfloop>  SELECT * FROM DUAL;
      </cfquery>
      

       

      The error message is very vague, and yet if I copy/paste the SQL from the error message into SQL Developer, all the data is inserted.

       

      Confuzzedly,

       

      ^_^

        • 1. Re: SQL command not properly ended - grrr argh..
          haxtbh Level 4

          What is the error message?

           

          Also you are missing  the end # on the vars in the query.

          • 2. Re: SQL command not properly ended - grrr argh..
            WolfShade Level 4

            Hi, haxtbh,

             

            The error message is the title of my post "SQL command not properly ended".  I am not missing any of the hashtags around variable names.

             

            V/r,

             

            ^_^

            • 3. Re: SQL command not properly ended - grrr argh..
              WolfShade Level 4

              *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk*

               

              sigh

               

              *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk* *headdesk*

               

              I removed the semi-colon from after the "SELECT * FROM DUAL" subquery and it works.  WTF!!!

               

              V/r,

               

              ^_^