Embedded MySQL Manager

2007-05-31 Thread Martin Lancaster
Hi all,

I am wondering if anyone can recommend an application that will allow me to
manage an Embedded MySQL database similar to the operation of Navicat or
EMS SQL Manager on a normal MySQL server instance?

Thanks in advance

Martin
--
--
[EMAIL PROTECTED]
--











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



Re: MySQL in multi-threaded environment

2007-05-31 Thread Geoffroy Cogniaux

Hi,
Assuming that you are using a multithread safe libmysql, I suggest you to
have a look at your error code first:
Error code 1064 suggests that you send a bad query to mysql, maybe your
pool-query isn't indeed MT safe, so manipulating this variable requires a
mutex.
Error code 1062 suggests that you try to insert duplicate key in your table:
remove this key ( bad suggestion ) or check that your pool doesn't send more
than one time the same query ( perhaps, the mutex on pool-query is enough )

Try to limit mutexes only where it's necessary and be aware where you're
locking and unlocking them.

Regards,
Geoffroy.

2007/5/30, Ace [EMAIL PROTECTED]:


Hi Friends,

I am facing problem while using MySQL in multi-threaded environment. I am
using C lang for developement.

I maintain MySQL connection pool between threads but with increase in
number
of requests, it started reporting
following errors -

==
Server Errors:
Error: 1064 :Parse error
Error: 1062 :Duplicate entry
==

Then I used mutexes around MySQL API calls and it worked. But seems use of
mutex impacts the performance, is this true?

Any other solution to this than mutex or any out-of-box solution that
might
have worked?

Thanks for your help!!!


--

Cheers,
Rajan



Re: MySQL in multi-threaded environment

2007-05-31 Thread Ace

Thanks Geoffroy! I will check this and let you know if problem persists.

--
Cheers,
Rajan
On 5/31/07, Geoffroy Cogniaux [EMAIL PROTECTED] wrote:


Hi,
Assuming that you are using a multithread safe libmysql, I suggest you to
have a look at your error code first:
Error code 1064 suggests that you send a bad query to mysql, maybe your
pool-query isn't indeed MT safe, so manipulating this variable requires a
mutex.
Error code 1062 suggests that you try to insert duplicate key in your
table: remove this key ( bad suggestion ) or check that your pool doesn't
send more than one time the same query ( perhaps, the mutex on pool-query
is enough )

Try to limit mutexes only where it's necessary and be aware where you're
locking and unlocking them.

Regards,
Geoffroy.

2007/5/30, Ace  [EMAIL PROTECTED]:

 Hi Friends,

 I am facing problem while using MySQL in multi-threaded environment. I
 am
 using C lang for developement.

 I maintain MySQL connection pool between threads but with increase in
 number
 of requests, it started reporting
 following errors -

 ==
 Server Errors:
 Error: 1064 :Parse error
 Error: 1062 :Duplicate entry
 ==

 Then I used mutexes around MySQL API calls and it worked. But seems use
 of
 mutex impacts the performance, is this true?

 Any other solution to this than mutex or any out-of-box solution that
 might
 have worked?

 Thanks for your help!!!


 --

 Cheers,
 Rajan




Populating a database

2007-05-31 Thread Officelink
Hi everyone,

I've just created the structure of a database and am deciding the best way
to insert the data. The database includes a number of tables that have
foreign keys referencing primary keys in other tables. The application I'm
building will make use of the data in one of the following ways (haven't
decided yet):

1) The data will be used in a Flash movie and will have an accompanying CMS
associated with it, or
2) The data will be used in a Flash movie but won't have a CMS

If I decide on a CMS, should I build this first and use the PHP and MySQL to
create an interface whereby I can enter the data and have the foreign keys
entered in the correct place automatically?

Or if I don't go with a CMS and just need to populate the database for use
in Flash, what's the most efficient way of doing this? I mean I'm aware I
can populate it with a .csv file but this wouldn't take care of inserting
the correct foreign key values against the appropriate records. I wouldn't
have to manually enter these foreign keys, would I?

So does the way you populate a database depend on whether you're using a CMS
or not? Have I got the right idea?

Any help much appreciated.




Re: Data types and reading in data

2007-05-31 Thread Olaf Stein
You could write a little script that loops through your lines in the csv
file, makes the changes to fields you need and insert into the database
then.
This gives you full control over the new table structure (order,types, etc)

Olaf


