Re: not allowing empty strings

2008-03-24 Thread Ferindo Middleton
at an empty string is equal in value to a NULL value. Ferindo On Sat, Mar 22, 2008 at 8:20 PM, Rob Wultsch <[EMAIL PROTECTED]> wrote: > On Sat, Mar 22, 2008 at 5:03 PM, Ferindo Middleton > <[EMAIL PROTECTED]> wrote: > > Is there a way to not allow empty strings in the datab

not allowing empty strings

2008-03-22 Thread Ferindo Middleton
Is there a way to not allow empty strings in the database for a data type. I have a column set to not null but sometimes users enter empty strings which are also unacceptable. How can I force MySQL to disallow empty strings in addition to not null. Ferindo

finding duplicate key

2008-02-11 Thread Ferindo Middleton
I have a table (customers) without a primary key. I want to make the email_address field the primary key, only problem is, several records already share the same email_address How do I write a query which will show me all the instances where email_address is duplicated throughout the table. -- Fe

Re: How do you allow external computers to access server instance?

2007-06-21 Thread Ferindo Middleton
ostname} is not allowed to connect to this MySQL server" Ferindo On 6/21/07, Baron Schwartz <[EMAIL PROTECTED]> wrote: Hi, Ferindo Middleton wrote: > I've installed MySQL5 on a machine running Windows XP. I'm not an advanced > user so I chose all the default config

How do you allow external computers to access server instance?

2007-06-21 Thread Ferindo Middleton
he command line client and MySQL Query Browser. However, if I try to access the server instance from another computer on my LAN via MySQL Query Browser, I get a message saying the connection is refused How do I configure the server to allow incoming connections from other computers on my netwo

loop through SELECT statement query results in a Trigger

2006-10-27 Thread Ferindo Middleton
Is there a way to loop through individual query records within a stored procedure or trigger. If I have table called client_names (id SERIAL, first name TEXT, middlename TEXT, lastname TEXT, suffix TEXT, pet_id INT, properly_trained TEXT) and I have a trigger on it, I'd like to iterate through ind

Re: help with update query

