CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 JSP: how to filter SQL on parameter (getParam?)

Print topic Send  topic

Author Message
mbvt
Posted: 03/08/2002, 6:29 AM

Hi

I've got a form that needs to show just one record based on a parameter passed on the URL. This should be done by using { and } according to the man, but that works only for numbers, not strings.

Here's most of the SQL I used:

SELECT concat('<img src=\"', sizepath.path, image.filename, '\" align=\"center\">') as url, image.filename, image.visible, image.hits, exif.comment FROM sizepath, image LEFT JOIN exif USING (filename) where visible = 1 and sizepath.id = 2 and image.filename = .........

on ....... I tried:

{p_filename} -> SQL error
'{p_filename}' -> no rows (passed literally)
getParam( request, "p_filename") -> SQL error
'getParam( request, "p_filename")' -> JSP error (on double quotes).

So, what should I do?

grM

PS, It does work on standard tables, but I can't use that due to the outerjoin and other joins.
Nicole
Posted: 03/11/2002, 3:57 AM

Hello,
where have you enter mentioned sql statement?
If it is used as custom sql for the form you may use any "filename" for design time. For working site replace it with real "filename" in Open event of the form. E.G.
sSQL = "SELECT concat('<img src=\"', sizepath.path, image.filename, '\" align=\"center\">') as url, image.filename, image.visible, image.hits, exif.comment FROM sizepath, image LEFT JOIN exif USING "+ getParam(request, "filename") +" where visible = 1 and sizepath.id = 2 and image.filename = ......... "

Note, that "filename" is to be passed to the form through URL or may be through session.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.