MySQL Forums
Forum List  »  Stored Procedures

Create Stored Procedure errors
Posted by: Asad Khan
Date: May 16, 2008 01:41PM

Hello all:

I am a SQL Server and Oracle technologist, now I been given task to work on MYSQl.

i CAN SEE THERE ARE ALREADY SOME FUNDAMENTAL differences.

I have been for the past 3 to fours searching and reviewing to create a stored procedure.

I am having so many issues.

First of all I am on MYSQL v 5.0.24.

I am using the MYSQL Query browser to create my stored procedure. Through the schema there is an option for creating a new sprocedure, which opens a template. Here is the detail of the template:

DELIMITER $$

CREATE PROCEDURE `hanger`.`SP_GETQUESTIONS` (IN P_USERTYPE VARCHAR(1))
BEGIN

SELECT C.C_ID,C.CAT_NAME,C.C_SORT_ORDER,A.Q_ID,A.Q_DESC,
A.SORT_ORDER Q_SORT_ORDER,A.PRESENTATION_TYPE,A.Q_USER_TYPE,
A.IS_REQUIRED,B.Q_OPTION_ID,B.OPTION_DESC,B.SORT_ORDER O_SORT_ORDER,B.IS_DEFAULT
FROM Q_CATEGORIES C, Q_MASTER A, Q_DETAILS B
WHERE C.IS_ACTIVE='YES'
AND A.Q_USER_TYPE=P_USERTYPE
AND A.C_ID=C.C_ID
AND A.IS_ACTIVE='YES'
AND B.Q_ID=A.Q_ID
AND B.IS_ACTIVE='YES'
ORDER BY B.SORT_ORDER;

END$$

DELIMITER ;

I am getting the following error messages:

Script line: 1 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 'DELIMITER $$

CREATE PROCEDURE `hanger`.`SP_GETQUESTIONS` (IN P_USERTYPE VARCH' at line 1


Any thoughts on this.

I aprreciate anyone's help.

Options: ReplyQuote


Subject
Views
Written By
Posted
Create Stored Procedure errors
2250
May 16, 2008 01:41PM


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.