These two procedures get different results.

No resultset. Wrong result

CREATE DBPROC REG.GetAllTowns(IN code varchar(3))
RETURNS CURSOR AS
BEGIN
   DECLARE :$CURSOR CURSOR FOR
SELECT TOWN,CODE, DISTRICT FROM gis.all_towns where code like (:code||'%') order by town;
END;


Correct variant


CREATE DBPROC REG.GetAllTowns(IN code varchar(3))
RETURNS CURSOR AS
VAR
   t varchar(4);
BEGIN
   SET t = code||'%';
   DECLARE :$CURSOR CURSOR FOR
SELECT TOWN,CODE, DISTRICT FROM gis.all_towns where code like :t order by town;
END;


--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to