As this question is tagged "MySQL" then you should use the correct syntax for MySQL
MySQL :: MySQL 5.7 Reference Manual :: 13.1.16 CREATE PROCEDURE and CREATE FUNCTION Statements[
^] For a start I don't think you can abbreviate the word
PROCEDURE
The parameters must be defined as IN (or OUT) and should not have the @ symbol. This does mean that your parameters will have the exact names as your columns - you have already been told that is not good practice, so consider using something to distinguish one from the other.
Also - you are missing the closing ) on the parameter list and that
AS
should not be there
Also, are you sure you meant
@ADMIS_ID INT= NULL,
@PERSON_ID INT(4)= NULL,
@DOCTOR_ID INT(4) = NULL,
because AFAIK you can't give default values to MySQL parameters like that.
Also there is no such thing in M
ySQL as
SET NOCOUNT ON
So this procedure is largely written as M
SSQL. If that is what you really want then lose the
(4)
on the parameter definitions