cancel
Showing results for 
Search instead for 
Did you mean: 

SQL command not properly ended

Former Member
0 Kudos

Hi,

I am using the following structure for delete operation:

<root>

<StatementName2>

<TABLE_NAME Action="SQL_DML">

<access>delete from TABLE_NAME where birth_date<=sysdate and id=1234 and flag='Y'</access>

</TABLE_NAME>

</StatementName2>

</root>

When I use the above strcture, in audit log i can see the delete query as

delete from TABLE_NAME where birth_date<=sysdate and id=1234 and flag=Y

Channel throws no error but data is not deleted because Y is not getting enclosed in single quotes.

I tried the below structure to overcome quotes problem:

<root>

<StatementName2>

<TABLE_NAME Action="SQL_DML">

<access>delete from TABLE_NAME where birth_date<=sysdate and id=1234 and flag='$FLAG$'</access>

<key>

<FLAG>'Y'</FLAG>

</key>

</TABLE_NAME>

</StatementName2>

<root>

Now in audit log query comes properly like

delete from TABLE_NAME where birth_date<=sysdate and id=1234 and flag='Y'

But it throws 'SQL command not properly ended' error.

Edited by: Vishal.P.Kulkarni on Oct 1, 2009 12:44 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

prateek
Active Contributor
0 Kudos

Add the attribute "hasQuot" to FLAG and pass value YES as shown in my blog.

/people/prateek.srivastava3/blog/2009/04/02/unicode-handling-for-ms-sql-server

Regards,

Prateek

Former Member
0 Kudos

Auto-Commit needs to be enabled in commn channel.. the query with Y without quotes works....

Edited by: Vishal.P.Kulkarni on Oct 1, 2009 1:21 PM