On 5/31/07 12:02 AM, David Scott [EMAIL PROTECTED] wrote:

 
 First of all I am very much a newbie with MySQL.
 
 I am trying to create some tables and then read in some data from a .csv
 file using load data infile 'filename.csv'
 
 The data in the .csv file has actually come from another database system.
 
 I have two problems which I haven't been able to find my way around.
 
 In many cases there are missing values for particular fields. If I declare
 that field or column to be CHAR(m) then I can read the data in using the
 load command. However in a number of cases I want the field to be INT of
 some sort. If in the create table statement I declare the column to be INT
 however, I am unable to successfully read the data in. This is curious
 because I know it was written out from the source database with an INT
 declaration.
 
 I have some dates which are in the incorrect format, as dd/mm/. Is
 there any way of having them recognised as dates?
 
 For both of these problems my intended workaround is to create a new
 column from the problem column which has the attributes I want. I am not
 sure how possible that is at this point, being very inexperienced with
 MySQL.
 
 Any advice would be most welcome, if only a pointer to the appropriate
 location in the documentation.
 
 David Scott
 
 
 
 _
 David Scott Department of Statistics, Tamaki Campus
 The University of Auckland, PB 92019
 Auckland 1142,NEW ZEALAND
 Phone: +64 9 373 7599 ext 86830  Fax: +64 9 373 7000
 Email: [EMAIL PROTECTED]
 
 Graduate Officer, Department of Statistics
 Director of Consulting, Department of Statistics
 


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



Re: help converting trigger

2007-05-31 Thread Chris Hoover

Any help on how to do this in mysql

On 5/30/07, Chris Hoover [EMAIL PROTECTED] wrote:


I have the following trigger in Postgresql, how can we do this in Mysql?

CREATE TRIGGER tr_encounter_lab_order_upd
AFTER UPDATE ON encounter_lab_order
FOR EACH ROW
EXECUTE PROCEDURE tr_encounter_lab_order_upd_trig_func();

CREATE OR REPLACE FUNCTION tr_encounter_lab_order_upd_trig_func()
  RETURNS trigger AS
$BODY$
begin
if (new.DX_CODE != old.DX_CODE or (new.DX_CODE is null and old.DX_CODEis 
not null) or (
new.DX_CODE is not null and old.DX_CODE is null)) then
update encounter_order set
dx_code = new.dx_code where
encounter_id = new.encounter_id and
order_id = new.order_id ;
end if;

return new;
end;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;


Can Mysql handle this if logic needed by this trigger, or only fire if a
specific column is updated?

Thanks,

Chris



SAN backend for DB's

2007-05-31 Thread B. Keith Murphy
So here is the brief situation.  We have a coraid (www.coraid.com) SAN 
unit - the 1520 I believe.   It is ATA-over-ethernet.


Right now we have a about 500 gigs of data spread across five servers.  
To simplify things I would like to implement the coraid on the backend 
of these servers.  Then all the data is served up out of the same 
place.  Of course I would like to improve I/O throughput also.


Googling shows that these units have good read speed but the write speed 
doesn't seem to be that impressive.


Does anyone have any experience with these?  Good? Bad?  Maybe other SAN 
suggestions?  Am I barking up the wrong tree?


Thanks,

Keith

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



Why won't this work?

2007-05-31 Thread Chris Hoover

Why does this not work?  How can I do it?

CREATE TRIGGER tr_encounter_lab_order_upd
   AFTER UPDATE ON encounter_lab_order
   FOR EACH ROW
if (  new.DX_CODE != old.DX_CODE or
( new.DX_CODE is null and old.DX_CODE is not null) or
( new.DX_CODE is not null and old.DX_CODE is null)
   ) then
   update   encounter_order
   set  dx_code = new.dx_code
   whereencounter_id = new.encounter_id and
order_id = new.order_id ;
   end if;

The error I'm getting is:
You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'update
encounter_order
   set  dx_code = new.dx_code
  ' at line 5

Chris
Mysql 5.0.41


mysqldump not consistent

2007-05-31 Thread Ben Clewett

Dear MySql,

Using 5.0.26 I am trying to get a consistent image of some tables using 
mysqldump.  This is for replication.  All my tables are InnoDB.


I am using:

# mysqldump h host \
--master-data=1 \
--single-transaction \
database

I was hoping that the '--master-data=1' would report the coordinates of 
the bin-log when the transaction was started.


But it seems to report the coordinates at the end of the dump. 
Therefore I am missing data.  My replication (most of the time) soon 
crashes with something like:


