0

I have created the following table:

CREATE TABLE Toy
(Toy_ID INT NOT NULL AUTO_INCREMENT,
 Toy_Name VARCHAR(30) UNIQUE NOT NULL,
 Toy_Price NUMERIC NOT NULL,
 PRIMARY KEY (Toy_ID)
)

and then I inserted the values in toy table:

INSERT INTO Toy (Toy_Name,Toy_Price)
VALUES ('Naruto',25.00);
INSERT INTO Toy (Toy_Name,Toy_Price)
VALUES ('Goku',25.00);
INSERT INTO Toy (Toy_Name,Toy_Price)
VALUES ('Luffy',25.00);

and then I typed the following stored procedure in SQL window in phpmyadmin:

CREATE PROCEDURE searchtoy (IN toy_no INT)
BEGIN
SELECT * FROM Toy
WHERE Toy_ID = toy_no;
END;

The stored procedure has been created successfully.

Then I tried to execute the stored procedure in the SQL window and I also have added // in the Delimiter text box:

CALL searchtoy(1);

But I am getting the following error:

Error
Static analysis:

1 errors were found during analysis.

Unexpected token. (near ";" at position 17)
SQL query:

CALL searchtoy(1);

MySQL said: Documentation

#1305 - PROCEDURE demo.searchtoy does not exist

Despite the stored procedure being created successfully, it is still showing that the stored procedure does not exist.

Where did I go wrong ? It would be really helpful if the solution code is provided.

1 Answer 1

1

it is looking for searchtoy in demo schema. check the schema in which you have created your function

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.