Results 1 to 2 of 2

Thread: SP syntax help!

  1. #1
    Join Date
    Oct 2005

    Unanswered: SP syntax help!


    I have the following table created:

    create table Person_tab(
    Id INT, Name CHAR(10), Age INT, Address CHAR(10)

    then I tried to run this SP:

    CREATE PROCEDURE addPerson(IN pId INT, IN pName CHAR(10), IN pAge INT, IN pAddress CHAR(10))
    INSERT INTO Person_tab (Id, Name, Age, Address) VALUES (pId, pName, pAge, pAddress);

    I also tried it without the begin:

    I get this error:

    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near 'proce
    dure addPerson (IN pId INT, IN pName char(10), IN pAge INT, IN pAddress cha' at
    line 1
    mysql> Aborted

    Anyone tell em whats wrong?

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    the only reason i can think of why it would barf on the word PROCEDURE is because you are on a version that doesn't support procedures | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts