I have a C# ashx handler I am running into issues with, i have two queries that build on top of each other, the first query takes a parameter, while the second query takes the original query, wraps around it and takes two parameters to return row numbers
The error is ORA-01008: not all variables bound
first query (portion)
sSql += @"AND a.assignment_type in ('PS','SS')
AND ((:byAuthor = 'N' AND a.assignment_type in ('PS','SS'))
second query
string filteredSql = @"select * from (";
filteredSql += sSql;
filteredSql +=@" ) WHERE rowsNumerator BETWEEN :iDisplayStart AND :iDisplayEnd";
query execution
DataSet totalResults = dbi.GetDynamicDataSet(sSql, tcParameters);
int iTotalCount = totalResults.Tables[0].Rows.Count;
DataSet filteredResults = dbi.GetDynamicDataSet(filteredSql, dtParameters);
request declaration
var byAuthor = context.Request.QueryString["byAuthor"].ToString();
var iDisplayLength = int.Parse(context.Request["iDisplayLength"]);
var iDisplayStart = int.Parse(context.Request["iDisplayStart"]);
binding
ListDictionary tcParameters = new ListDictionary();
tcParameters.Add("byAuthor", byAuthor);
ListDictionary dtParameters = new ListDictionary();
dtParameters.Add("iDisplayStart", iDisplayStart);
dtParameters.Add("iDisplayEnd", iDisplayEnd);
i have tried using the same list dictionary in both but this returns ora-illegal var name
ListDictionary dtParameters = new ListDictionary();
dtParameters.Add("byAuthor", byAuthor);
dtParameters.Add("iDisplayStart", iDisplayStart);
dtParameters.Add("iDisplayEnd", iDisplayEnd);
In the end, i wanted to have the variables bound in my sql, rather than string concatenated, i can provide the entire ashx file if necessary, thanks for giving me any knowledge