Fetch Data from direct SQL Queries
Connection connection;
Statement statement;
str sql;
ResultSet resultSet;
SqlStatementExecutePermission perm;
//sql = "SELECT COUNT(*) as [NumOfCombinations] FROM " + "( " + "select MyName, MyValue " + "from tab1 " + strFmt("where DATAAREAID = '%1' ",curext()) + "group by MyName, MyValue" + ") a";
sql = strFmt("select * from taxtrans where TRANSDATE between CONVERT(date, '%1') and CONVERT(date, '%2')", datetime2Str(DateTimeUtil::newDateTime(fromDateValue,0)), datetime2Str(DateTimeUtil::newDateTime(toDateValue,0)));
connection = new connection();
perm = new SqlStatementExecutePermission(sql);
perm.assert();
statement = connection.createStatement();
resultSet = statement.executeQuery(sql);
while (resultSet.next())
No comments:
Post a Comment