Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to set parameter value for a View Object Based on SQL Server Database

Tarek FathyDec 12 2017 — edited Dec 12 2017

Hi

My JDeveloper version is 12.2.1.1.0

My Application Module connects to SQL server Database

I Have a view Object named "AgendaView". It contains a view criteria named "FilterByAgIdVC" as follow

pastedImage_0.png

As seen , the view criteria has a parameter ":p_ag_id". so far so good.

Now, in my managed bean , I am trying to apply this view criteria programmatically. this is my code

| | public void filterMeetingAgenda() { |
| | DCIteratorBinding openAgnItr = ADFUtils.findIterator("OcsAgendaOpenRoIterator"); |
| | ViewObjectImpl vo = null; |
| | Row row = openAgnItr.getCurrentRow(); |
| | if (row != null) { |
| | Long id = (Long) row.getAttribute("AgId"); |
| | if (id != null) { |
| | DCIteratorBinding agendaItr = ADFUtils.findIterator("OcsAgendaOpenRoIterator"); |
| | vo = (ViewObjectImpl) agendaItr.getViewObject(); |
| | ViewCriteria vc = vo.getViewCriteria("FilterByAgIdVC"); |
| | vo.applyViewCriteria(vc); |
| | vo.setNamedWhereClauseParam("p_ag_id", id); | |
| | vo.executeQuery(); |
| | } | |
| | } |
| | } |

At run time I got error for this line

vo.setNamedWhereClauseParam("p_ag_id", id);

the error is

oracle.jbo.NoDefException: JBO-29114 ADFContext is not setup to process messages for this exception. Use the exception stack trace and error code to investigate the root cause of this exception. Root cause error code is JBO-25058. Error message parameters are {0=Variable, 1=p_ag_id, 2=OcsAgendaOpenRo}

it seems that the SQL server does not understand the Where condition (" where Aga_ID = :p_ag_id").

how can I pass this parameter??

please help

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 9 2018
Added on Dec 12 2017
4 comments
486 views