Skip to Content
0

SAP BODS facing error

Dec 16, 2016 at 10:57 AM

85

avatar image

Hi All,

I have used a custom function for updating the Audit table after completion of workflow. I am facing issue with the Custom function.

Please find below details.

Custom Function:

$L_SQL = 'update KID_Audit set EndTime= \'[$L_END_TIME]\' , JobStatus= \'[$JOB_S]\' ,RecordCount= \'[$L_RECORD_COUNT]\' where StartTime= \'[$P_ST]\' and JobName= \'ECRR_xml\' ';

SQL('DS_ECRR',$L_SQL);

ERROR LOG:

data source <UKGSWDSQL110\DS110B> error message for operation <SQLExecute>: <[Microsoft][SQL Server Native Client 1199230984DBS-07040116/12/2016 10:41:0611.0][SQL Server]Incorrect syntax near 'wher'. 1199230984DBS-07040116/12/2016 10:41:06[Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.>. 1199230984DBS-07040116/12/2016 10:41:06|Session ECRR_xml|Function CF_AUDIT_UPDATE 1199230984DBS-07040116/12/2016 10:41:06ODBC data source <UKGSWDSQL110\DS110B> error message for operation <SQLExecute>: <[Microsoft][SQL Server Native Client 1199230984DBS-07040116/12/2016 10:41:0611.0][SQL Server]Incorrect syntax near 'wher'. 1199230984DBS-07040116/12/2016 10:41:06[Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.>. 1199230984RUN-05030416/12/2016 10:41:06|Session ECRR_xml|Function CF_AUDIT_UPDATE 1199230984RUN-05030416/12/2016 10:41:06Function call <sql ( DS_ECRR, update KID_Audit set EndTime= '2016.12.16 10:41:06' , JobStatus= 'SUCCESS' ,RecordCount= '12' 1199230984RUN-05030416/12/2016 10:41:06wher ) > failed, due to error <70401>: <ODBC data source <UKGSWDSQL110\DS110B> error message for operation <SQLExecute>: 1199230984RUN-05030416/12/2016 10:41:06<[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'wher'. 1199230984RUN-05030416/12/2016 10:41:06[Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.>.>. 1199230984RUN-05030416/12/2016 10:41:06|Session ECRR_xml 1199230984RUN-05030416/12/2016 10:41:06Function call <CF_AUDIT_UPDATE ( SUCCESS, 2016.12.16 10:41:03 ) > failed, due to error <70401>: <ODBC data source 1199230984RUN-05030416/12/2016 10:41:06<UKGSWDSQL110\DS110B> error message for operation <SQLExecute>: <[Microsoft][SQL Server Native Client 11.0][SQL 1199230984RUN-05030416/12/2016 10:41:06Server]Incorrect syntax near 'wher'. 1199230984RUN-05030416/12/2016 10:41:06[Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.>.>.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Dirk Venken
Dec 16, 2016 at 02:51 PM
1

What's the length of variable $L_SQL? Your string is truncated.

Also, use { instead of \'[, that looks much nicer:

$L_SQL = 'update KID_Audit set EndTime= {$L_END_TIME} , JobStatus= {$JOB_S} ,RecordCount= {$L_RECORD_COUNT} where StartTime= {$P_ST} and JobName= \'ECRR_xml\' ';

Share
10 |10000 characters needed characters left characters exceeded