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

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

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

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

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