SQL Query question

2002-07-15 Thread Alex Reznik

Hello, 
please take a look at the following:

sql:query var=value 
select value from msgrouter.mr_preferences where category = ? and name = ?
sql:param value=${tmp}/
sql:param value=${tmp_name}/ 
/sql:query

i am getting an invalid column type error from this statement...is the error
in and name = ? part and how do i avoid it?
thank you, 
alex
-Original Message-
From: Shawn Bayern [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 3:38 PM
To: Tag Libraries Users List
Subject: RE: Compress the HTML code


On Mon, 15 Jul 2002, Alex Reznik wrote:

 If i were to iterate over two sets of parameters, is there a way to
specify
 their values within one forEach loop?

It depends on what you really want to do.  You can iterate over numbers
and apply them as indices over two arrays or List objects, like this:

  c:forEach var=i begin=0 end=${end}
c:out value=${a[i]} /
c:out value=${b[i]} /
  /c:forEach

Or you can iterate over one array and use 'count' from 'varStatus' as the
index into another:

  c:forEach items=${a} var=aItem varStatus=s
c:out value=${a} /
c:out value=${b[s.count]} /
  /c:forEach

If you're looking for something else, please feel free to clarify.  Hope
this helps,

-- 
Shawn Bayern
JSTL in Action   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


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

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




Re: SQL Query question

2002-07-15 Thread Shawn Bayern

On Mon, 15 Jul 2002, Alex Reznik wrote:

 Hello, 
 please take a look at the following:
 
 sql:query var=value 
 select value from msgrouter.mr_preferences where category = ? and name = ?
 sql:param value=${tmp}/
 sql:param value=${tmp_name}/ 
 /sql:query
 
 i am getting an invalid column type error from this statement...is the error
 in and name = ? part and how do i avoid it?

If the error says something like invalid column type, that probably 
comes from your JDBC driver.  The error sounds like it's indicative of an 
attempt to assign a variable of one type to a column that cannot accept 
that type.  (E.g., you might be setting an integer in to a SQL TIMESTAMP 
field.)  Without more information, it'll be hard to diagnose the problem 
further.

-- 
Shawn Bayern
JSTL in Action   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


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




RE: SQL Query question

2002-07-15 Thread Alex Reznik

all fields in the db are varchar2 and i am trying to send it parameters from
a request obj, also i am using Oracle8i..is there any occasion when the ?
mark need to be quoted?
alex

-Original Message-
From: Shawn Bayern [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 4:29 PM
To: Tag Libraries Users List
Subject: Re: SQL Query question


On Mon, 15 Jul 2002, Alex Reznik wrote:

 Hello, 
 please take a look at the following:
 
 sql:query var=value 
 select value from msgrouter.mr_preferences where category = ? and name = ?
 sql:param value=${tmp}/
 sql:param value=${tmp_name}/ 
 /sql:query
 
 i am getting an invalid column type error from this statement...is the
error
 in and name = ? part and how do i avoid it?

If the error says something like invalid column type, that probably 
comes from your JDBC driver.  The error sounds like it's indicative of an 
attempt to assign a variable of one type to a column that cannot accept 
that type.  (E.g., you might be setting an integer in to a SQL TIMESTAMP 
field.)  Without more information, it'll be hard to diagnose the problem 
further.

-- 
Shawn Bayern
JSTL in Action   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


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

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




RE: SQL Query question

2002-07-15 Thread Alex Reznik
)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1027)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
)
at java.lang.Thread.run(Thread.java:536)


-Original Message-
From: Shawn Bayern [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 4:39 PM
To: Tag Libraries Users List
Subject: RE: SQL Query question


On Mon, 15 Jul 2002, Alex Reznik wrote:

 all fields in the db are varchar2 and i am trying to send it parameters
from
 a request obj, also i am using Oracle8i..is there any occasion when the ?
 mark need to be quoted?

No, ? should not need to be quoted.  What's the actual text of your
error message?  (The stack trace might help too.)

-- 
Shawn Bayern
JSTL in Action   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


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

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