Strange behavior by MySQL Stored Procedure

2010-05-28 Thread Manasi Save
Dear All, I have one stored procedure Which inserts data into one table. But sometimes it does not insert record. This happens when I called it from java application. But If I called same query from mysql command line. It executes successfully. Also I have one procedure which only retrieves

mysqldump backup

2010-05-28 Thread Angelina Paul
Could you please inform me how to test the mysql databases backup failure by using the mysqldump utility. I written a unix script for sending status notification against ten mysql databases. I need to test the nine databases backups have completed successfully and one failed due some reason.

Re: mysqldump backup

2010-05-28 Thread Anand.S
redirect your standard errors to some log file.. mysqldump --all-databases --flush-logs --master-data=2 /bk01/all_databases_`date +%a`.sql 2 /tmp/test.log i follow the above syntax for logging the errors in my script. Thanks Anand On Fri, May 28, 2010 at 5:44 PM, Angelina Paul

Tab Ahead Doesn't Work As User

2010-05-28 Thread Carlos Mennens
Is it normal behavior for MySQL command type ahead not to work unless you have a database selected? I notice that using the tab 'type ahead' has no response unless I use a specific database. Is this normal behavior? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: mysqldump backup

2010-05-28 Thread Angelina Paul
I looking for a way to corrupt a mysql database forcefully for testing purpose and then the mysqldump utility will fail for taking backup against it. On Fri, May 28, 2010 at 8:06 AM, Anand.S anand@gmail.com wrote: redirect your standard errors to some log file.. mysqldump --all-databases

Re: Strange behavior by MySQL Stored Procedure

2010-05-28 Thread Mattia Merzi
2010/5/28 Manasi Save manasi.s...@artificialmachines.com: [...] Or am I doing something wrong? probably; you better send us another e-mail writing at least: - mysql version you are using - mysql Connector/J version you are using - piece of java code you are using to call the stored procedure -

Re: Strange behavior by MySQL Stored Procedure

2010-05-28 Thread Anirudh Sundar
Hello Manasi, If possible can you please send in the code that you mentioned (procedure or trigger). Please give a detailed technical explanation explaining the query which you used from command line and the query used in the procedure. Please mention the table structure, show table status and

Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Andre Matos
Hi All, I have a table that uses auto_increment to generate the Id automatically working fine. However, I need to create a new table where the Id must be a number generated randomly, so I cannot use the auto_increment. MySQL has a function RAND. So I could use something like this: SELECT

Re: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Jim Lyons
If your specs are that specific (IDs must be between 1 and 99) then you could create a 99-row table with one integer column and prefill it with the numbers 1 to 99 in random order. Then you could write a function that would select and return the first number in the table, then delete

RE: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Steven Staples
If you wanted to use/go that route, then why not select a random limit 1 from that table, and then delete that row? SELECT `column` FROM `table` ORDER BY RAND() LIMIT 1; On a side note, I would use the auto-inc field still, and store this number in another field. Steven Staples

Re: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Andre Matos
It seems to be a good approach, although I was trying to get this by querying the table without creating another table to keep the Ids. Thanks, Andre -- Andre Matos andrema...@mineirinho.org On 2010-05-28, at 12:15 PM, Steven Staples wrote: If you wanted to use/go that route, then why

RE: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Jerry Schwartz
-Original Message- From: Jim Lyons [mailto:jlyons4...@gmail.com] Sent: Friday, May 28, 2010 11:49 AM To: Andre Matos Cc: mysql@lists.mysql.com Subject: Re: Using RAND to get a unique ID that has not been used yet If your specs are that specific (IDs must be between 1 and 99) then you

RE: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Jerry Schwartz
-Original Message- From: Andre Matos [mailto:andrema...@mineirinho.org] Sent: Friday, May 28, 2010 1:44 PM To: Steven Staples Cc: mysql@lists.mysql.com Subject: Re: Using RAND to get a unique ID that has not been used yet It seems to be a good approach, although I was trying to get this

Re: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Andre Matos
When I mentioned having everything in the Query, I was thinking about this. I don't want to have a loop repeating the query until I get a unique Id. This is ridicules and imagine how many queries I might end up running. No way! Thanks for the warning and feedback! Andre -- Andre Matos

Re: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Perrin Harkins
On Fri, May 28, 2010 at 11:38 AM, Andre Matos andrema...@mineirinho.org wrote: I have a table that uses auto_increment to generate the Id automatically working fine. However, I need to create a new table where the Id must be a number generated randomly, so I cannot use the auto_increment.

Re: mysqldump backup

2010-05-28 Thread Raj Shekhar
In infinite wisdom Angelina Paul arshup...@gmail.com wrote: [1 text/plain; ISO-8859-1 (7bit)] I looking for a way to corrupt a mysql database forcefully for testing purpose and then the mysqldump utility will fail for taking backup against it. kill -9 MYSQLD_PID while the backup is running

Re: Using RAND to get a unique ID that has not been used yet

2010-05-28 Thread Kevin (Gmail)
The separate table for the IDs is probably best solution, maybe counting on caching of the table with an index on the id value to speed up the 'where' clause; this checks what numbers are left instead of what numbers have been used; the disadvantage is that you have to manage a second table

RE: mysqldump backup

2010-05-28 Thread Jerry Schwartz
-Original Message- From: Raj Shekhar [mailto:rajl...@rajshekhar.net] Sent: Friday, May 28, 2010 2:40 PM To: mysql@lists.mysql.com Cc: mysql@lists.mysql.com Subject: Re: mysqldump backup In infinite wisdom Angelina Paul arshup...@gmail.com wrote: [1 text/plain; ISO-8859-1 (7bit)] I