All pastes #296344 Raw Edit

Mine

public text v1 · immutable
#296344 ·published 2006-12-30 03:11 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 = CONCAT( UPPER( SUBSTR( USER(), 1, 1 ) ) , LOWER( SUBSTRING( SUBSTR(USER(),1,INSTR(USER(  ),'@')-1), 2 ) ) );	

END$$

DELIMITER ;