MySQL Forums
Forum List  »  Stored Procedures

variables in WHERE
Posted by: Eric Dropps
Date: March 23, 2005 08:04PM

Hello, I need some help here, i've tried a bunch of things but i'm stuck!

for some reson this code below always returns:

mysql> CALL FIND_COUNCIL (won);
ERROR 1054 (42S22): Unknown column 'won' in 'order clause'

CREATE PROCEDURE `campnet`.`Find_Council`(IN txtin VARCHAR(50) )
SELECT *
FROM `council`
WHERE `Council Name` LIKE CONCAT('%',"txtin",'%');


the query works fine by itself, but not inside the procedure (i assue it's due to the fact i need to put % on both sides of the variable.

Any help appriciated!

Options: ReplyQuote


Subject
Views
Written By
Posted
variables in WHERE
4683
March 23, 2005 08:04PM
2526
March 24, 2005 02:53AM
2623
March 24, 2005 07:39AM
2362
March 24, 2005 03:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.