On Feb 15, 10:31 am, "Ted" <r.ted.by...@rogers.com> wrote:
> 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- Hide quoted text -
>
> - Show quoted text -
Well, with about an hour of trial and error, it seems that although
the stored procedure seems to work from within MySQL Broswer, it
definitely does not work from an ASP.NET2 page. The statement gets
executed, MS Visual Studio knows what columns are present in the
resultset, but the resultset itself seems to disappear into never-
never land. :-(
How do I return the resultset to the calling client code?
Ted