Automatic execution using mysql event timing
BEGIN
set @table_name = concat('p', DATE_FORMAT(DATE_ADD(NOW(),INTERVAL 1 DAY),'%Y%m%d'));
set @max_value = DATE_FORMAT(DATE_ADD(NOW(),INTERVAL 1 DAY),'%Y%m%d');
set @excutesql = CONCAT('ALTER TABLE TITLE ADD PARTITION (PARTITION ',@table_name,' VALUES LESS THAN ("',@max_value,'"))');
SELECT @excutesql;
PREPARE stmt from @excutesql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
END
Read More:
- Oracle creates a job and executes the stored procedure with parameters regularly
- [Solved] ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘
- Mysqli::stmt Fatal error: Call to a member function bind_param() on a non-object in …
- Runtime error occurred: 1843 (ORA-01843: invalid month)
- How to Solve mysql [Err] 1067-Invalid default value for
- SQL Server Deletes a table foreign key constraint Error [Solved]
- MySQL 8.0 error 1114 (HY000): the table’sbtest1’is full (Fixed)
- MYSQL Index Key Length 1071 – Specified key was too long; max key length is 3072 bytes
- [Solved] ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregate
- [Solved] ERROR 1054 (42S22): Unknown column ‘password‘ in ‘field list‘
- [Solved] Worker 1 failed executing transaction ‘ANONYMOUS‘ at master log mall-mysql-bin.000001, end_log_pos
- scm_prepare_database.sh CDH initial data script execute error
- MYSQL gruop by Error: this is incompatible with sql_mode=only_full_group_by
- [Solved] MySQL Error: ERROR 1055 (42000)sql_mode=only_full_group_by
- mysql ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- [Solved] Navicat Connect MySQL error: Authentication plugin ‘caching_sha2_password‘ cannot be loaded
- [Solved]ERROR 1067 (42000): Invalid default value for ‘end_time‘ Mysql
- [Solved] MySQL: Syntax error or access violation: 1055 Expression #1 of SELECT list is not …
- [Solved] MySQL5.6.44 [Err] 1067 – Invalid default value for create_date settlement programme
- [Solved] MySQL Error: “Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”