try using the query:

select distinct(user) as user from pcinfo order by user

... just using "select disinct user as user from pcinfo order by user"
is most likely returning a column named "distinct user"  I'm not sure if
that is part of the SQL standard or not, however it is very common among
relational databases.


Joseph Karau
Kingland Systems
[EMAIL PROTECTED]
507-536-3629
AIM: jkara3629


-----Original Message-----
From: sufi malak [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 10, 2001 2:09 PM
To: [EMAIL PROTECTED]
Subject: Re: 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

===========================================================================
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

Reply via email to