SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict inverse.chi's Avatar
    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
    and get the following error

    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 advanced
    Malachi Soord
    Something will come here

  2. #2
    Guru in training bronze trophy SoulScratch's Avatar
    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.
    Cross browser css bugs

    Dan Schulz you will be missed

  3. #3
    SitePoint Addict inverse.chi's Avatar
    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

  4. #4
    Guru in training bronze trophy SoulScratch's Avatar
    Join Date
    Apr 2006
    Location
    Maryland
    Posts
    1,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, so that really worked? Nice
    Cross browser css bugs

    Dan Schulz you will be missed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •