Announcements
I am getting the below error while trying to open payroll integration.
The issue started this week.
Here is my code (IBSpayrollconnector_periodsload)
static public void Main(Args _args,str _sql)
{
IBSpayrollconnector_periodsload payroll = new IBSpayrollconnector_periodsload();
LoginProperty loginProperty;
OdbcConnection odbcConnection;
Statement statement;
ResultSet resultSet;
str sqlstatement, criteria, pmonth="" , pyear="";
SqlStatementExecutePermission perm;
IBSpayrollperiod _pwrkflw;
;
// Set the information on the ODBC.
loginProperty = new LoginProperty();
loginProperty.setDSN("Pay");
loginProperty.setDatabase("dbname");
//info("periods");
//Create a connection to external database.
odbcConnection = new OdbcConnection(loginProperty);
sqlstatement = _sql;
if (odbcConnection)
{
//Assert permission for executing the sql string.
perm = new SqlStatementExecutePermission(sqlstatement);
perm.assert();
//Prepare the sql statement.
statement = odbcConnection.createStatement();
resultSet = statement.executeQuery(sqlstatement);
ttsBegin;
delete_from _pwrkflw where _pwrkflw.IBSpayrollWorkflowState == 0;
ttsCommit;
//Cause the sql statement to run,
//then loop through each row in the result.
while (resultSet.next())
{
//It is not possible to get field 3 and then 1.
//Always get fields in numerical order, such as 1 then 2 the 3 etc.
ttsBegin;
_pwrkflw.Pyear =resultSet.getString(1) ;
_pwrkflw.Pmonth = resultSet.getString(2);
_pwrkflw.insert();
ttsCommit;
// info ("completed succesfully");
}
//Close the connection.
resultSet.close();
statement.close();
}
else
{
error("Failed to log on to the database through ODBC.");
}
@ Ludwig I am using AX 2012 R3
Hi Waw,
Do you have an SQL statements in the integration and have used "INSERT" command instead of a "SELECT" command anywhere in the integration code? Please check this thread where a similar error is discussed.
Hello Waw,
Are you operating an older AX2012 version?
If so, have you already checked LCS for available hotfixes?
Best regards,
Ludwig
André Arnaud de Cal...
294,118
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator