SQL command not properly ended - grrr argh..

LEGEND ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

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,

^_^

Views

515

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

LEGEND , Feb 17, 2017 Feb 17, 2017
*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* *head...

Likes

Translate

Translate
Advocate ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

What is the error message?

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

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,

^_^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

*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,

^_^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 01, 2018 Dec 01, 2018

Copy link to clipboard

Copied

LATEST

OMG! Thanks so much for this post...it saved me.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines