0

0 down vote favorite

I have a table:

    CREATE TABLE `student` (
      `id` int(11) NOT NULL AUTO_INCREMENT,
      `name` varchar(100) NOT NULL,
      `score` int(11) NOT NULL,
      PRIMARY KEY (`id`)

Now i want to create a stored procedure that will insert new column into this table with the next id (which is automaticly created), name (value which I will write), and score (which i will write).

Quoted Text Here

I have tryed

    DELIMITER ;;
    CREATE PROCEDURE insertStudent (IN name varchar(100),IN score int(11))
    BEGIN
        insert into student (name,score) values (newName,newScore);
    END
    ;;

But it doesnt seem to work.

I know this is basic but i need help.

3
Contributors
4
Replies
28
Views
3 Years
Discussion Span
Last Post by parijatziw
0
DELIMITER ;;
CREATE PROCEDURE insertStudent (IN newName varchar(100), IN newScore int(11))
BEGIN
    INSERT INTO student (name, score) VALUES (newName, newScore);
END
;;

Your values should match your parameters.

0

It doesnt seem to work agin.
Am I using the right CALL

call insertstudent(John Doe, 75)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.