To execute the Sql statement in x++, create the job or class with following code
Connection connection;
Statement statement;
str sql;
ResultSet resultSet;
SqlStatementExecutePermission perm;
connection = new Connection();
sql = "SELECT * FROM CUSTTABLE";
perm = new SqlStatementExecutePermission(sql);
perm.assert();
statement = connection.createStatement();
resultSet = statement.executeQuery(sql);
while(resultSet.next())
{
info(resultSet.getString(1));
}
// End the scope of the assert call.
CodeAccessPermission::revertAssert();
And then create action menu item to execute the sql statement.
Thanks,
K. Arunsubramaniam
No comments:
Post a Comment