Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.61 KB | None | 0 0
  1. DROP FUNCTION IF EXISTS f_createGuildClaim;
  2. CREATE FUNCTION `f_createGuildClaim`(
  3.     `inGuildID` INT UNSIGNED,
  4.     `inCenterGeoID` INT UNSIGNED,
  5.     `inRadius` INT UNSIGNED
  6. )
  7.     RETURNS INT UNSIGNED
  8. BEGIN
  9.     DECLARE newGuildLandID, newClaimID INT UNSIGNED DEFAULT NULL;
  10.    
  11.     INSERT INTO guild_lands(`GuildID`, `CenterGeoID`, `Radius`, `LandType`)
  12.     VALUES                 (inGuildID, inCenterGeoID, inRadius, 1/*core*/);
  13.    
  14.     SET newGuildLandID =LAST_INSERT_ID();
  15.  
  16.     INSERT INTO claims(`GuildLandID`, `SupportPoints`)
  17.     VALUES            (newGuildLandID,   0);
  18.    
  19.     SET newClaimID =LAST_INSERT_ID();
  20.    
  21.     RETURN newClaimID;
  22. END;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement