Yes, sorry about previous comment, didn't look closely enough at the code.
You'd have to do what I suggested if you were retrieving the column by name
instead of by position.
Joseph Karau
Kingland Systems
[EMAIL PROTECTED]
507-536-3629
AIM: jkara3629
-----Original Message-----
From: Chris Pratt [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 2:19 PM
To: [EMAIL PROTECTED]
Subject: Re: Column index out of range ???
That's because you're asking for column 2. When you use the *, it's
returning enough columns. When you only ask for User, you have to change
your <sql:getColumn>'s to position="1".
(*Chris*)
----- Original Message -----
From: "sufi malak" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 10, 2001 12:08 PM
Subject: Re: [JSP-INTEREST] Column index out of range ???
> Here is the code :
>
> <FORM NAME="productGoto">
> <FONT FACE="Arial,Helvetica" SIZE="-2">
> <sql:statement id="stmt1" conn="conn1">
> <sql:query>
> select * from pcinfo order by User
> </sql:query>
> <%-- loop through the rows of your query --%>
> Select By User:
> <SELECT NAME="productList" onChange="gotoFunction()" onBlur="return
> options[0].selected = true">
> <OPTION VALUE=" "> Users >> </OPTION>
> <OPTION VALUE="ALL">All </OPTION>
> <sql:resultSet id="rset2">
> <OPTION VALUE= '<sql:escapeSql><sql:getColumn
> position="2"/></sql:escapeSql>'> <sql:getColumn position="2"/></OPTION>
> </sql:resultSet>
> </SELECT>
> </sql:statement>
> </FORM>
>
> It works fine with "*" (And I got duplication fields in the drop down
> list)but when I put
> select distinct User from pcinfo order by User I got the error :
> Column index out of range.
>
> thanks.
>
>
>
> >From: "Karau, Joe" <[EMAIL PROTECTED]>
> >Reply-To: A mailing list about Java Server Pages specification and
> >reference <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: Column index out of range ???
> >Date: Mon, 10 Sep 2001 13:37:30 -0500
> >
> >What's the code for where you build your SQL, retrieve the columns after
> >executing the query, and the table definition(s) for the table(s) that
you
> >are querying?
> >
> >Joseph Karau
> >Kingland Systems
> >[EMAIL PROTECTED]
> >507-536-3629
> >AIM: jkara3629
> >
> >
> >-----Original Message-----
> >From: sufi malak [mailto:[EMAIL PROTECTED]]
> >Sent: Monday, September 10, 2001 1:36 PM
> >To: [EMAIL PROTECTED]
> >Subject: Re: Column index out of range ???
> >
> >
> >No, it's not like that, because I am trying the qyery from the command
line
> >of Mysql and it works, but not in jsp file.
> >thanks
> >
> > >From: Satyanarayan Divakar <[EMAIL PROTECTED]>
> > >Reply-To: A mailing list about Java Server Pages specification and
> > >reference <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Subject: Re: Column index out of range ???
> > >Date: Mon, 10 Sep 2001 13:04:56 -0500
> > >
> > >That means u are referring to a cloumn that is not present in the
result
> > >set
> > >you have obtained..
> > >
> > >-----Original Message-----
> > >From: sufi malak [mailto:[EMAIL PROTECTED]]
> > >Sent: Monday, September 10, 2001 1:04 PM
> > >To: [EMAIL PROTECTED]
> > >Subject: Column index out of range ???
> > >
> > >
> > >Could you please tell me what this error means :
> > >
> > >Error: 500
> > >Location: /pcinfo/pager-jdbc.jsp
> > >Internal Servlet Error:
> > >
> > >javax.servlet.ServletException: java.sql.SQLException: Column index out
> >of
> > >range.
> > >
> > >
> > >Thanks
> > >
> > >
> > >_________________________________________________________________
> > >Get your FREE download of MSN Explorer at
> >http://explorer.msn.com/intl.asp
> > >
> >
>===========================================================================
> > >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > >JSP-INTEREST".
> > >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > >DIGEST".
> > >Some relevant FAQs on JSP/Servlets can be found at:
> > >
> > > http://java.sun.com/products/jsp/faq.html
> > > http://www.esperanto.org.nz/jsp/jspfaq.html
> > > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> > >
> >
>===========================================================================
> > >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > >JSP-INTEREST".
> > >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> > >DIGEST".
> > >Some relevant FAQs on JSP/Servlets can be found at:
> > >
> > > http://java.sun.com/products/jsp/faq.html
> > > http://www.esperanto.org.nz/jsp/jspfaq.html
> > > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> >
> >_________________________________________________________________
> >Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp
> >
>
>===========================================================================
> >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> >JSP-INTEREST".
> >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> >DIGEST".
> >Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
>===========================================================================
> >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> >JSP-INTEREST".
> >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> >DIGEST".
> >Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets