View Single Post

   
  #3 (permalink)  
Old 02-28-2008, 09:10 AM
Ted
 
Posts: n/a
Default Re: Problem with create procedure

On Feb 15, 3:52 am, Willem Bogaerts
<w.bogae...@kratz.maardanzonderditstuk.nl> wrote:
> > Here is what I tried.

>
> > CREATE PROCEDURE 'sr19'.sp_find_food(
> > IN search_string varchar(255)
> > ) LANGUAGE SQL
> > BEGIN
> > DECLARE ss VARCHAR(257);
> > SET ss = CONCAT('%',search_string,'%');
> > SELECT NDB_No,Long_Desc FROM 'sr19'.food_desc WHERE Long_Desc LIKE
> > ss;
> > END

>
> ...
>
> > The error message is relatively useless in that all it says is that
> > there is an error in the SQL syntax used for the select statement.

>
> I think you meant backticks for the sr19 table. But it is not a reserved
> word, so omitting the single quotes would be more clear.
>
> Best regards
> --
> Willem Bogaerts
>
> Application smith
> Kratz B.V.http://www.kratz.nl/


Thanks Willem

I get the right results when, in MySQL Browser, I execute the
following:

CALL sr19.sp_find_food('Butter');

In this database, the resultset from this query should contain 151
records. The above statement has that many records.

What is not clear to me is whether these results are displayed to
standard output from within the procedure or returned to the client
application for the latter to write the output. If I invoke this
procedure from an ASP.NET or JSF page, or a Java servlet using JDBC,
will the resultset be put in the appropriate datasource object or
disappear into never-never land?

Thanks

Ted

Reply With Quote