All pastes #297489 Raw Edit

Untitled

public text v1 · immutable
#297489 ·published 2006-12-31 03:29 UTC
rendered paste body
DELIMITER $$

DROP PROCEDURE IF EXISTS `inserted`$$

CREATE PROCEDURE `inserted` (
	INOUT thedate DATETIME,
	INOUT theuser VARCHAR(10))
BEGIN
	
	SET thedate = ifnull(thedate, now());
	/*Sets the user to a first letter capped for the actual mysql username without the domain info.*/
	SET theuser = ifnull(theuser, CONCAT( UPPER( SUBSTR( USER(), 1, 1 ) ) , LOWER( SUBSTRING( SUBSTR(USER(),1,INSTR(USER(  ),'@')-1), 2 ) ) ));	

END$$

DELIMITER ;