This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes Oracle PL/SQL Problem with Dynamic Bind Variables (Multiple) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Oracle PL/SQL Problem with Dynamic Bind Variables (Multiple)" Watch "Oracle PL/SQL Problem with Dynamic Bind Variables (Multiple)" New topic
Author

Oracle PL/SQL Problem with Dynamic Bind Variables (Multiple)

Jigar M Gohil
Greenhorn

Joined: Dec 14, 2011
Posts: 25



Issue:
When I use only first filter of FIRSTNAME with Bind variable it works fine but when I use more than one bind variable with LIKE operator it fails.



Any Help?

Thanks in Advance!!!
Jigar.
Jigar M Gohil
Greenhorn

Joined: Dec 14, 2011
Posts: 25
Got the root cause. The problem was with number of Bind variables I was applying with USING.
Instead of just single use of approver with USING I have to use it for each bind (here twice).



This raised another question: is there a way to re-use the repeated bind variables? (similar to what I was trying earlier)
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3719
    
  61

Congrats for nailing it down!

This is just a proof of concept, right? Otherwise you could use static SQL in this case.

Edit: I've originaly overlooked your question:
Jigar M Gohil wrote:This raised another question: is there a way to re-use the repeated bind variables? (similar to what I was trying earlier)

Not in your case. See the documentation.
 
Consider Paul's rocket mass heater.
 
subject: Oracle PL/SQL Problem with Dynamic Bind Variables (Multiple)
 
It's not a secret anymore!