zoukankan      html  css  js  c++  java
  • 存储过程

    1、查看已存在的存储过程内容

    show create procedure UpdatePushRecord; 

    2、添加存储过车

    DELIMITER //

    CREATE DEFINER=`root`@`%` PROCEDURE `UpdateHspTask`()
    begin
    INSERT INTO
    `hsp_enforcementresult_tasklog` (`Id`, `RelationId`, `Type`, `TreatmentId`, `PatientId`, `PatientCard`, `PatientRegNo`, `PatientName`)
    select 'id','-1','Type','TreatmentId','PatientId','PatientCard','PatientRegNo','PatientName'
    from hsp_enforcementresult_task
    where DATE_FORMAT(now(), '%H:%i:00')='23:55:00' and DATE_FORMAT(CreateTime, '%H:%i:00')!='23:55:00';


    delete from `hsp_enforcementresult_task`
    where DATE_FORMAT(now(), '%H:%i:00')='23:55:00' and DATE_FORMAT(CreateTime, '%H:%i:00')!='23:55:00';
    end //
    DELIMITER ;

    注意: mysql中DELIMITER //的使用

    3、删除存储过程

    DROP PROCEDURE UpdateHspTask;

  • 相关阅读:
    Minimum Path Sum
    Unique Paths II
    Unique Paths
    Rotate List
    Permutation Sequence
    Merge Intervals
    Jump Game
    Group Anagrams
    Combination Sum II
    评分
  • 原文地址:https://www.cnblogs.com/sangxia/p/6249729.html
Copyright © 2011-2022 走看看