MySQL Triggers: How do you abort an INSERT, UPDATE or DELETE with a trigger?
CREATE TRIGGER mytable_trigger_example BEFORE INSERT FOR EACH ROW BEGIN IF(NEW.important_value) < (fancy * dancy * calculation) THEN DECLARE dummy INT; SELECT Your meaningful error message goes here...
View ArticleProtected: create a database,primary key, foreign key
This post is password protected. You must visit the website and enter the password to continue reading.
View ArticleProtected: Create a backup:Upload from a backup:input file;output file;update
This post is password protected. You must visit the website and enter the password to continue reading.
View ArticleCOLUMN TYPES
COLUMN TYPES (UPDATED: October 10, 2011) TEXT CHAR( ) A fixed section from 0 to 255 characters long. VARCHAR( ) A variable section from 0 to 255 characters...
View ArticleSimple Definitions
EXPLANATION OF COMMANDS/CLAUSES USED WITH ‘SELECT’ STATEMENTS % Wildcard AS Allows you to name the displayed column. Select f_name,...
View ArticleProtected: LABs and quiz
This post is password protected. You must visit the website and enter the password to continue reading.
View ArticleIgnore foreign key constraints during the load operation
If you want to ignore foreign key constraints during the load operation, you can issue a SET foreign_key_checks = 0 statement before executing...
View ArticleMySQL Load data infile ERROR 1261 (01000)
在 MySQL 中使用 load data infile 命令导入数据文件到 MySQL 数据库中的时候, 如果遇到 MySQL 错误:“ERROR 1261 (01000)” ,则很可能是由于数据文件中的列数跟 MySQL 数据表字段数目没有完全匹配,并且 sql_mode 设为 strict 模式的缘故。 要想在这种情况下继续导入数据到 MySQL 表中,则需要设置 MySQL sql_mode...
View Article