What can we do when prgCtx.fDbConnect.GetRightsList()
returns a large number of values and we need to use the result in a query (using an "in" clause)? I seem to be hitting a limit in MSSQL when the number of items is around 13'000 or greater:
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '@P1'.
I haven't tested this on Oracle.
Is there a way to query direct and indirect group memberships without having to fetch all the ids?
Here is a script that simulates the problem with a query of a similar format:
function Void LargeQueryTest() Integer numberOfItemsInClause = 13000 Object prgCtx = $WebProspector.Utils.GetPrgCtx() String columnName = 'DataID' List l Integer i for i = 1 to numberOfItemsInClause l = {@l, i} end String clause = $LLIApi.FormatPkg.GetIDsClauseFromList(l, columnName) String stmt = Str.Format("select * from DTree where %1 and ParentID=:A0", clause) RecArray recs = CAPI.Exec(prgCtx.fDbConnect.fConnection, stmt, {2000}) if IsError(recs) Assoc check = prgCtx.fDBConnect.CheckError(recs, false) echo(check) endend