Advertisements

MySql Stuff

ERROR 1170 (42000): BLOB/TEXT column ‘field_name’ used in key specification without a key length.

Use Varchar(some length under 257) and this will allow it to be a key field.

DROP TRIGGER Syntax

DROP TRIGGER [IF EXISTS] [schema_name.]trigger_name

Good PDF on creating MySql Triggers http://www.paragon-cs.com/mag/issue6.pdf

CREATE TRIGGER emplog_insert AFTER INSERT ON emp
FOR EACH ROW
INSERT INTO emplog VALUES (NEW.id, NEW.lastname, NEW.firstname, NEW.gender, NEW.dob,
NEW.marital, NEW.SSN, ‘I’, NULL, USER());

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: