function ';' problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cozsmin
    New Member
    • Mar 2007
    • 14

    function ';' problem

    hy
    i am a beginner at mysql but i tried to create a function and i get a weird error, the code is :

    create function f1() returns int
    begin
    return 9; <-- and here it crashes
    You have an error in your mysql sintax blalblablablabl a
    why does it not let me continue my function ?? and takes the ';' as a command ?
  • pradeep kaltari
    Recognized Expert New Member
    • May 2007
    • 102

    #2
    Originally posted by cozsmin
    hy
    i am a beginner at mysql but i tried to create a function and i get a weird error, the code is :

    create function f1() returns int
    begin
    return 9; <-- and here it crashes
    You have an error in your mysql sintax blalblablablabl a
    why does it not let me continue my function ?? and takes the ';' as a command ?
    Hi cozsmin,
    There is no problem with ";". semi-colon is taken as statement delimiter.

    You have used "BEGIN" in your function. Every BEGIN should have an END clause. Just add an END after your RETURN statement.

    Hope this helps.

    ~/Pradeep

    Comment

    Working...