Re: TIMESTAMP field not automatically updating last_updated field

2006-03-31 Thread Ferindo Middleton Jr
Ferindo Middleton Jr wrote: Hank wrote: Are the other fields in the update statement actually changing the data? I don't know for sure, but if the data on disk is the same as the update statement, mysql won't actually update the record, and therefore might not update the last_updated

Re: TIMESTAMP field not automatically updating last_updated field

2006-03-31 Thread Ferindo Middleton Jr
Hank wrote: Are the other fields in the update statement actually changing the data? I don't know for sure, but if the data on disk is the same as the update statement, mysql won't actually update the record, and therefore might not update the last_updated field also. Just a thought. Yes, I

Re: TIMESTAMP field not automatically updating last_updated field

2006-03-30 Thread Ferindo Middleton Jr
jonathan wrote: are you having two timestamp fields in a table (ie a created and a last_updated)? -j On Mar 30, 2006, at 5:17 PM, Ferindo Middleton Jr wrote: I think I've seen this complaint posted before but I ignored but now I realize that in some of my db tables' last_updated

TIMESTAMP field not automatically updating last_updated field

2006-03-30 Thread Ferindo Middleton Jr
I think I've seen this complaint posted before but I ignored but now I realize that in some of my db tables' last_updated field the value is automatically updating on UPDATEs to records while in other tables the last_updated fields for some strange reason aren't automatically updating. I'll us

getting COUNT() TO return 0 for null matches in a query, how?

2006-02-26 Thread Ferindo Middleton Jr
I have the following query which counts the records from a table called registration that have an schedule_id that matches a record in another table called schedules. The below query works fine but how can I get it to return a COUNT() of 0 each instance where there is no record in the registr

including column name headers in OUTFILE output?

2006-02-08 Thread Ferindo Middleton Jr
If say something like the following from the mysql command line tool: SELECT * FROM dognames INTO OUTFILE 'C:/outfiles/dognames.tab'; How do I get mysql to include the column names in the file's output? Ferindo -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To un

Re: MySQL ignores foreign key relationships between tables?

2006-01-31 Thread Ferindo Middleton Jr
Paul DuBois wrote: At 20:41 -0500 1/30/06, Ferindo Middleton Jr wrote: Paul DuBois wrote: At 18:03 -0500 1/29/06, Ferindo Middleton Jr wrote: Ferindo Middleton Jr wrote: Ferindo Middleton Jr wrote: Paul DuBois wrote: At 17:56 -0500 1/28/06, Ferindo Middleton Jr wrote: I have two tables

Re: MySQL ignores foreign key relationships between tables?

2006-01-30 Thread Ferindo Middleton Jr
Paul DuBois wrote: At 18:03 -0500 1/29/06, Ferindo Middleton Jr wrote: Ferindo Middleton Jr wrote: Ferindo Middleton Jr wrote: Paul DuBois wrote: At 17:56 -0500 1/28/06, Ferindo Middleton Jr wrote: I have two tables, registration & schedules, that look like this: CREATE TABLE registra

Re: MySQL ignores foreign key relationships between tables?

2006-01-29 Thread Ferindo Middleton Jr
Ferindo Middleton Jr wrote: Ferindo Middleton Jr wrote: Paul DuBois wrote: At 17:56 -0500 1/28/06, Ferindo Middleton Jr wrote: I have two tables, registration & schedules, that look like this: CREATE TABLE registration ( idSERIAL NOT NULL UN

Re: MySQL ignores foreign key relationships between tables?

2006-01-28 Thread Ferindo Middleton Jr
Ferindo Middleton Jr wrote: Paul DuBois wrote: At 17:56 -0500 1/28/06, Ferindo Middleton Jr wrote: I have two tables, registration & schedules, that look like this: CREATE TABLE registration ( idSERIAL NOT NULL UN

Re: MySQL ignores foreign key relationships between tables?

2006-01-28 Thread Ferindo Middleton Jr
Paul DuBois wrote: At 17:56 -0500 1/28/06, Ferindo Middleton Jr wrote: I have two tables, registration & schedules, that look like this: CREATE TABLE registration ( idSERIAL NOT NULL UNIQUE, firstnameVARCHAR(256)

MySQL ignores foreign key relationships between tables?

2006-01-28 Thread Ferindo Middleton Jr
I have two tables, registration & schedules, that look like this: CREATE TABLE registration ( idSERIAL NOT NULL UNIQUE, firstnameVARCHAR(256) NOT NULL, middlenameTEXT, la

problem with using CONSTRAINT declaration

2006-01-19 Thread Ferindo Middleton Jr
I have the following table where I have a CHECK CONSTRAINT to check for logical data values but for some reason it's not working on INSERTs to the table. MySQL doesn't give any error message when I CREATE TABLE. Any ideas what I'm doing wrong?... or Is this type of declaration not supported...

Re: SETting values to TABLE field at TRIGGER runtime - FLAW IN MYSQL TRIGGER IMPLEMENTATION?

2006-01-07 Thread Ferindo Middleton Jr
Ferindo Middleton Jr wrote: Gleb Paharenko wrote: Hello. It seems that you forgot to OPEN the cursor. The trigger should be similar to this one: CREATE TRIGGER trigger_registration_and_attendance_before_insert BEFORE INSERT ON registration_and_attendance FOR EACH ROW BEGIN DECLARE

Re: SETting values to TABLE field at TRIGGER runtime

2006-01-07 Thread Ferindo Middleton Jr
Middleton Jr wrote: Is it possible to SET values on fields that involve the TABLE that invoked the TRIGGER with SET actions. I have the following lines in my trigger: delimiter // CREATE TRIGGER trigger_registration_and_attendance_before_insert BEFORE INSERT ON registration_and_attendance FOR EACH ROW

SETting values to TABLE field at TRIGGER runtime

2006-01-06 Thread Ferindo Middleton Jr
Is it possible to SET values on fields that involve the TABLE that invoked the TRIGGER with SET actions. I have the following lines in my trigger: delimiter // CREATE TRIGGER trigger_registration_and_attendance_before_insert BEFORE INSERT ON registration_and_attendance FOR EACH ROW BEGIN DECL

problem with TRIGGER, unresponsive

2006-01-02 Thread Ferindo Middleton Jr
I have these two tables: 'registration_and attendance' and 'schedules' They both share a common class_id field. I'm trying to write a Trigger which will set the class_id field for 'registration_and attendance' equal to the schedules.class_id matching the registration_and_attendance.schedule_id

Re: parse error creating table

2005-12-04 Thread Ferindo Middleton Jr
-resetting of the timestamp on updates. Is that what you want? To get auto-setting on INSERTs and UPDATEs, just write last_updated TIMESTAMP, Also the manual doesn't mention TIME WITHOUT TIME ZONE. Are you thinking of PostgreSQL? PB ----- Ferindo Middleton Jr wrote: I have been tryi

parse error creating table

2005-12-04 Thread Ferindo Middleton Jr
I have been trying to create a table but mysql 5.0.15-nt-max is having a problem parsing the statement. Anyone know what the problem is in the syntax of the following table creation statement: CREATE TABLE registration_and_attendance ( idSERIAL NOT NU

UNIQUE constraint, proper use

2005-11-21 Thread Ferindo Middleton Jr
I have this SQL statement: CREATE TABLE rooms ( idSERIAL, room_name TEXT UNIQUE, location TEXT, last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,