hai
ya...this wud work seperatly ...but not when put together...as far as to my
knowledge...this is immposible.. The only way is to get the data from the first result
set ....and next execute the next query and get its result set.... so u must do it one
by one
bye
Madhan Srinivasan
Hi all,
I did the code for searching video.
My purpose is the user may enter
Type, Title or Actor, or either any
two of them, or all of them.
The code can work individually, but
after put them together, it only works on
last query which to enter all of them
three. Could anyone give any idea?
Thanks in advance!!
Code:
<%
if( VideoType == "ALL" )
{
if( VideoTitle == "" )
{
if( VideoActor == "" ) {
strSQL = "SELECT ISBN, V_Title, V_Type,
V_Actor, V_Time FROM
Video_Catalog";
}
else {
strSQL = strSELECT + "V_Actor = '" +
VideoActor + "'";
}
}
else
{
if( VideoActor=="" ) {
strSQL = strSELECT + "V_Title = '" +
VideoTitle + "'";
}
else {
strSQL = strSELECT + "V_Title = '" +
VideoTitle + "' AND V_Actor = '" +
VideoActor + "'";
}
}
}
else
{
if( VideoTitle=="")
{
if( VideoActor==""){
strSQL = strSELECT + "V_Type = '" + VideoType
+ "'";
}
else{
strSQL = strSELECT + "V_Type = '" + VideoType
+ "' AND V_Actor = '" + VideoActor
+ "'";
}
}
else
{
if( VideoActor==""){
strSQL = strSELECT + "V_Type = '" + VideoType
+ "' AND V_Title = '" + VideoTitle
+ "'";
}
else {
strSQL = strSELECT + "V_Type = '" + VideoType
+ "' AND V_Title = '" + VideoTitle +
"' AND V_Actor = '" + VideoActor + "'";
}
}
}
%>
<% rs = statement.executeQuery( strSQL ); %>
Jun Wang
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.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
______________________________________________________
123India.com - India's Premier Portal
Get your Free Email Account at http://www.123india.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