hmmm
one way I guess to process this form would be to have a loop that
grows with each not null parameter from the post.
i.e pseudo code..
query = " select clause from clause where "
while loop
query.append(" field1 = "+ parameter[loop]);
if anymore params query.append(" and");
else end of query
end loop
then push this string into the connection to the DB
To page the information I usesully use a Vector to store all of the data and
then you can
simply loop through 50 elements (rows) at time per page display ,making sure
to keep track of the last page number and row, at the end of each page just
have a submit button that contains the current page number for the
next page.
Kind Regards
Ejber Ozkan Internet Applications Developer
Ezz Colt Internet
Pager 0941148608
[EMAIL PROTECTED]
> -----Original Message-----
> From: Jeetandra Mahtani [SMTP:[EMAIL PROTECTED]]
> Sent: 18 May 1999 20:57
> To: [EMAIL PROTECTED]
> Subject: complicated sql...need some help...
>
> Hello,
> I am working on an inquiry form and I am kind of stuck in thinking of
> an optimum way to write the sql to do the inquiry. The form consists
> of 8 fields and the user needs to fill out atleast one field. A
> servlet will take the values entered(atleast one) by the user and
> search a table based on the values entered by the user.
> Now, there can be so many combinations since the user may enter one
> field or two ..etc.Any suggestions on how I could write the sql?
> Also, the sql may return a thousand records..how do I display about 50
> records per page. If the user clicks on a next button, the next 50
> records are displayed. Any idea on how I could split the retrieved
> records into pages.Thanks,JGM
> _____________________________________________________________
> Do You Yahoo!?
> Free instant messaging and more at http://messenger.yahoo.com
>
> __________________________________________________________________________
> _
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html