Dong Shin 11.02.2012

  • added visibility_scripting to the list of databases for VSS
  • working on SQL queries
    • get_date_variables example
      • CALL `get_date_variables` (@p0 , @p1 , @p2 , @p3);SELECT @p0 AS `current_month` , @p1 AS `current_year` , @p2 AS `previous_month` , @p3 AS `current_month_str` ;
    • created a stored procedure to return date variables
      • CREATE DEFINER=`root`@`localhost` PROCEDURE `get_date_variables`(OUT `current_month` INT, OUT `current_year` INT, OUT `previous_month` INT, OUT `current_month_str` VARCHAR(25))
        BEGIN
        SET current_year = IF(MONTH(CURDATE()) > 9, YEAR(CURDATE())+1, YEAR(CURDATE()));
        SET current_month := IF(MONTH(CURDATE()) > 9, MONTH(CURDATE())-9, MONTH(CURDATE())+3);
        SET previous_month := IF(MONTH(CURDATE()) > 9,
        IF(MONTH(CURDATE())=10, 1, MONTH(CURDATE())-10), MONTH(CURDATE())+2);
        SET current_month_str := IF(current_month = 1, ‘Oct’,
        IF(current_month = 2, ‘Nov’,
        IF(current_month = 3, ‘Dec’,
        IF(current_month = 4, ‘Jan’,
        IF(current_month = 5, ‘Feb’,
        IF(current_month = 6, ‘Mar’,
        IF(current_month = 7, ‘Apr’,
        IF(current_month = 8, ‘May’,
        IF(current_month = 9, ‘Jun’,
        IF(current_month = 10, ‘Jul’,
        IF(current_month = 11, ‘Aug’,
        IF(current_month = 12, ‘Sep’, ‘ERR’))))))))))));
        END
    • queries to get current year, month, previous month, and month string
      • SET @current_year = YEAR(CURDATE()), @current_month = MONTH(CURDATE());
        SET @current_fy_month := IF(@current_month > 9, @current_month-9, @current_month+3);
        SET @previous_fy_month := IF(@current_month > 10, @current_month-9, @current_month+2);
        SET @current_month_str := IF(@current_month = 1, ‘Oct’,
        IF(@current_fy_month = 2, ‘Nov’,
        IF(@current_fy_month = 3, ‘Dec’,
        IF(@current_fy_month = 4, ‘Jan’,
        IF(@current_fy_month = 5, ‘Feb’,
        IF(@current_fy_month = 6, ‘Mar’,
        IF(@current_fy_month = 7, ‘Apr’,
        IF(@current_fy_month = 8, ‘May’,
        IF(@current_fy_month = 9, ‘Jun’,
        IF(@current_fy_month = 10, ‘Jul’,
        IF(@current_fy_month = 11, ‘Aug’,
        IF(@current_fy_month = 12, ‘Sep’, ‘ERR’))))))))))));
        SELECT @current_year, @current_month, @current_fy_month, @previous_fy_month, @current_month_str;
  • FGMDEV backup
    • ftp keeps timing out on the large file – svn dump…
    • created cron job to back up at 1AM