cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect Syntax error in Adapter engine

Former Member
0 Kudos

Hi,

I am experiencing with an error " com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ','  "

I have checked and tested mapping with payload data , its executed successfully. Payload data structure is also fine.

Even I have unchecked "Key tags mandatory " option in JDBC communication channel but same error i am getting.

Could you plaese help me in this.

Thank you

Sathish.D

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Issue is resolved. The problem is with data only. I have sent correct data,then its working fine.

Thanks to all replies.

Sathish

Answers (1)

Answers (1)

iaki_vila
Active Contributor
0 Kudos

Hi Sathish,

Could you share the target XML with the jdbc xml structure or the native SQL sentence?, probabbly some mistake can be there and it will easier to research the problem.

Regards.

Former Member
0 Kudos

Hi vila,

Below is my payload data. ( Its Proxy to JDBC scenarion, Updating two tables to target sstem )

<?xml version="1.0" encoding="UTF-8" ?>

<ns0:MT_Receiver xmlns:ns0="http://XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX">

<Statement1>

<SAP_Header action="INSERT">

<access>

<Invoice_Number>0220000009</Invoice_Number>

<Invoice_Date>2012/08/02</Invoice_Date>

<Insert_Date>2012/08/02</Insert_Date>

</access>

</SAP_Header>

</Statement1>

<Statement2>

<SAP_Detail action="INSERT">

<access>

<Billable_Amount>0.00</Billable_Amount>

<Insert_Date>2012/08/02</Insert_Date>

</access>

</SAP_Detail>

</Statement2>

</ns0:MT_Receiver>

former_member184681
Active Contributor
0 Kudos

Hi Santish,

In the Advanced tab page of your receiver JDBC channel, mark "Advanced Mode" checkbox and type a new parameter in the parameters table:

logSQLstatement = true

Thanks to this, the actual SQL statement executed in the database will be persisted in the audit log in RWB. Thanks to this, when you retest, you will be able to check the SQL statement and locate the error easily. See more details in SAP Note 801367 - XI 3.0 JDBC Adapter: Additional Parameters.

Regards,

Greg

Former Member
0 Kudos

Hi Greg,

Already i have set the parameter logSQLstatement is true.

and in the below tag SAP_Header is the table name.

<SAP_Header action="INSERT">    ( Just FYI please )

Thank you

Sathish.D

former_member184681
Active Contributor
0 Kudos

OK, so since logging SQL statements is switched on, check the Communication Channel Monitor in RWB to see the actual SQL statement and locate the redundant comma (",") that the error says about. You can paste the statement here if you need help with that. No problem if you replace the real production data with some dummy values, just make sure not to destroy the syntax of the whole statement.

Regards,

Greg

Former Member
0 Kudos

Hi  Greg,

here is my SQL statement from RWB.

Success : INSERT INTO SAP_Header (Invoice_Number, Invoice_Date, Insert_Date) VALUES ( 0220000009, 2012/07/02, 2012/08/02)

Error : Unable to execute statement for table or stored procedure. 'SAP_Header' (Structure 'Statement1') due to com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near ','.

Thank you

Sathish.D

former_member184681
Active Contributor
0 Kudos

There is some incosistency in the table names:

SAP_Header in the SQL statement, and

SAP_Invoice_Header in the error description.

Make sure to keep that aligned.

Regards,

Greg

gagandeep_batra
Active Contributor
0 Kudos

Hi sathish,

You can try sam statement on direct on database server and check what could be a problem.

and also check for date content they should be in double quote (") but not sure*.

Regards.

GAgan

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>Success : INSERT INTO SAP_Header (Invoice_Number, Invoice_Date, Insert_Date) VALUES ( 0220000009, 2012/07/02, 2012/08/02)

This error normally occurs if there is discrepancy between number of column names and their respective values.  I see your statement looks good.  If you declare varchar type to any of the field then the query should use single quote for the respective value. Please check that.