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