Not Able To call stored procedure from AX Job...Please assist..

Hi All,

I have stored procedure and if I execute it from DB side i am getting the data. and now the requirement is, if I call the stored procedure from the Table method ,the data which is retrieved by stored procedure should insert in the table.

To achieve this I have created one AOT table (Scob_AllPaymentsDump ) and in the table method I have written below code to call stored procedure and at the same time insert the data in table.

Connection Connection;
Statement Statement;
ResultSet ResultSet;
SqlStatementExecutePermission perm;
str sqlStatement = strFmt(‘exec ScobAllPayments ‘%1’,’%2’’,fromdate,todate);
RecordInsertList RecordInsertListScob_AllPaymentsDump;
Scob_AllPaymentsDump scob_AllPaymentsDump;
//String255 excrate;

RecordInsertListScob_AllPaymentsDump = new RecordInsertList(tableNum(Scob_AllPaymentsDump));
Connection= new Connection();
Statement= Connection.createStatement();
perm = new SqlStatementExecutePermission(sqlStatement);
perm.assert();
ResultSet= Statement.executeQuery(sqlStatement);
while ( ResultSet.next() )
{
info(strFmt("%1", ResultSet.getString(1)));
scob_AllPaymentsDump.CompanyCode = ResultSet.getString(1);
scob_AllPaymentsDump.SCOBVendName = ResultSet.getString(2);
scob_AllPaymentsDump.CurrencyCode = ResultSet.getString(3);
scob_AllPaymentsDump.AmountCurDebit = str2num(ResultSet.getString(4));
scob_AllPaymentsDump.JournalNum = ResultSet.getString(5);
scob_AllPaymentsDump.JournalName = ResultSet.getString(6);

RecordInsertListScob_AllPaymentsDump.add(scob_AllPaymentsDump);
}
RecordInsertListScob_AllPaymentsDump.insertDatabase();
}

.

But when I execute it from the job by passing the fromdate and todate it giving the below error.

Procedure.png

Kindly assist on this.

Thanks in advance

Haribabu