SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: mysql stored procs
-
Dec 31, 2008, 08:37 #1
- Join Date
- May 2006
- Location
- Oxford, UK | Durham, UK
- Posts
- 243
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
mysql stored procs
Can anyone see an error with this as i am unable to create this stored procedure. I am alright with mssql stored procs but mysql stored procs just confuse me.
Code:delimiter // DROP PROCEDURE IF EXISTS AddNewIncident// CREATE PROCEDURE AddNewIncident ( StudentID INT, DateTimeReported DATETIME, NatureOfIllness TEXT, DecisionMade INT, ActionTaken VARCHAR(200) ) BEGIN SET @IncidentID = SELECT MAX(IncidentID) FROM Incident; INSERT INTO Incident VALUES (@IncidentID, StudentID, DateTimeReported, NatureOfIllness, DecisionMade, ActionTaken); END
error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @IncidentID = SELECT MAX(IncidentID) FROM Incident;
INSERT INTO Incident VA' at line 10
Cheers in advancedMalachi Soord
Something will come here
-
Jan 1, 2009, 13:42 #2
- Join Date
- Apr 2006
- Location
- Maryland
- Posts
- 1,838
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Try
Code:SELECT @IncidentID = MAX(IncidentID) FROM Incident
Last edited by SoulScratch; Jan 1, 2009 at 16:19.
-
Jan 3, 2009, 16:38 #3
- Join Date
- May 2006
- Location
- Oxford, UK | Durham, UK
- Posts
- 243
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thank you =]
Malachi Soord
Something will come here
-
Jan 3, 2009, 16:39 #4
- Join Date
- Apr 2006
- Location
- Maryland
- Posts
- 1,838
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hm, so that really worked? Nice
Bookmarks