RE: Field property question!

2005-05-11 Thread Matt Babineau
Yes I do enjoy every day in which the manual makes my life easier. I guess I
didn't work my question specifically enough however. I was actually looking
for a way to 'ALTER' the table so that my State field data is always upper.
In MSSQL you can apply a function to a field, which will then run that
function over the data each time something new gets added. For instance you
could put in Now() in the default, and the default date would appear if you
added a row That's the idea.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 10, 2005 10:58 AM
To: Matt Babineau; mysql@lists.mysql.com
Subject: RE: Field property question!

[snip]
Can I setup a table so that no matter how data is entered into it (web
form,
command line) The data in one of the columns ALWAYS gets converted to
uppercase? I remeber MSSQL had this feature of being able to apply a
function to a field in its configuration.
[/snip]

The manual, it is amazing no?

http://dev.mysql.com/doc/mysql/en/string-functions.html 

UPPER()

INSERT INTO `table` (`colFoo`)
VALUES (UPPER('myData'));

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Field property question!

2005-05-11 Thread Jay Blanchard
[snip]
Yes I do enjoy every day in which the manual makes my life easier. I
guess I
didn't work my question specifically enough however. I was actually
looking
for a way to 'ALTER' the table so that my State field data is always
upper.
In MSSQL you can apply a function to a field, which will then run that
function over the data each time something new gets added. For instance
you
could put in Now() in the default, and the default date would appear if
you
added a row That's the idea.
[/snip]

As stated before you would need a trigger. IIRC triggers will be
available in 5.n

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Field property question!

2005-05-10 Thread Matt Babineau
Can I setup a table so that no matter how data is entered into it (web form,
command line) The data in one of the columns ALWAYS gets converted to
uppercase? I remeber MSSQL had this feature of being able to apply a
function to a field in its configuration.

 

Thanks!

Matt



RE: Field property question!

2005-05-10 Thread Jay Blanchard
[snip]
Can I setup a table so that no matter how data is entered into it (web
form,
command line) The data in one of the columns ALWAYS gets converted to
uppercase? I remeber MSSQL had this feature of being able to apply a
function to a field in its configuration.
[/snip]

The manual, it is amazing no?

http://dev.mysql.com/doc/mysql/en/string-functions.html 

UPPER()

INSERT INTO `table` (`colFoo`)
VALUES (UPPER('myData'));

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Field property question!

2005-05-10 Thread Eric Bergen
I think matt is thinking more automagically like having upper() called 
on a column on insert for him instead of putting it into every query. 
You can't do this yet. sorry.

-Eric
Jay Blanchard wrote:
[snip]
Can I setup a table so that no matter how data is entered into it (web
form,
command line) The data in one of the columns ALWAYS gets converted to
uppercase? I remeber MSSQL had this feature of being able to apply a
function to a field in its configuration.
[/snip]
The manual, it is amazing no?
http://dev.mysql.com/doc/mysql/en/string-functions.html 

UPPER()
INSERT INTO `table` (`colFoo`)
VALUES (UPPER('myData'));
 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Field property question!

2005-05-10 Thread Jay Blanchard
[snip]
I think matt is thinking more automagically like having upper() called 
on a column on insert for him instead of putting it into every query. 
You can't do this yet. sorry.
[/snip]

Aha, I see. Needs a trigger or stored procedure.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]