Re: Dynamically built select statements (SQL)

2003-03-03 Thread David Goodenough
On Monday 03 March 2003 15:50, you wrote:
> On Mon, 3 Mar 2003, David Goodenough wrote:
> > Now for the next one.  I am trying to use the SQL resultset method
> > isLimitedByMaxRows.  I tried  > test="${result.isLimitedByMaxRows}"> but that got reject with unable
> > to get value of ... with operator ".", so I tried
> > result.limitedByMaxRows and that got the same.  Presumably it is
> > looking for a get method, how do I access an is method?
>
> ${result.limitedByMaxRows} is correct; are you sure it produced an error?

You are right, I really must learn to spell!

Thanks

David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dynamically built select statements (SQL)

2003-03-03 Thread Shawn Bayern
On Mon, 3 Mar 2003, David Goodenough wrote:

> Now for the next one.  I am trying to use the SQL resultset method
> isLimitedByMaxRows.  I tried  test="${result.isLimitedByMaxRows}"> but that got reject with unable
> to get value of ... with operator ".", so I tried
> result.limitedByMaxRows and that got the same.  Presumably it is
> looking for a get method, how do I access an is method?

${result.limitedByMaxRows} is correct; are you sure it produced an error?

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dynamically built select statements (SQL)

2003-03-03 Thread David Goodenough
On Monday 03 March 2003 12:53, you wrote:
> On Mon, 3 Mar 2003, David Goodenough wrote:
> > 
> > SELECT dno, action, destination, quantity, updated FROM load
> > WHERE 
> > 
> >
> > When I try to run this I get an SQL exception
> > (javax.servlet.ServletException) :-
> >
> >  SELECT dno, action, due, destination, quantity, updated FROM load
> > WHERE area = 'NW'
> > ORDER BY due DESC FOR READ ONLY
> >
> > : ERROR:  parser: parse error at or near "NW"
>
> The  tag by default escapes quotation marks, as they are XML
> metacharacters.  Use the escapeXml="false" attribute to get around your
> problem.  (The problem would show up more clearly if you looked at the raw
> HTML source of the page that's giving you this error message.)

Thank you, I knew it had to be something simple that I was doing wrong.
That fixed the problem.

Now for the next one.  I am trying to use the SQL resultset method
isLimitedByMaxRows.  I tried 
but that got reject with unable to get value of ... with operator ".",
so I tried result.limitedByMaxRows and that got the same.  Presumably it
is looking for a get method, how do I access an is method?

David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dynamically built select statements (SQL)

2003-03-03 Thread Shawn Bayern
On Mon, 3 Mar 2003, David Goodenough wrote:

> 
>   SELECT dno, action, destination, quantity, updated FROM load
>   WHERE 
>   
> 
> When I try to run this I get an SQL exception
> (javax.servlet.ServletException) :-
> 
>  SELECT dno, action, due, destination, quantity, updated FROM load 
> WHERE area = 'NW' 
> ORDER BY due DESC FOR READ ONLY
> : ERROR:  parser: parse error at or near "NW"

The  tag by default escapes quotation marks, as they are XML
metacharacters.  Use the escapeXml="false" attribute to get around your
problem.  (The problem would show up more clearly if you looked at the raw
HTML source of the page that's giving you this error message.)

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Dynamically built select statements (SQL)

2003-03-03 Thread David Goodenough
I have a problem with a SQL select statement that I need to build dynamically.

Most of the select remains constant, but depending on which fields are filled
in on the search form the WHERE clause changes.  This code used to be largely
Java when this application ran on Websphere, but having moved it to Tomcat and
JSTL I would rather minimise the Java (I could always write a bean if it is
not possible otherwise, but I would rather not).

I have built a JSTL variable called where, and I then build the SELECT 
statement:-


SELECT dno, action, destination, quantity, updated FROM load
WHERE 


When I try to run this I get an SQL exception
(javax.servlet.ServletException) :-

 SELECT dno, action, due, destination, quantity, updated FROM load 
WHERE area = 'NW' 
ORDER BY due DESC FOR READ ONLY
: ERROR:  parser: parse error at or near "NW"

The backend DB is Postgres, which seems to work very nicely in all the other
SQL I have thrown at it from JSTL.  However the others have fixed SELECT
statements and I put the values in using .  In this case I have 
one of three basic bits of the WHERE clause, and two secondary search
items, and the thought of having the full set of separate SELECT statements
does not seem right.

I am obviously doing something extreemly silly, can anyone spot it?

David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]