0

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

Jay Rizzi
  • 4,196
  • 5
  • 42
  • 71
  • See here: [http://stackoverflow.com/questions/1422032/oracle-ora-01008-not-all-variables-bound-error-w-parameters] – Stephen Byrne Feb 15 '13 at 22:36
  • Makes perfect sense, now i gotta find out what to call in the database class interface to set ths, because yep, its a vendor custom job – Jay Rizzi Feb 16 '13 at 01:58

0 Answers0