Start a new topic

Run a stored procedure in an SQL script for MySQL

[This topic is migrated from our old forums. The original author name has been removed]

Hi, I'm trying to run a script with that contains stored procedures which I call. I delimit them using "#". But this is identified as an error by dbvis, but not by other sql-tools. How would I run this script? drop procedure if exists intro_questionnaire_answer; delimiter # create procedure intro_questionnaire_answer(IN pid INT, IN createdTimestamp DATETIME, IN smoking_answer VARCHAR(255), IN height_answer VARCHAR(255)) begin INSERT INTO Answer (type, createdTimestamp, lastUpdatedTimestamp, value, item_itemId, itemGroup_itemGroupId, answerGroupId, patientId) VALUES ('information', createdTimestamp, createdTimestamp, NULL, @intro_question_1, @intro, NULL, pid); end # call intro_questionnaire_answer(@patientId, @createdTimestamp, @smoking_answer, @height_answer);
1 Comment

[This reply is migrated from our old forums.]

Re: Run a stored procedure in an SQL script for MySQL
Mikael, Instead of "delimiter #" use: @delimiter #; create procedure intro_questionnaire_answer ... @delimiter ;# Read more in: Regards Roger