I am using navicat lite with mysql database.
my database is test
and i have a table named transactions with schema: date, sharename,buyORsell,quantity,finalrate
I am trying to create a new procedure which takes some input and outputs some results, and I would want that when I execute this procedure, this procedure asks for the input parameter from the user and outputs results accordingly.
My requirement: given a input (transaction type i.e. 'buy' or 'sell'), it should output al开发者_Python百科l the transactions with that type
I create a function and click on procedure
BEGIN
#Routine body goes here...
select * from test.transactions where buyORsell = intype;
END
In the space below, I see:
IN `intype` char
But when I run this prcedure and type sell in "enter parameter" pop-up, I get the error:
Unknown column 'sell' in 'field list'
Please help..
I had the same problem. I fixed it by defining char with a length (i.e. char(254)
) and then wrapping the input string in quotes when prompted.
You have an error in your stored procedure definition and forgot to include the intype as a parameter
Looks like it might be a Navicat problem. I now use HeidiSQL for functions and that seems to work fine.
With Navicat, the same problem occurs when I have an input parameter - whether or not I use that paramater. Like Martin I can clear out all the code from BEGIN...END but still get the error if I use any char or varchar input parameter.
In fact, using varchar as an input parameter ALWAYS gives a save/compile error with ANY function using Navicat. With Navicat, Varchar in functions seems completely broken.
精彩评论