Re: Default Column Value

2006-11-06 Thread Martijn Tonies
> Alternatively one could use a "TRIGGER" that updates the start_yr_mo > whenever start_date is modified but I'm unsure if triggers are present > before 5.1. Triggers are new in 5.0 Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.c

Re: Default Column Value

2006-11-05 Thread Christian Hammers
Hi On 2006-11-05 Bill Guion wrote: > In one of my tables I have a start_date - timestamp (2007-07-04). A > separate column, start_yr_mo, has 200704 (first seven characters of > timestamp without the '-'). Both are entered manually. Can I define > start_yr_mo as a default of, for example, set st

Default Column Value

2006-11-05 Thread Bill Guion
In one of my tables I have a start_date - timestamp (2007-07-04). A separate column, start_yr_mo, has 200704 (first seven characters of timestamp without the '-'). Both are entered manually. Can I define start_yr_mo as a default of, for example, set start_yr_mo = concat(substr(start_date, 1, 4)

Re: how to default column value to lower( )

2006-05-19 Thread Ferindo Middleton
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 VARCHAR(100) DEFAULT LOWER(new_column) " and then be done without having to explicitly define a trigger for it. This is for a userid field. Userid values at my

Re: how to default column value to lower( )

2006-05-19 Thread Jay Pipes
You could always use a trigger on BEFORE UPDATE/BEFORE INSERT which changes NEW.column to LOWER(column). I know it's not declarative, but it works. sheeri kritzer wrote: Not that I know of, but if you don't do binary (case-sensitive) searching then does it really matter?? You can retrieve wit

Re: how to default column value to lower( )

2006-05-19 Thread Martijn Tonies
> 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 q

Re: how to default column value to lower( )

2006-05-19 Thread sheeri kritzer
Not that I know of, but if you don't do binary (case-sensitive) searching then does it really matter?? You can retrieve with LOWER, or put it in your application, if your application needs to display it that way. -Sheeri On 5/18/06, Ferindo Middleton <[EMAIL PROTECTED]> wrote: I have column and

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

Re: MySql 5 replacement for computed default column value

2006-01-03 Thread Daniel Kasak
Harald Fuchs wrote: In article <[EMAIL PROTECTED]>, Daniel Kasak <[EMAIL PROTECTED]> writes: Bryan Cantwell wrote: Trying to migrate to MySql 5 from Sybase asa. I have a tables that have column values that are calculated based on other columns in the table. How can I accomplish the sa

Re: MySql 5 replacement for computed default column value

2006-01-03 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, Daniel Kasak <[EMAIL PROTECTED]> writes: > Bryan Cantwell wrote: >> Trying to migrate to MySql 5 from Sybase asa. I have a tables that >> have column values that are calculated based on other columns in the >> table. How can I accomplish the same in MySql? >> > Thi

Re: MySql 5 replacement for computed default column value

2006-01-02 Thread Daniel Kasak
Bryan Cantwell wrote: Trying to migrate to MySql 5 from Sybase asa. I have a tables that have column values that are calculated based on other columns in the table. How can I accomplish the same in MySql? This sounds a job for a trigger - an insert trigger. I haven't used triggers in mysql,

MySql 5 replacement for computed default column value

2006-01-02 Thread Bryan Cantwell
Trying to migrate to MySql 5 from Sybase asa. I have a tables that have column values that are calculated based on other columns in the table. How can I accomplish the same in MySql?   Here is sample of my asa table: CREATE TABLE "DBA"."OpptyDetail" (     "OpptyDetailID"  

Select a Default column Value without a DESC?

2004-06-09 Thread David Perron
Does anyone know of a way to use a SELECT statement to get the default value for a column? A DESCRIBE tabl_name col_name gives the values, but I need it inside a SELECT. Thanks. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.my