Re: DATETIME vs CHAR for "timestamp"

2017-04-24 Thread SSC_perl
> On Apr 14, 2017, at 1:07 PM, shawn l.green wrote: > > That all depends. Do you... Hi Shawn, I thought I had replied to your response, but it looks like I didn’t. Thank you for your email. It was a thorough response and the links were very helpful, as

Re: DATETIME vs CHAR for "timestamp"

2017-04-14 Thread shawn l.green
On 4/14/2017 3:11 PM, SSC_perl wrote: I have creation date/time fields in my script that are formatted as |MM|DD|hh|mm|ss. Short of changing the script, should I set the field type in MySQL to DATETIME, or would it be better in terms of speed and efficiency to set it as char(19

DATETIME vs CHAR for "timestamp"

2017-04-14 Thread SSC_perl
I have creation date/time fields in my script that are formatted as |MM|DD|hh|mm|ss. Short of changing the script, should I set the field type in MySQL to DATETIME, or would it be better in terms of speed and efficiency to set it as char(19)? Or would it not make a difference

Re: Storage of UTF-8 char in MySQL

2010-08-16 Thread Werner Van Belle
Ryan Chan wrote: According to this document: http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html It said MySQL support UTF-8 using one to three bytes per character. But I have created a test table: -- create table test ( c char(5) ) default charset =utf8; From the table status

Re: Storage of UTF-8 char in MySQL

2010-08-16 Thread Joerg Bruehe
Ryan,, all: Ryan Chan wrote: According to this document: http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html It said MySQL support UTF-8 using one to three bytes per character. But I have created a test table: -- create table test ( c char(5) ) default charset =utf8; From

Storage of UTF-8 char in MySQL

2010-08-14 Thread Ryan Chan
According to this document: http://dev.mysql.com/doc/refman/5.0/en/charset-unicode.html It said MySQL support UTF-8 using one to three bytes per character. But I have created a test table: -- create table test ( c char(5) ) default charset =utf8; From the table status, the data length is alway

How to specify CHAR column to accept specific characters

2009-06-18 Thread hezjing
Hi I'm using MySQL 5.1. How do we create a constraint on char column to accept only character 'A' - 'Z'? Thank you! -- Hez

Re: How to specify CHAR column to accept specific characters

2009-06-18 Thread Martijn Tonies
Hi, I'm using MySQL 5.1. How do we create a constraint on char column to accept only character 'A' - 'Z'? MySQL doesn't have CHECK constraints, I think the only way to do this is via a BEFORE INSERT trigger. With regards, Martijn Tonies Upscene Productions http://www.upscene.com

RE: How to specify CHAR column to accept specific characters

2009-06-18 Thread Jerry Schwartz
-Original Message- From: hezjing [mailto:hezj...@gmail.com] Sent: Thursday, June 18, 2009 5:04 AM To: mysql@lists.mysql.com Subject: How to specify CHAR column to accept specific characters Hi I'm using MySQL 5.1. How do we create a constraint on char column to accept only character

MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Ilia KATZ
Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider changing it to CHAR(12)? Replies will be appreciated. Ilia

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Fish Kungfu
Since MAC addreses also contain letters, BIGINT wouldn't work. So, yes, I would say go with CHAR(12). On May 14, 2009 9:43 AM, Ilia KATZ ik...@dane-elec.co.il wrote: Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider changing

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread kabel
On Thursday 14 May 2009 09:53:58 am Fish Kungfu wrote: Since MAC addreses also contain letters, BIGINT wouldn't work. So, yes, I would say go with CHAR(12). On May 14, 2009 9:43 AM, Ilia KATZ ik...@dane-elec.co.il wrote: Hi. Currently I have a table: 1. MAC address defined as BIGINT 2

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Jerry Schwartz
. -Original Message- From: Ilia KATZ [mailto:ik...@dane-elec.co.il] Sent: Thursday, May 14, 2009 9:26 AM To: mysql@lists.mysql.com Subject: MAC address as primary key - BIGINT or CHAR(12) Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Ilia KATZ
6th byte the last 2 bytes (of the BIGINT) left unused. Ilia From: Fish Kungfu [mailto:fish.kun...@gmail.com] Sent: Thursday, May 14, 2009 3:54 PM To: Ilia KATZ Cc: mysql@lists.mysql.com Subject: Re: MAC address as primary key - BIGINT or CHAR(12

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Thomas Spahni
On Thu, 14 May 2009, Ilia KATZ wrote: Hi. Currently I have a table: 1. MAC address defined as BIGINT 2. MAC address set as primary key Should I consider changing it to CHAR(12)? Replies will be appreciated. Ilia Hi It depends. You may convert the MAC address to a decimal integer and store

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Jim Lyons
Definitely CHAR (or VARCHAR). If the format of a MAC address changes at all, you could be in real trouble. Also, if a MAC address can have a leading 0 (I don't know anything about MAC addresses), then storing it as some sort of number could lose that. This is a general rule for me. A field

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Pete Wilson
, from someone with experience. -- Pete Wilson http://www.pwilson.net/ --- On Thu, 5/14/09, Jim Lyons jlyons4...@gmail.com wrote: From: Jim Lyons jlyons4...@gmail.com Subject: Re: MAC address as primary key - BIGINT or CHAR(12) To: Ilia KATZ ik...@dane-elec.co.il Cc: mysql@lists.mysql.com

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Jim Lyons
Wilson http://www.pwilson.net/ --- On Thu, 5/14/09, Jim Lyons jlyons4...@gmail.com wrote: From: Jim Lyons jlyons4...@gmail.com Subject: Re: MAC address as primary key - BIGINT or CHAR(12) To: Ilia KATZ ik...@dane-elec.co.il Cc: mysql@lists.mysql.com Date: Thursday, May 14, 2009, 11

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Pete Wilson
I agree, and didn't mean to say that I disagreed. This is certainly one of the top five principles to follow, imo. Too many times, while trouble-shooting, I've run up on the rock of a binary (meaning: indecipherable) field. What is the cost of including the binary representation (for indexing)

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Daevid Vincent
Store as CHAR(12), not VARCHAR because they are ALWAYS a fixed length. It saves space and is faster to index/lookup. If you're using IPv4 only then stick with CHAR(12). elseif you think you'll go to IPv6 then if large dataset ( 1M rows say), plan for it now

RE: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Gavin Towey
A MAC address is just a number, it doesn't contain letters unless you're doing something silly like storing the HEX representation of it. Do not use CHAR! This does DOUBLE for all of you storing IP addresses! Since a MAC address is going to be between 48 and 64 bits, then BIGINT

Re: MAC address as primary key - BIGINT or CHAR(12)

2009-05-14 Thread Gavin Towey
I've run up on the rock of a binary (meaning: indecipherable) field. SELECT hex(some_binary_field) FROM table; Solved. The information contained in this transmission may contain privileged and confidential information. It is intended only for the use of

Re: Group by function and avg on char

2008-03-29 Thread Peter Brawley
trying to solve without success. Given the following table CREATE TABLE `scores` ( `proj` char(3) NOT NULL default '', `id` int(11) NOT NULL default '0', `score` double default NULL, `cpid` char(32) default NULL, `team` char(20) default NULL, PRIMARY KEY (`proj`,`id`), KEY `cpid

Group by function and avg on char

2008-03-27 Thread Phil
Hi all, got a simple problem I'm trying to solve without success. Given the following table CREATE TABLE `scores` ( `proj` char(3) NOT NULL default '', `id` int(11) NOT NULL default '0', `score` double default NULL, `cpid` char(32) default NULL, `team` char(20) default NULL, PRIMARY

How to count # of occurrences of a char in a string?

2007-12-12 Thread mos
I have a Char(50) column and I want to count the number of . in the column using a Select statement. I don't see any MySQL function that can count the number of occurrences of a character in a string. Is there a simple way to do this? TIA Mike -- MySQL General Mailing List For list archives

Re: How to count # of occurrences of a char in a string?

2007-12-12 Thread Baron Schwartz
Hi, On Dec 12, 2007 5:39 PM, mos [EMAIL PROTECTED] wrote: I have a Char(50) column and I want to count the number of . in the column using a Select statement. I don't see any MySQL function that can count the number of occurrences of a character in a string. Is there a simple way to do

Re: How to count # of occurrences of a char in a string?

2007-12-12 Thread mos
At 04:52 PM 12/12/2007, Baron Schwartz wrote: Hi, On Dec 12, 2007 5:39 PM, mos [EMAIL PROTECTED] wrote: I have a Char(50) column and I want to count the number of . in the column using a Select statement. I don't see any MySQL function that can count the number of occurrences of a character

Query to find less than 3 char string

2007-09-20 Thread Scott Mulder
Just wondering if anyone out there may have a workaround to being stuck on a shared server with the default string matching set to more than 3 chars. I know that Navicat searches for 3 and under chars on my catalog when it's connected and that offered me some form of hope. On top of that I'm

RE: Query to find less than 3 char string

2007-09-20 Thread Jerry Schwartz
-Original Message- From: Scott Mulder [mailto:[EMAIL PROTECTED] Sent: Thursday, September 20, 2007 2:21 PM To: mysql@lists.mysql.com Subject: Query to find less than 3 char string Just wondering if anyone out there may have a workaround to being stuck on a shared server

Re: Partial char key not used in conjuction with inequality comparison (MySQL5)

2007-04-30 Thread Joerg Bruehe
Hi Thomas, all! Thomas van Gulick wrote: [[...]] Test: EXPLAIN SELECT * FROM t WHERE T=x; Result: key T used EXPLAIN SELECT * FROM t WHERE T!=x; Result: key T _unused_ To be expected: An unequal condition will evaluate to true for a very large proportion of the index entries, so the

Partial char key not used in conjuction with inequality comparison (MySQL5)

2007-04-28 Thread Thomas van Gulick
Hello list! I've noticed in MySQL 5.0 partial keys on character fields aren't always used. In 4.1 they were. They seem not to be used when using inequality comparison. I'm not sure whether this is a bug or intended (in the latter case I have to work around it to get the speed I got with 4.1

char vs. varchar

2007-02-28 Thread Alexander Lind
Hi all Which of these two tables wiil yield the best performance in a table with about 6 million entries (for rapid selects on either field): table_using_char field1 char(50), field2 char(50), filed 3 char(50), separate unique indexes on all 3 fields table_using_varchar field1 varchar(50

Re: Removing space characters ... char(160)? ... char(194)?

2007-02-13 Thread Amer Neely
Hi all. I'm trying to weed out garbage that comes from copying and pasting stuff from a web page. Some of the data has spaces, but a *different* kind of space ... a char(160) kind ... I think ... I figured this out by copying the space character and pasting it into mysql thus: select

RE: Removing space characters ... char(160)? ... char(194)?

2007-02-13 Thread Jerry Schwartz
Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: Amer Neely [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 13, 2007 3:53 AM To: mysql@lists.mysql.com Subject: Re: Removing space characters ... char(160)? ... char(194)? Hi all

Removing space characters ... char(160)? ... char(194)?

2007-01-22 Thread Daniel Kasak
Hi all. I'm trying to weed out garbage that comes from copying and pasting stuff from a web page. Some of the data has spaces, but a *different* kind of space ... a char(160) kind ... I think ... I figured this out by copying the space character and pasting it into mysql thus: select

FW: varchar vs char - update statement

2006-10-30 Thread Julien Chavanton
I have a database with several tables that can have up to 100 000 rows there is ~100 updates every seconds and ~100 select query on the same table using locks. The update is always on the same field a varchar(15), I believe it will be recommended to change it to char(15) to improve performance

varchar vs char - update statement

2006-10-26 Thread Julien Chavanton
I have a database with several tables that can have up to 100 000 rows there is ~100 updates every seconds and ~100 select query on the same table with locks. The update is always on the same field a varchar(15), I believe it will be recommended to change it to char(15) to improve performance

Counting char in a column

2006-10-10 Thread Scott Hamm
I'm running MySQL 5.0.15 on Windows system. How do I count how many specific char is there in a column, for example finding 'c' in lowercase string of Characteristics would total to 3. -- `Twas brillig, and the slithy toves

Re: Counting char in a column

2006-10-10 Thread Visolve DB Team
PM Subject: Counting char in a column I'm running MySQL 5.0.15 on Windows system. How do I count how many specific char is there in a column, for example finding 'c' in lowercase string of Characteristics would total to 3

special char in full-text search

2006-07-06 Thread Harini Raghavan
then it searches for M, B, and A sepearately. I can't include the quotes for all search strings as wild char(*) search would not work when specified within a phrase. Is there a way to avoid MySQL from tokenizing the search criteria? Any ideas? Thanks, Harini -- MySQL General Mailing List

Re: special char in full-text search

2006-07-06 Thread Brent Baisley
programming language. Hope that gives you some ideas. - Original Message - From: Harini Raghavan [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, July 06, 2006 2:06 AM Subject: special char in full-text search Hi All, I am using the MySQL full text search capability

char(17) vs. char(18)

2006-06-01 Thread Gaspar Bakos
Hi, Do you think there is any difference in the speed of select() statements done on a big table depending on whether one of the columns of this table is defined as char(17) or char(18)? That is, will the select speed depend on the parity of the number of chars? More generally, are char(2^n

apostrophe char problem

2006-03-02 Thread Halid Faith
Hello I use mysql 4.1.16 and php4.3.10 and phpmyadmin2.7 and apache-2.0.53 on FreeBSD5.3 I add any text as data with phpadmin on web. it works well. But I have a problem. As example if I add a text to mysql table with phpadmin. My text contains as below; Halid 's car is expensive I will see

Re: apostrophe char problem

2006-03-02 Thread sprock
Something is double escaping the strings. Check if GPC magic string is enabled (apache's auto escaping). Also check if your code manually escapes the strings. Halid Faith wrote: Hello I use mysql 4.1.16 and php4.3.10 and phpmyadmin2.7 and apache-2.0.53 on FreeBSD5.3 I add any text as data

RE: apostrophe char problem

2006-03-02 Thread George Law
- From: Halid Faith [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 11:51 AM To: mysql@lists.mysql.com Subject: apostrophe char problem Hello I use mysql 4.1.16 and php4.3.10 and phpmyadmin2.7 and apache-2.0.53 on FreeBSD5.3 I add any text as data with phpadmin on web

Re: convert varchar/char to integer

2006-01-20 Thread morten bjoernsvik
morten bjoernsvik [EMAIL PROTECTED] skrev: Hi Gents Is it possible to sort char/varchars that only contains integers as integers and not as characters. I can't use integer because the standard says it may contain characters aswell. Currently I do this outside mysql in a perl-procedure

convert varchar/char to integer

2006-01-20 Thread morten bjoernsvik
Hi Gents Is it possible to sort char/varchars that only contains integers as integers and not as characters. I can't use integer because the standard says it may contain characters aswell. Currently I do this outside mysql in a perl-procedure. Whatever I try I get this order

CHAR vs TEXT and fast Row Updates

2006-01-17 Thread Karl Pielorz
Hi All, We have an application that needs to update rows in the database 'as fast and efficiently' as possible. To this end, we've tried re-designing the table - can someone clarify the following assumptions we're about to make? 1. Fixed length CHAR fields are quicker to update than

Re: CHAR vs TEXT and fast Row Updates

2006-01-17 Thread Pooly
Hi, 2006/1/17, Karl Pielorz [EMAIL PROTECTED]: Hi All, 1. Fixed length CHAR fields are quicker to update than VARCHAR fields (because the field size is constant) There is no advantage if not all your field in your table are fixed size. as soon as you add a text/blob column, you loose

CHAR() or NCHAR(1) in MySQL 5.0.18 for Wondows

2006-01-11 Thread V.Khodakov
Hello. MySQL 5.0.18 for Wondows. CREATE TABLE test (CHAR(1)). Not assigned 0x80 - 0xFF for CHAR(). When use: mysql_stmt_prepare(), mysql_stmt_bind_param(), mysql_stmt_execute(). For NCHAR()successfully assigned0x80 - 0xFF. Successfully executed: INSERT INTO test (h) VALUES(CHAR(128

char() or nchar() in mysql 5.0.18

2006-01-09 Thread V.Khodakov
Hello. MySQL 5.0.18 Not assigned 0x80 - 0xFF for CHAR(). When use: mysql_stmt_prepare(), mysql_stmt_bind_param(), mysql_stmt_execute(). For NCHAR()successfully assigned0x00 - 0xFF. Successfully executed: INSERT INTO test (h) VALUES(CHAR(128)) Vladimir Khodakov. -- MySQL General Mailing

Re: IN(INT VS CHAR)

2005-12-10 Thread Gleb Paharenko
Hello. In my humble opinion, the design of the database should not depend on operators which you're going to use in your queries. Yes, using INTs in the IN clause (that means the the column type is INT as well, isn't it?) should be a bit faster, because operations with strings are in

IN(INT VS CHAR)

2005-12-09 Thread Test USER
When using IN should i design the database to use int's or is the performance equal? WHERE col IN('test','test2','test3') vs WHERE col IN(1,2,3) - FREE E-MAIL IN 1 MINUTE! - [EMAIL PROTECTED] - http://www.pc.nu -- MySQL General Mailing List

Re: varchar vs char speed improvement

2005-09-28 Thread Martijn van den Burg
On Tuesday 27 September 2005 11:59, Pooly wrote: 2005/9/27, Ow Mun Heng [EMAIL PROTECTED]: Is there any doc looking at benchmarks of a database which is populated entirely with fixed length char compared to variable character lengths? I know using char is preferred over varchar when

Re: varchar vs char speed improvement

2005-09-27 Thread Pooly
2005/9/27, Ow Mun Heng [EMAIL PROTECTED]: Is there any doc looking at benchmarks of a database which is populated entirely with fixed length char compared to variable character lengths? I know using char is preferred over varchar when it comes to speed. Is there any available benchmarks

varchar vs char speed improvement

2005-09-26 Thread Ow Mun Heng
Is there any doc looking at benchmarks of a database which is populated entirely with fixed length char compared to variable character lengths? I know using char is preferred over varchar when it comes to speed. Is there any available benchmarks available? Pointers where would be appreciated

Re: convert varchar to char

2005-08-16 Thread Jon Drukman
Pooly wrote: Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR

convert varchar to char

2005-08-13 Thread Pooly
Hi, I try to convert a varchar to a char, but it doesn't seems to work. show create table sessions; CREATE TABLE `sessions` ( `id` varchar(32) NOT NULL default '', `user_id` int(6) NOT NULL default '0', `ip` varchar(8) NOT NULL default '0', `lastseen` timestamp NOT NULL default

Re: convert varchar to char

2005-08-13 Thread Roger Baklund
Pooly wrote: Hi, I try to convert a varchar to a char, but it doesn't seems to work. From the manual: ...all CHAR columns longer than three characters are changed to VARCHAR columns. URL: http://dev.mysql.com/doc/mysql/en/silent-column-changes.html -- Roger -- MySQL General Mailing

Re: convert varchar to char

2005-08-13 Thread Pooly
Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer

Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 04:01:38PM +0100, Pooly wrote: ALTER TABLE sessions MODIFY ip char(8) NOT NULL DEFAULT '0'; ALTER TABLE sessions MODIFY id char(32) NOT NULL DEFAULT ''; Hello, Since you have two varchar columns, I don't think there's any way to convert them both to char without

Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 05:37:56PM +0100, Pooly wrote: Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : [snip] Bah, should have waited another 5 minutes before I bothered posting my last long-winded ramble ;) ALTER TABLE sessions MODIFY id char(32

Re: convert varchar to char

2005-08-13 Thread Pooly
these things. But it's a bit more subtle : [snip] Bah, should have waited another 5 minutes before I bothered posting my last long-winded ramble ;) ALTER TABLE sessions MODIFY id char(32) NOT NULL DEFAULT '', MODIFY ip char(8) NOT NULL DEFAULT '0'; Cool, I didn't know you could do this though

Re: default collation char

2005-08-04 Thread Philippe Poelvoorde
Enrique Sanchez Vela wrote: Hello Folks, I would like to have MySQL differentiate between 'abc' and 'ABC' both the server and clients. so far anything I've done has not worked. Is altering the column type an option ? If yes, you would change any 'text' for 'blob' and any 'varchar' for

Re: default collation char

2005-08-04 Thread Jigal van Hemert
Philippe Poelvoorde wrote: Enrique Sanchez Vela wrote: I would like to have MySQL differentiate between 'abc' and 'ABC' both the server and clients. so far anything I've done has not worked. Is altering the column type an option ? If yes, you would change any 'text' for 'blob' and any

default collation char

2005-08-03 Thread Enrique Sanchez Vela
Hello Folks, I would like to have MySQL differentiate between 'abc' and 'ABC' both the server and clients. so far anything I've done has not worked. when I defined the database it was using the latin1_swedish_ci Collation, now I have issued the alter database COLLATE to use latin1_bin one,

char(x) showing up as varchar(x)...

2005-05-28 Thread Philip George
when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50) DEFAULT NULL, lastname varchar(50) DEFAULT NULL ); ...and then use describe to show what i've got: mysql describe person

Re: char(x) showing up as varchar(x)...

2005-05-28 Thread Paul DuBois
http://dev.mysql.com/doc/mysql/en/silent-column-changes.html At 21:29 -0500 5/28/05, Philip George wrote: when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50) DEFAULT NULL, lastname varchar(50) DEFAULT NULL ); ...and then use

Re: char(x) showing up as varchar(x)...

2005-05-28 Thread Philip George
thanks. - philip On May 28, 2005, at 10:08 PM, Paul DuBois wrote: http://dev.mysql.com/doc/mysql/en/silent-column-changes.html At 21:29 -0500 5/28/05, Philip George wrote: when i create a table with: CREATE TABLE person ( id char(36) NOT NULL PRIMARY KEY, firstname varchar(50

char field length get 2 times in GB2312

2005-04-08 Thread Shuming Wang
Hi, After SET CHARACTER SET GB2312 , create table a1 (b1 char(6)) charset=gb2312, the char field width in 2 times. select * from a1 123456 12 Should be 123456 server : win98/linux mysql4.1.11 client : windows ,bcc55,libmysql.dll Regards Shuming

Re: field varchar and char truncate the ended blank characters

2005-03-01 Thread Gleb Paharenko
table pippo ( codice int, messaggio varchar(20), a char(20)); insert into pippo values( 1, abc , 123 ); insert into pippo values( 2, middle , MIDDLE ); select codice, messaggio, length(messaggio), a, length(a) from pippo; 1 abc 3 123

R: field varchar and char truncate the ended blank characters

2005-03-01 Thread AESYS S.p.A. [Enzo Arlati]
, if possible, for a different solution. Other ideas ? -Messaggio originale- Da: Gleb Paharenko [mailto:[EMAIL PROTECTED] Inviato: lunedì 28 febbraio 2005 14.41 A: mysql@lists.mysql.com Oggetto: Re: field varchar and char truncate the ended blank characters Hello. Use TEXT or BLOB columns

Re: field varchar and char truncate the ended blank characters

2005-03-01 Thread Martijn Tonies
Hello, Using TEXT or BLOB prevent me to display the string in a dbgrid, the real data is replaced by a text like (MEMO). I can use somethinh like select substring( msg, 1,100 ) from mytable to bypass the problem but is no the clean solution I looking for. I thank for your hints but I'm

field varchar and char truncate the ended blank characters

2005-02-28 Thread AESYS S.p.A. [Enzo Arlati]
for example if I have a table like the one belowe and insert some field with blank characters at the end , like abc or middle , when I read thei field I get abc and middle. create table pippo ( codice int, messaggio varchar(20), a char(20)); insert into pippo values( 1, abc , 123 ); insert

Is this by design - compare CHAR BINARY with CHAR

2005-01-13 Thread Jens Schreiber
Hello, I'm using 4.1.8-standard on linux and get this: CREATE TABLE test (field1 CHAR(20) BINARY NOT NULL, field2 CHAR(20) NOT NULL) TYPE=MyISAM; INSERT INTO test VALUES('xxx','yyy') SELECT * FROM test WHERE field1=field2 ERROR 1267 (HY000): Illegal mix of collations (latin1_bin,IMPLICIT

Re: Is this by design - compare CHAR BINARY with CHAR

2005-01-13 Thread Gleb Paharenko
Hello. Use CAST(). See: http://dev.mysql.com/doc/mysql/en/Charset-CAST.html Jens Schreiber [EMAIL PROTECTED] wrote: Hello, I'm using 4.1.8-standard on linux and get this: CREATE TABLE test (field1 CHAR(20) BINARY NOT NULL, field2 CHAR(20) NOT NULL) TYPE=MyISAM

Re: Char to Varchar on Innodb

2004-10-21 Thread Heikki Tuuri
Gary, - Alkuperäinen viesti - Lähettäjä: Gary Richardson [EMAIL PROTECTED] Vastaanottaja: Heikki Tuuri [EMAIL PROTECTED] Kopio: [EMAIL PROTECTED] Lähetetty: Thursday, October 21, 2004 4:49 AM Aihe: Re: Char to Varchar on Innodb I'm not too worried about it myself, but I can see how

Re: Char to Varchar on Innodb

2004-10-20 Thread Heikki Tuuri
Gary, those 'silent column specification changes' affect all table types. That feature has caused lots of user questions over years. It is in the TODO to remove that feature from MySQL, because it is not standards compliant. In InnoDB, a reason to use a CHAR column in some cases is to reduce

Re: Char to Varchar on Innodb

2004-10-20 Thread Gary Richardson
the CHAR fields need to be left-packed? For example, you'd still get fragmentation if your columns went CHAR, VARCHAR, CHAR. I guess that is unless the engine underneath did this automagically. Thanks. On Wed, 20 Oct 2004 11:29:30 +0300, Heikki Tuuri [EMAIL PROTECTED] wrote: Gary, those 'silent

Char to Varchar on Innodb

2004-10-19 Thread Gary Richardson
Hey, From http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html: snip If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than three

Re: Why VARCHAR TO CHAR automatically when the length less than 4.

2004-08-24 Thread Martijn Tonies
I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html In addition to that - it doesn't really matter as the CHAR datatype isn't properly implemented in MySQL and behaves the same

Re: Why VARCHAR TO CHAR automatically when the length less than 4.

2004-08-23 Thread Egor Egorov
Emi Lu [EMAIL PROTECTED] wrote: I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored

Re: Why VARCHAR TO CHAR automatically when the length less than 4.

2004-08-23 Thread Martijn Tonies
I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html In addition to that - it doesn't really matter as the CHAR datatype isn't properly implemented in MySQL and behaves the same as the VARCHAR

Re: Why VARCHAR TO CHAR automatically when the length less than 4.

2004-08-23 Thread Joseph Cochran
On Mon, 23 Aug 2004 15:25:21 +0200, Martijn Tonies [EMAIL PROTECTED] wrote: I have a questions about varchar columns change to CHAR columns automatically. See http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html In addition to that - it doesn't really matter as the CHAR

Why VARCHAR TO CHAR automatically when the length less than 4.

2004-08-16 Thread Emi Lu
Hello all, I have a questions about varchar columns change to CHAR columns automatically. When I designed a table t1 create table t1(id varchar(3) not null) in MySQL. After that, we use desc t1 to see the description of table t1. The result is the following

RE: Why VARCHAR TO CHAR automatically when the length less th an 4.

2004-08-16 Thread Victor Pendleton
This is described here: http://dev.mysql.com/doc/mysql/en/Silent_column_changes.html. The table is created as a fixed table format. -Original Message- From: Emi Lu To: [EMAIL PROTECTED] Sent: 8/16/04 3:20 PM Subject: Why VARCHAR TO CHAR automatically when the length less than 4. Hello

Using foreign char sets

2004-08-10 Thread Kevin Reeder
Hi, My native tongue is english but I'm learning finnish and want to create a database using my new language. Swe7 will apparently cover the few characters I need which aren't part of the latin1 set. So I've restarted the server with the option, --default-character-set=swe7 What I think I need

storing international char, like (Arabic, Russian) on mysql

2004-08-03 Thread Louie Miranda
Is it possible to store foreign language characters like arabic, russian, etc on mysql? when a user send out data via the web? where should i start? -- Louie Miranda http://www.axishift.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: storing international char, like (Arabic, Russian) on mysql

2004-08-03 Thread Louie Miranda
thank you very much On Tue, 3 Aug 2004 20:08:51 -0500 (CDT), [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I have made apresentation at MySQLs UC2004 about using Japanese character sets with MySQL. You may find this a good starting point. Links are below:

all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Aaron Wolski
Hey guys, I have a column in a table called 'first'. Currently all records are upper case. Is it possible for me to do a select statement that makes all chars after the first char lower case? Example: Current: AARON After: Aaron I think this is possible.. just don't know how to execute

Re: all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Wesley Furgiuele
statement that makes all chars after the first char lower case? Example: Current: AARON After: Aaron I think this is possible.. just don't know how to execute the functions together to make it happen. Thanks! Aaron -- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

RE: all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Aaron Wolski
Furgiuele [mailto:[EMAIL PROTECTED] Sent: July 13, 2004 1:10 PM To: Aaron Wolski Cc: [EMAIL PROTECTED] Subject: Re: all upper case records.. Keeping first char upper and rest lower? SELECT CONCAT( UPPER( LEFT( first, 1 ) ), LOWER( RIGHT( first, LENGTH( first ) - 1 ) ) ) AS `first` FROM

Re: all upper case records.. Keeping first char upper and rest lower?

2004-07-13 Thread Michael Kruckenberg
statement that makes all chars after the first char lower case? Example: Current: AARON After: Aaron I think this is possible.. just don't know how to execute the functions together to make it happen. Thanks! Aaron -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Datatype question - Whether int(11) or char(11) ?

2004-07-05 Thread Ying Lu
Hello all, I have a datatype question. When there is column named ID, users are able to give it either char(11) or int(11). Please advise, which type is better such as more secure, save space, etc? Or it dose not matter at all? Kind regards, Ying -- MySQL General Mailing List For list archives

Re: Datatype question - Whether int(11) or char(11) ?

2004-07-05 Thread John Hicks
On Monday 05 July 2004 12:54 pm, Ying Lu wrote: Hello all, I have a datatype question. When there is column named ID, users are able to give it either char(11) or int(11). Please advise, which type is better such as more secure, save space, etc? Or it dose not matter at all? It depends

Re: making lower case then first char to upper case?

2004-07-02 Thread Thomas Spahni
On Wed, 30 Jun 2004, Aaron Wolski wrote: Hi Guys, I'm trying to figure out of this is possible. I know I could do it in PHP but I am dealing with a ton of records and would rather put the processing on the DB than PHP/client side. Question is. can I do a SELECT query on a column that

making lower case then first char to upper case?

2004-06-30 Thread Aaron Wolski
Hi Guys, I'm trying to figure out of this is possible. I know I could do it in PHP but I am dealing with a ton of records and would rather put the processing on the DB than PHP/client side. Question is. can I do a SELECT query on a column that changes all the results to lower case and THEN

Re: making lower case then first char to upper case?

2004-06-30 Thread Wesley Furgiuele
Someone else hopefully has something more efficient: UPDATE table SET field = CONCAT( UPPER( LEFT( field, 1 ) ), LOWER( SUBSTRING( field, 2 ) ) ) Wes On Jun 30, 2004, at 12:46 PM, Aaron Wolski wrote: Hi Guys, I'm trying to figure out of this is possible. I know I could do it in PHP but I am

AW: making lower case then first char to upper case?

2004-06-30 Thread Freddie Sorensen
. Juni 2004 18:46 An: [EMAIL PROTECTED] Betreff: making lower case then first char to upper case? Hi Guys, I'm trying to figure out of this is possible. I know I could do it in PHP but I am dealing with a ton of records and would rather put the processing on the DB than PHP/client side

Re: SELECT DISTINCT returns an incorrect result with special char acters

2004-04-29 Thread Paul DuBois
At 23:28 +0200 4/28/04, Jochem van Dieten wrote: Ricardo wrote: Which collation are you using in MS SQL Server? And in MySQL? MS SQL Server 8 Collation = Latin1_General_CI_AS MySQL 4.0.16 character_set = latin1 The charset determines which characters can occur. The collation determines the sort

  1   2   3   4   >