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!

SQL-Parameters in BC4J?

107137Nov 30 2004 — edited Dec 1 2004
Hi

For performance and security reasons it is usually better to use SQL-Parameters (like :1) in SQL-Queries instead of building the SQL-String directly. I'd like to adopt this best practice but stumbled over a problem: BC4J adds Parameters when applying View-Links. Unfortunately I've no control over the Parameter added. See the following example:

Assume you have a View-Object with the following Query:

select NAME from USERS where NAME like :1

:1 is my custom parameter which I'd like to set using method 'setWhereClauseParams'. This view works fine until this view is used as a detail of a view link. In this case BC4J adds his own SQL-Parameter so that the query looks like that:

select NAME from USERS where NAME like :1 and (users.USR_ID = :1)

where the first :1 is my own Parameter and the second :1 is added by BC4J as part of the view link. This certainly does not work.
Can anyone give me a hint how to use SQL-Parameters correctly in BC4J-Views? Is there a "How To"-Document or something like that which explain how to use SQL-Parameters in BC4J?

Any hints are appreciated

Thanks
Frank Brandstetter
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2004
Added on Nov 30 2004
6 comments
235 views