private SqlStatement ShowSchemaTables(string schema)
{
var sql = " SELECT \"Tables.TABLE_NAME\" AS \"table_name\", " +
" I_PRIVILEGE_STRING(\"agg_priv_bit\") AS \"user_privs\", " +
" \"Tables.TABLE_TYPE\" as \"table_type\" " +
" FROM " + InformationSchema.Tables + ", " +
" ( SELECT AGGOR(\"priv_bit\") agg_priv_bit, " +
" \"object\", \"name\" " +
" FROM " + InformationSchema.ThisUserSimpleGrantViewName +
" WHERE \"object\" = " + ((int)DbObjectType.Table) +
" GROUP BY \"name\" )" +
" WHERE \"Tables.TABLE_SCHEMA\" = ? " +
" AND CONCAT(\"Tables.TABLE_SCHEMA\", '.', \"Tables.TABLE_NAME\") = \"name\" " +
"ORDER BY Tables.TABLE_NAME";
var param = new QueryParameter(PrimitiveTypes.String(), new SqlString(schema));
return Show(sql, param);
}