Cannot add or update a child row: a foreign key constraint fails

Of course I may be doing something wrong.

Would any person have a better idea of getting a consistent snapshot 
with correct coordinates?


Many thanks,

Ben.



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



Moving Data between Tables

2007-05-31 Thread Kebbel, John
I moved information about our school locks (serial numbers, combinations, 
student, etc) from FileMaker to MySQL into a table called lockers and wrote PHP 
pages so our teachers could record the locks returned at the end of the year. 
Unfortunately, I missed transferring close to 200 locks. 

I duplicated the structure of lockers (1313 locks) as lockers2 and reloaded all 
the information from Filemaker (1492 locks). My problem is moving the 
information from lockers to lockers2 that was added AFTER the Filemaker 
migration (2nd semester teacher, returned, paid). 

This is what I'm getting set to try, but I've never seen a JOIN in an update 
statement before. Am I on the right track for this?

UPDATE lockers2 SET lockers2.returned = lockers.returned, lockers2.teacher2nd = 
lockers.teacher2nd, lockers2.paid = lockers.paid WHERE lockers2.serialNumber = 
lockers.serialNumber;

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



mysql old 4.* query fails on 5.*

2007-05-31 Thread consiglieri

Hi

I have upgraded to  5.0.22 and after a while I discovered that the
following query no longer works.. it fails claiming  Unknown column
'K.Klient_ID' in 'on clause'  which seems entirely wrong.

The query is as follows

select Td.Datum, Td.Text AS Action, Td.Enhet AS Tid, P.Fornamn AS Person
From Klienter AS K, Tid As Td, 
Personal AS P
JOIN Uppdrag AS U ON 
K.Klient_ID = U.Klient_ID
WHERE Td.Uppdrag_ID = 101
AND U.Uppdrag_ID = Td.Uppdrag_ID
AND Td.Person = P.Personal_ID
ORDER BY Td.Datum ASC

Anyone know whats wrong here?

Thanks

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



Re: mysql old 4.* query fails on 5.*

2007-05-31 Thread Baron Schwartz

Hi,

consiglieri wrote:

Hi

I have upgraded to  5.0.22 and after a while I discovered that the
following query no longer works.. it fails claiming  Unknown column
'K.Klient_ID' in 'on clause'  which seems entirely wrong.

The query is as follows

select Td.Datum, Td.Text AS Action, Td.Enhet AS Tid, P.Fornamn AS Person
From Klienter AS K, Tid As Td, Personal AS P
JOIN Uppdrag AS U ON K.Klient_ID = U.Klient_ID
WHERE Td.Uppdrag_ID = 101
AND U.Uppdrag_ID = Td.Uppdrag_ID
AND Td.Person = P.Personal_ID
ORDER BY Td.Datum ASC



I don't see anything wrong, but I wonder what would happen if you converted everything 
to JOIN ... ON syntax instead of using comma-joins with the ON in the WHERE clause. 
Maybe it is confused by that somehow?


Baron

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



Re: Moving Data between Tables

2007-05-31 Thread Baron Schwartz

Hi John,

Kebbel, John wrote:

I moved information about our school locks (serial numbers, combinations, 
student,
etc) from FileMaker to MySQL into a table called lockers and wrote PHP pages so 
our
teachers could record the locks returned at the end of the year. Unfortunately, 
I
missed transferring close to 200 locks.

I duplicated the structure of lockers (1313 locks) as lockers2 and reloaded all 
the
information from Filemaker (1492 locks). My problem is moving the information 
from
lockers to lockers2 that was added AFTER the Filemaker migration (2nd semester
teacher, returned, paid).

This is what I'm getting set to try, but I've never seen a JOIN in an update
statement before. Am I on the right track for this?

UPDATE lockers2 SET lockers2.returned = lockers.returned, lockers2.teacher2nd =
lockers.teacher2nd, lockers2.paid = lockers.paid WHERE lockers2.serialNumber =
lockers.serialNumber;



It's not quite right.  I hope you're not about to try this for the first time on your 
production data :-)  Maybe you can grab 100 rows from each table into scratch tables 
and play with it to be sure you will get what you want.