2006-10-16 Thread Ferindo Middleton
r table. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: Ferindo Middleton [mailto:[EMAIL PROTECTED] > Sent: Saturday, October 14, 2006 9:16 PM > To: Dan Buettner > Cc: my

Re: change format of date fields during LOAD DATA INFILE?

2006-10-16 Thread Ferindo Middleton
6 / FAX: 860.674.8341 > -Original Message- > From: Ferindo Middleton [mailto:[EMAIL PROTECTED] ] > Sent: Saturday, October 14, 2006 9:40 PM > To: mysql > Subject: change format of date fields during LOAD DATA INFILE? > > Is there a way to change the format of date field

change format of date fields during LOAD DATA INFILE?

2006-10-14 Thread Ferindo Middleton
Is there a way to change the format of date fields MySQL is expecting when LOADing data from a file? I have no problem with the format MySQL saves the date but most spreadsheet programs I use don't make it easy to export text files with date fields in the format -MM-DD even if I formated the f

Re: help with update query

2006-10-14 Thread Ferindo Middleton
e this is not very efficient, since a LOT of update queries will be generated, and also that if one person has more than one email address (a typo perhaps) you will lose all but one address for them. But it should work, and it's pretty easy. HTH, Dan On 10/13/06, Ferindo Middleton < [EM

help with update query

2006-10-13 Thread Ferindo Middleton
I have a table, bowler_score_records, with the following columns: id, firstname, middlename, lastname, race, religion, email_address, bowling_score, gamedate As records get entered to this table, sometimes the users forget to input the email_address but the users always capture the full name, r

Re: multiple primary keys on one table?

2006-10-05 Thread Ferindo Middleton
eld and make it NULL instead. just ferindo On 10/5/06, Dan Buettner <[EMAIL PROTECTED]> wrote: Ferindo, you can create multiple UNIQUE indexes on a table to enforce your data requirements. http://dev.mysql.com/doc/refman/5.0/en/alter-table.html Dan On 10/5/06, Ferindo Middleton <[EMAIL

multiple primary keys on one table?

2006-10-05 Thread Ferindo Middleton
I have a primary key set on a table which consists of the combination of the values: firstname, lastname, and a schedule_id (BIGINT(20))... I have this so the records in this table do not have duplicates, being that no one record should have the exact same name and schedule_id identifier. However

unexpected trigger behavior on BEFORE UPDATE trigger using NEW. and OLD. column values

2006-08-04 Thread Ferindo Middleton
I have two databases that effect each other when triggers get excecuted. There is a schedules database that updates registration database. The problem I have is with the enrolled, attended, waitlisted, completed, cancelled, etc. booleans values. The registration db has triggers on it that enforce

unexpected trigger behavior on trigger

2006-08-02 Thread Ferindo Middleton
I have two databases that effect each other when triggers get excecuted. There is a schedules database that updates registration database. The problem I have is with the enrolled, attended, waitlisted, completed, cancelled, etc. booleans values. The registration db has triggers on it that enforce

Re: error loading data from file > ERROR 1329 (02000): No data - zero rows fetched, selected, or processed

2006-06-27 Thread Ferindo Middleton
t 5.5/ webapps/utrad/docs/rebuild_scratch_area/test.tab' INTO TABLE reggie FIELDS TERMINATED BY "\t" LINES TERMINATED BY "\r\n"; Hope this helps Dan Ferindo Middleton wrote: > Does MySQL have any constraints when it comes to the number columns that it > can accur

Re: error loading data from file > ERROR 1329 (02000): No data - zero rows fetched, selected, or processed

2006-06-26 Thread Ferindo Middleton
threshold of the db so instead of giving a meaningful messgae, it just says: ERROR 1329 (02000): No data - zero rows fetched, selected, or processed Ferindo On 6/23/06, Ferindo Middleton <[EMAIL PROTECTED]> wrote: I guess my general reason for posting this was to ask: "Are there any

Re: error loading data from file > ERROR 1329 (02000): No data - zero rows fetched, selected, or processed

2006-06-23 Thread Ferindo Middleton
n't load?... why MySQL says: ERROR 1329 (02000): No data - zero rows fetched, selected, or processed Ferindo On 6/23/06, Gerald L. Clark <[EMAIL PROTECTED]> wrote: Ferindo Middleton wrote: > I'm trying to load data into a table from a file but I get an error > message: >

error loading data from file > ERROR 1329 (02000): No data - zero rows fetched, selected, or processed

2006-06-23 Thread Ferindo Middleton
I'm trying to load data into a table from a file but I get an error message: ERROR 1329 (02000): No data - zero rows fetched, selected, or processed This error message isn't very specific as to what is going wrong and I have no idea what it is about the data file that is wrong. Of course, I know

Re: how to default ... DATE column to another column date field, without using a trigger?

2006-05-19 Thread Ferindo Middleton
_date DATE DEFAULT start_date " It would be cool if you could do that. Ferindo On 5/19/06, Ferindo Middleton <[EMAIL PROTECTED]> wrote: Thanks Jay. Yeah, I'll just write a trigger... It sure would be cool though if you could say something like..." ADD COLUMN new_column

Re: how to default column value to lower( )

2006-05-19 Thread Ferindo Middleton
display it > that way. > > -Sheeri > > On 5/18/06, Ferindo Middleton <[EMAIL PROTECTED]> wrote: >> I have column and I want to make sure the db is always making sure the >> value >> that gets input into this VARCHAR() column is always lowercase; >> >&

how to default column value to lower( )

2006-05-18 Thread Ferindo Middleton
I have column and I want to make sure the db is always making sure the value that gets input into this VARCHAR() column is always lowercase; Is there a way to set the value of a column within a table to automatically be lowercase. I know how to use the LOWER() function when performing queries but

how to extract common text string from field?

2006-05-12 Thread Ferindo Middleton
Suppose you have a field in a db table that holds email addresses and all of the address end in domain.com. Is there a MySQL function that can be used to extract the first part of the email address, the username (the part of the email address before the 'domain.com' part of the email address). I

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
schedule_class_id_cursor CURSOR FOR SELECT class_id FROM schedules WHERE schedules.id = new.schedule_id; OPEN schedule_class_id_cursor; FETCH schedule_class_id_cursor INTO schedule_class_id; SET new.class_id = schedule_class_id; CLOSE schedule_class_id_cursor ; END; Ferindo

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
ity so I'm sorry if I irritate anyone by posting to the wrong group. Thanks. Ferindo Middleton -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]