This discussion is archived
0 Replies Latest reply: Dec 17, 2012 9:54 AM by da RSS

Dataset Tableadapter Parameter Usage - Not All Variables Bound

da Newbie
Currently Being Moderated
In VS 2010 with Oracle 11G, this simplified SQL pseudo example works fine now with two parameters and is indicated by the tableadapter GUI with getdata (PARAM1, PARAM2).

Select fname, lname from as_person where person_type = 'A' and person_id = ? union select fname, lname from as_person where person_type = 'B' and person_id = ?

The table adapter configuration wizard shows the SQL as above and works when doing a preview providing two parameters. The query builder window shows the SQL as below and works when doing an execute query providing two parameters.

Select fname, lname from as_person where person_type = 'A' and person_id = :PARAM1 union select fname, lname from as_person where person_type = 'B' and person_id = :PARAM2

This difference in SQL representation coming from the same object plus the parameter marker characters usage is a bit confusing. I am trying to design SQL that can use the same parameter in multiple spots like

Select fname, lname from as_person where person_type = 'A' and person_id = :PARMSAME union select fname, lname from as_person where person_type = 'B' and person_id = :PARMSAME

Any help or enlightenment appreciated.

Note that the following link represents some of my travel http://www.fullstackbusinessdesign.com/forums/ORA-01008.html

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points