The general syntax (with JOIN -- I can't do comma-joins) is more like

update foo
inner join bar on ...
set a = b, c = d...

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



Determining number of vowels in a string

2007-05-31 Thread Brent Baisley
I'm trying to do a select that will return the number of vowels/consonants present in a string for each record. I thought a simple 
grep was the way to go, but it appears the grep functions only tell you if a string is present. I would even settle for a grep 
replace. Just replace the vowels with nothing and determine how the string length changed.


Any ideas? I'm using v4.1.

I'd rather do it in a sql statement rather than using a scripting language.
--
Brent Baisley
Systems Specialist
CoverClicks, LLC.

Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not 
consent to email for messages of this kind. Opinions, conclusions and other information in this message that do not relate to the 
official business of CoverClicks, LLC. shall be understood as neither given nor endorsed by it.



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



RE: Moving Data between Tables

2007-05-31 Thread Kebbel, John
I hope you're not about to try this for the first time on your 
production data :-) 

I dumped the lockers table before beginning my experiments. If I had trashed 
lockers2 (my experimental file) in the process, I would have truncated it and 
re-inserted the 1492 records from my batch file.

-
It's not quite right. 

You're correct. I tried my UPDATE/implicit JOIN query shortly after posting my 
email.  I expected the query to fail, which it did. Not knowing how long it 
would be before someone responded, I went ahead and solved my problem with a 
PHP script. It was nice that the problem was solve-able with PHP, but it was 
frustrating to write 20 lines of PHP because I didn't know how to write the 1 
line of MySQL that would have solved my problem. 

-
update foo
inner join bar on ...
set a = b, c = d...

I run a backup of the database and associated PHP files every few nights and 
then carry a copy of the backup home to expand the PHP and incorporate the new 
things I learn about MySQL into my table structures or into batch files. You 
can be assured I'll be spending time with our old friends foo and bar and this 
update syntax between now and Monday.


Thanks again, Baron


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



Re: Determining number of vowels in a string

2007-05-31 Thread Barry Newton



I'd rather do it in a sql statement rather than using a scripting language.


I'm thinking you might be able to do one select, accumulating 5 
siubstring counts (a,e,i,o,u) into 5 variables, and then sum the 
counts?  I'll leave the testing to you. . .:-)



Barry Newton



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



Re: Determining number of vowels in a string

2007-05-31 Thread Brent Baisley
Yeah, I was sort of heading that route. But I would also like to determine a count of the numbers in a string too.  Certainly the 
query is doable, but it's unwieldy.


What I have so far:
SELECT fld, @FLDLEN:=char_length(fld) fld_len, 
@FLDLEN-char_length(replace(fld,'o',''))[EMAIL PROTECTED](replace(fld,'a',''))[EMAIL PROTECTED](replace(fld,'e',''))[EMAIL PROTECTED](replace(fld,'i',''))[EMAIL PROTECTED](replace(fld,'u','')) 
fld_vow_cnt FROM table


It works, but it's not the most readable query.
Thanks

