Hi,
I new to the MySQL syntax.
I have created a procedure and ran it, but it is showing some syntax probem, can you help me?
My procedure is as:
**DELIMITER $$
CREATE PROCEDURE TestAdd(
in mODE varchar(10),
in Id int,
in AttName varchar(10),
in AttValues Varchar(10)
)
IF EXISTS (SELECT * FROM AttTable WHERE id=Id) THEN
SET Mode='Modify'
ELSE
SET Mode='Add'
Start Transaction
BEGIN
IF (mODE='Add') THEN
insert into atttable values (Id, AttName, AttValue);
ELSE (if Mode='Modify') then
update AttTable set AttName=AttName, AttValue= AttValue where Id=Id;
END IF
END
$$
Delimiter ;**
Whre i am doin wrong?? Thanks in Advance.