SQL-Parameters in BC4J?
107137Nov 30 2004 — edited Dec 1 2004Hi
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