- Original Message - 
From: Barry Newton [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Thursday, May 31, 2007 1:58 PM
Subject: Re: Determining number of vowels in a string





I'd rather do it in a sql statement rather than using a scripting language.


I'm thinking you might be able to do one select, accumulating 5 siubstring counts (a,e,i,o,u) into 5 variables, and then sum the 
counts?  I'll leave the testing to you. . .:-)



Barry Newton



--
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: Determining number of vowels in a string

2007-05-31 Thread Reinhardt Christiansen


- Original Message - 
From: Brent Baisley [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Thursday, May 31, 2007 1:50 PM
Subject: Determining number of vowels in a string


I'm trying to do a select that will return the number of vowels/consonants 
present in a string for each record. I thought a simple grep was the way 
to go, but it appears the grep functions only tell you if a string is 
present. I would even settle for a grep replace. Just replace the vowels 
with nothing and determine how the string length changed.


Any ideas? I'm using v4.1.

I'd rather do it in a sql statement rather than using a scripting 
language.


Is your text always in English? Recognizing vowels in other languages and 
scripts could be very difficult; for instance, I'm not sure if Japanese even 
has the _concept_ of vowels or consonants. And even in English, y is 
sometimes considered a vowel and sometimes a consonant. At least it was when 
I was in primary school way back when.


--
Rhino 



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



Re: CSV import

2007-05-31 Thread Mogens Melander
Import your CSV-data into a temporary table, using mysqlimport,
and throw a bit of SQL at it might do the trick, but then again,
not knowing the layout of your table, nor the data you want
to import, i'm only guessing.

On Mon, May 28, 2007 16:57, Sharique uddin Ahmed Farooqui wrote:
 Both PhpMyAdmin and SQLYOG doesn't support customised mapping.
 My cvs data structure is diff from mysql table. I just want to import
 values
 for one field only.
 Previously I was using Mysql Front but it crashes. Also this s/w very old
 and discontinued.
 Why mysql doesn't  implement it in MysqlAdmin?
 --
 Sharique uddin Ahmed Farooqui
 (C++/C# Developer, IT Consultant)
 A revolution is about to begin.
 A world is about to change.
 And you and me are the initiator.

 On 5/28/07, Geoffroy Cogniaux [EMAIL PROTECTED] wrote:

 Hi,
 It can be done easily with PhpMyAdmin, but it is not in .net

 2007/5/28, Sharique uddin Ahmed Farooqui [EMAIL PROTECTED]:
 
  I want to import data from a CSV file in a  table. MySql admin doesn't
  support import from CSV files.
  Format of data is different from structure of table.
 
  Is there any app/snippet   written for this task in .net , which I can
  modify according to my need.
 
  --
  Sharique uddin Ahmed Farooqui
  (C++/C# Developer, IT Consultant)
  A revolution is about to begin.
  A world is about to change.
  And you and me are the initiator.
 


 --
 This message has been scanned for viruses and
 dangerous content by OpenProtect(http://www.openprotect.com), and is
 believed to be clean.




-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224



-- 
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.


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



MySQL improvement offer. Sand-box

2007-05-31 Thread Sergey Ivanov
Hello!

It is not actually bug, but some improvement I'd like to offer.

Situation:
I have some site on a shared UNIX-hosting, so that's why I have user account 
with no FILE privilege, so I can't use LOAD DATA INFILE even if this file is in 
my home (for my site) directory. But it seems to me quite strange.

Proposition:
So, it seems to be logical, if user could have some sand-box - a directory or 
set of directories, where he can use SELECT ... INTO OUTFILE and LOAD DATA 
INFILE even if he has no FILE privilege. Possibly it can be realized as 
additional table in mysql DB. By default - no directories, for example.

May be this function is already realized or it has any principal troubles with 
realization, but I hope to recieve answer, whether this idea can be realized or 
not and can offer all needed cooperation.


Sergey Ivanov

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



Re: Determining number of vowels in a string

2007-05-31 Thread Brent Baisley

Everything is in english. But to generalize it, I'm trying to count the number 
of times certain characters appear in a string.

Using char_length instead of just length will guard against double byte characters being counted more than once when determining 
string length. But it still seems to boil down to a very easy grep statement, but a complicated SQL statement.


- Original Message - 
From: Reinhardt Christiansen [EMAIL PROTECTED]

To: Brent Baisley [EMAIL PROTECTED]; mysql@lists.mysql.com
Sent: Thursday, May 31, 2007 2:41 PM
Subject: Re: Determining number of vowels in a string




- Original Message - 
From: Brent Baisley [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Thursday, May 31, 2007 1:50 PM
Subject: Determining number of vowels in a string


I'm trying to do a select that will return the number of vowels/consonants present in a string for each record. I thought a 
simple grep was the way to go, but it appears the grep functions only tell you if a string is present. I would even settle for a 
grep replace. Just replace the vowels with nothing and determine how the string length changed.


Any ideas? I'm using v4.1.

I'd rather do it in a sql statement rather than using a scripting language.


Is your text always in English? Recognizing vowels in other languages and scripts could be very difficult; for instance, I'm not 
sure if Japanese even has the _concept_ of vowels or consonants. And even in English, y is sometimes considered a vowel and 
sometimes a consonant. At least it was when I was in primary school way back when.


--
Rhino 



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



Padding result

2007-05-31 Thread Ashley M. Kirchner


   Is there a way to automatically pad a query result?  For example:

   select id, user from table

   +-+--+
   |  id | user |
   +-+--+
   |   3 | Tinker Bell  |
   |  11 | Peter Pan|
   |   7 | Dumbo|
   | 121 | Mickey Mouse |
   +-+--+

   What I really want is:

   +---+--+
   |id | user |
   +---+--+
   | 10003 | Tinker Bell  |
   | 10011 | Peter Pan|
   | 10007 | Dumbo|
   | 10121 | Mickey Mouse |
   +---+--+


--
W | It's not a bug - it's an undocumented feature.
 +
 Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
 IT Director / SysAdmin / Websmith . 800.441.3873 x130
 Photo Craft Imaging   . 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 




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



Re: Padding result

2007-05-31 Thread Baron Schwartz

Hi,

Ashley M. Kirchner wrote:


   Is there a way to automatically pad a query result?  For example:

   select id, user from table

   +-+--+
   |  id | user |
   +-+--+
   |   3 | Tinker Bell  |
   |  11 | Peter Pan|
   |   7 | Dumbo|
   | 121 | Mickey Mouse |
   +-+--+

   What I really want is:

   +---+--+
   |id | user |
   +---+--+
   | 10003 | Tinker Bell  |
   | 10011 | Peter Pan|
   | 10007 | Dumbo|
   | 10121 | Mickey Mouse |
   +---+--+




Sure.  select 1 + id as id, user from table.  There is also an 
LPAD() function.


Baron

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



Re: Padding result

2007-05-31 Thread Baron Schwartz

Ashley M. Kirchner wrote:


   Is there a way to automatically pad a query result?  For example:

   select id, user from table

   +-+--+
   |  id | user |
   +-+--+
   |   3 | Tinker Bell  |
   |  11 | Peter Pan|
   |   7 | Dumbo|
   | 121 | Mickey Mouse |
   +-+--+

   What I really want is:

   +---+--+
   |id | user |
   +---+--+
   | 10003 | Tinker Bell  |
   | 10011 | Peter Pan|
   | 10007 | Dumbo|
   | 10121 | Mickey Mouse |
   +---+--+


Ah, and I also just remembered, there is a ZEROFILL attribute for 
numeric types.  Details at 
http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html


Baron

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



Re: SAN backend for DB's

2007-05-31 Thread Scott Tanner
  I think you'll need to do a lot of testing to yourself to find the
right answer to that. The number of disks, type of disks, and raid
configuration will have the most effect on performance.

  Personally, we had roughly 15% increase in performance from ditching
our EMC clarion and going with external scsi arrays for each server. For
us it was cost driven - 8 scsi disks (in raid 10 config) and the arrays
were cheaper then 4 fiber disks. The extra heads and less latency made a
noticeable difference - our database has a really high write rate.

Regards,
Scott   


On Thu, 2007-05-31 at 09:15 -0400, B. Keith Murphy wrote:
 So here is the brief situation.  We have a coraid (www.coraid.com) SAN 
 unit - the 1520 I believe.   It is ATA-over-ethernet.
 
 Right now we have a about 500 gigs of data spread across five servers.  
 To simplify things I would like to implement the coraid on the backend 
 of these servers.  Then all the data is served up out of the same 
 place.  Of course I would like to improve I/O throughput also.
 
 Googling shows that these units have good read speed but the write speed 
 doesn't seem to be that impressive.
 
 Does anyone have any experience with these?  Good? Bad?  Maybe other SAN 
 suggestions?  Am I barking up the wrong tree?
 
 Thanks,
 
 Keith
 


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



Re: Padding result

2007-05-31 Thread Mogens Melander
How about: SELECT LPAD(id,5,'1'),user from table;

LPAD(str,len,padstr)

Returns the string str, left-padded with the string padstr to a length of
len characters. If str is longer than len, the return value is shortened
to len characters.

mysql SELECT LPAD('hi',4,'??');
- '??hi'
mysql SELECT LPAD('hi',1,'??');
- 'h'


On Fri, June 1, 2007 02:06, Ashley M. Kirchner wrote:

 Is there a way to automatically pad a query result?  For example:

 select id, user from table

 +-+--+
 |  id | user |
 +-+--+
 |   3 | Tinker Bell  |
 |  11 | Peter Pan|
 |   7 | Dumbo|
 | 121 | Mickey Mouse |
 +-+--+

 What I really want is:

 +---+--+
 |id | user |
 +---+--+
 | 10003 | Tinker Bell  |
 | 10011 | Peter Pan|
 | 10007 | Dumbo|
 | 10121 | Mickey Mouse |
 +---+--+


 --
 W | It's not a bug - it's an undocumented feature.
   +
   Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
   IT Director / SysAdmin / Websmith . 800.441.3873 x130
   Photo Craft Imaging   . 3550 Arapahoe Ave. #6
   http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



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


 --
 This message has been scanned for viruses and
 dangerous content by OpenProtect(http://www.openprotect.com), and is
 believed to be clean.



-- 
Later

Mogens Melander
+45 40 85 71 38
+66 870 133 224



-- 
This message has been scanned for viruses and
dangerous content by OpenProtect(http://www.openprotect.com), and is
believed to be clean.


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