PunyaAK
|
| Posted: 04/20/2005, 11:53 PM |
|
Hi,
I have GRID with data source SQL. I'm using 'Before Build Select ' to dynamically modify the WHERE clause.
But I get the following error whenever WHERE clause is appended with search criteria:
"ORA-00920: invalid relational operator
ORA-00933: SQL command not properly ended"
Here is the code in Java:
if (!((SqlParameter)e.getParameter("s_NAME")).getValue().equals("")) {
e.getCommand().setWhere(e.getCommand().getWhere() + " AND 1=1");
}
Am I missing anything?
Punya
|
|
|
 |
mrachow
Posts: 509
|
| Posted: 04/25/2005, 2:37 AM |
|
It's possible that where parameters resulting from search parameters and grid datasource parameters are added later to the where clause.
So I would recommend to check
e.getCommand().getWhere() .length
first and then decide to use AND or not.
Hope this helps.
_________________
Best regards,
Michael |
 |
 |
PunyaAK
|
| Posted: 04/25/2005, 9:23 AM |
|
OK. Here is the response from CCS technical support:
"When you use Table Data Source type, query is split and stored in separate properties: SQL, Where and Order. You can use setSQL, getSQL, setWhere, getWhere, etc. methods to set or get queries parts.
But with SQL Data Source Type, entire query is stored in SQL property. Where and Order are empty and just are not used. That’s why with custom SQL data source you need to work with SQL and use setSQL/getSQL methods."
So I used setSql() and and it's working 
Punya
|
|
|
 |
|