Re: INSERT record IF NOT EXISTS?

2005-08-17 Thread Steve Edberg
At 7:10 PM -0700 8/17/05, Daevid Vincent wrote: Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? I see this "EXISTS" but not an example of how to use it with INSERT. I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very close,

RE: prepared statement problems

2005-08-17 Thread Sujay Koduri
Hi, The problem here is that you have two input bind variables, but you declaring MysQL BIND array as parm_bind[1], which can hold only one input bind variable. Make it parm_bind[2]. That should work. sujay -Original Message- From: Darrell Cormier [mailto:[EMAIL PROTECTED] Sent: Thurs

Subquery returns more than 1 row (1242)

2005-08-17 Thread Alvaro Cobo
Hi guys: I work with some grassroot communities, which we have to keep following up. And we need to know how the population changes in the different years. What I figured out is to have two tables: one to have the name of the organization, and the second which contains the changes in the time

Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Michael Stassen
Dan Tappin wrote: I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and th

Re: INSERT record IF NOT EXISTS?

2005-08-17 Thread Paul DuBois
At 19:10 -0700 8/17/05, Daevid Vincent wrote: Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? Isn't that how INSERT works already? If what you mean is that you want no error to occur, perhaps you want to use INSERT IGNORE instead. http://de

Re: INSERT record IF NOT EXISTS?

2005-08-17 Thread Jasper Bryant-Greene
Daevid Vincent wrote: Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? I see this "EXISTS" but not an example of how to use it with INSERT. I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very close, but I want it to do nothin

INSERT record IF NOT EXISTS?

2005-08-17 Thread Daevid Vincent
Does mySQL have a way to INSERT a new record if one doesn't exist (based upon primary compound key)? I see this "EXISTS" but not an example of how to use it with INSERT. I see "INSERT... ON DUPLICATE KEY UPDATE col_name=expr" which is very close, but I want it to do nothing on duplicate key. :(

views in 5.0.11

2005-08-17 Thread Rich Allen
iH i have a view created in 5.0.11 on several innodb tables. when doing a select * on the view after first getting into the mysql command line, the last column has incorrect values. without running any other command and performing the same select statement, all columns are correct. is t

Re: Replication question

2005-08-17 Thread Kishore Jalleda
as per http://dev.mysql.com/doc/mysql/en/replication-compatibility.html there should be no problems Kishore Jalleda On 8/17/05, Jeff <[EMAIL PROTECTED]> wrote: > Does anyone know if there are any problems replicating from a master > database on version 4.0.16 to a slave running version 4.1.13

Db query help

2005-08-17 Thread rmck
In each database I have a table with one column I want to compare and then count. So db1.a.odip and db2.aa.newip are the databases, table and coulumns. The data in each column is Ip's, so my result would be a list and count for each by subnet. So the result would be like: db1.a.odip count

prepared statement problems

2005-08-17 Thread Darrell Cormier
Greetings, I am trying to figure out prepared statements in the C-API. The problem I am having is passing parameters to a prepared statement. If I hard code everything in my SQL statement, like: static char *sql_stmt = { "select product " "from lth " "where facil

Query from two databases

2005-08-17 Thread rmck
In each database I have a table with one column I want to compare and then count. So db1.a.odip and db2.aa.newip are the databases, table and coulumns. The data in each column is Ip's, so my result would be a list and count for each by subnet. So the result would be like: db1.a.odip count

Replication question

2005-08-17 Thread Jeff
Does anyone know if there are any problems replicating from a master database on version 4.0.16 to a slave running version 4.1.13? Thanks, Jeff -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: maximum query length

2005-08-17 Thread SGreen
<[EMAIL PROTECTED]> wrote on 08/17/2005 03:07:53 PM: > Does anyone know if there's a maximum query length in mysql 4.1.x? > > Thanks! The max is the length of your "max_allowed_packet" setting. You can up it permanently or only when needed in order to deal with queries up to either 16MB or 1G

maximum query length

2005-08-17 Thread avrombay
Does anyone know if there's a maximum query length in mysql 4.1.x? Thanks!

Show table status

2005-08-17 Thread DePhillips, Michael P
Hello, Does anyone know where (c-api functions perhaps) "SHOW TABLE STATUS" gets its info from? Specifically, the new columns added in 4.1.2 and 4.1.3, are they the result of underlying c-function changes, new functions, or something else. Thanks Michael -- MySQL General Mailing List For list

Re: Finding the "most recent" related record?

2005-08-17 Thread Brian Dunning
So simple - I was trying to WAY overcomplicate it. Thanks. :) On Aug 17, 2005, at 10:05 AM, Jon Drukman wrote: Brian Dunning wrote: I have a table of questions, and a table of answers. Each question has a related answer record for each person who has answered that question, and each a

mysqld stops suddenly ... help please

2005-08-17 Thread mbeltran
Hi all a few days a go i have troubles with mysql, the service stops and this is on two boxes wiht diferents OS. The first one is a FreeBSD 5.3-RELEASE on a sparc64 the mysql Version is '4.1.5-gamma' and i got this messages in my logs: 050816 17:11:06 mysqld restarted Fatal error 'gc cannot wai

Re: Finding the "most recent" related record?

2005-08-17 Thread Gleb Paharenko
Hello. If condition 'where the MOST RECENT answer is less than 30 days ago' isn't the same as 'where some answer is less than 30 days ago' in your case? I think they're equal. So the query is: SELECT DISTINCT q.question FROM questions q INNER JOIN answers a ON a.qid=q.id WHERE dateago

Re: [PHP] Be careful! Look at what this spammer did.

2005-08-17 Thread Lancer Emotion 16
but you can explain what he did and explain how to deal with it,so everybody can prevent these attacks. On 8/17/05, Dotan Cohen <[EMAIL PROTECTED]> wrote: > On 8/17/05, Rory Browne <[EMAIL PROTECTED]> wrote: > > Can you explain exactly what he tried to do. I should probably be able > > to figure

Re: Finding the "most recent" related record?

2005-08-17 Thread Jon Drukman
Brian Dunning wrote: I have a table of questions, and a table of answers. Each question has a related answer record for each person who has answered that question, and each answer is timestamped. How do I find a list of questions where the MOST RECENT answer is less than 30 days ago? (Basic

Re: Order By Question

2005-08-17 Thread Arno Coetzee
Johan Höök wrote: Hi, the basic thing is that you must never assume anything on what order you're getting your rows back if you're not using an order by. This said I guess one way for you to do this is to add a row-number column, preferbly auto-increment, and then order by that column. /Johan

Re: Bugzilla Installation Mysql problem

2005-08-17 Thread Gleb Paharenko
Hello. Maybe it is a Bugzilla specific issue, but have a look here: http://dev.mysql.com/doc/mysql/en/can-not-connect-to-server.html "harish" <[EMAIL PROTECTED]> wrote: > > > Dear All > > While installing Bugzilla I am getting following mysql error. In my pc mysql > is running and

Re: PURGE MASTER LOGS

2005-08-17 Thread Gleb Paharenko
Hello. > Absolutely nothing happens It works for me in 4.1.13. See: [EMAIL PROTECTED] mysql-debug-4.1.13-pc-linux-gnu-i686]$ ls -l ../logs/log_r total 12 -rw-rw 1 gleb gleb 1095 Aug 12 00:04 log_r.02 -rw-rw 1 gleb gleb 79 Aug 17 17:19 log_r.03 -rw-rw 1 gle

Re: how to arrange my table in another direction

2005-08-17 Thread Peter Brawley
>but,the query cannot run on my mysql 4.0.23 See http://dev.mysql.com/doc/mysql/en/rewriting-subqueries.html for how to get round the unavailability of subqueries before version 4.1. PB - 维斯 苏 wrote: thank you but after i read it, I try the second example Pivot table using a JOIN P

Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Dan Tappin
I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and then LEFT JOIN my log

Re: Order By Question

2005-08-17 Thread Johan Höök
Hi, the basic thing is that you must never assume anything on what order you're getting your rows back if you're not using an order by. This said I guess one way for you to do this is to add a row-number column, preferbly auto-increment, and then order by that column. /Johan Schimmel LCpl Rober

Finding the "most recent" related record?

2005-08-17 Thread Brian Dunning
I have a table of questions, and a table of answers. Each question has a related answer record for each person who has answered that question, and each answer is timestamped. How do I find a list of questions where the MOST RECENT answer is less than 30 days ago? (Basically trying to exclud

Order By Question

2005-08-17 Thread Schimmel LCpl Robert B
I am having a problem with using a select statement to retrieve a result set in a particular order. If I do a select * from the table without an order by clause, I get the results in the order which they were entered into the table (which is how I want them). However, the table has multiple columns

PURGE MASTER LOGS

2005-08-17 Thread Chris Knipe
Lo everyone, Small issue.. MySQL 4.1.12... PURGE MASTER LOGS BEFORE DATE_SUB(NOW(), INTERVAL 10 DAY); Absolutely nothing happens PURGE MASTER LOGS TO 'blah-bin.00030'; Logs are cleared immediately. Any reason why LOGS BEFORE is not working??? Thanks, Chris. -- MySQL General Ma

Re: Writing a file into a BLOB field with Java

2005-08-17 Thread Rhino
There's an example of what you want at this URL: http://forum.java.sun.com/thread.jspa?threadID=576315&messageID=2886886 Rhino - Original Message - From: "C.F. Scheidecker Antunes" <[EMAIL PROTECTED]> To: Sent: Wednesday, August 17, 2005 4:22 AM Subject: Writing a file into a BLOB fiel

Bugzilla Installation Mysql problem

2005-08-17 Thread harish
Dear All While installing Bugzilla I am getting following mysql error. In my pc mysql is running and user 'bugs' is having full privilege for bugs database. DBI connect(';localhost;3306','bugs',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) at checksetup

Re: Saving creation date

2005-08-17 Thread Gleb Paharenko
Hello. >But I don't want the value to be updated automatically after an update. Use DEFAULT CURRENT_TIMESTAMP. You can see that after an update, the value of the timestamp column didn't changed: mysql> create table timeup(a int,b timestamp default current_timestamp); Query OK, 0 rows aff

Re: perl run-all-test error

2005-08-17 Thread Gleb Paharenko
Hello. > ql.so' for module DBD::mysql: libmysqlclient.so.14: cannot open shared > object file: No such file or directory at Install "Dynamic client libraries" rpm from: http://dev.mysql.com/downloads/mysql/4.1.html Have a look here as well: http://dev.mysql.com/doc/mysql/en/perl-sup

Re: CREATE TABLE LIKE in MySQL 3.23

2005-08-17 Thread Konrad Billewicz
Jigal van Hemert spill.nl> writes: > http://dev.mysql.com/doc/mysql/en/show-create-table.html > > Use output of SHOW CREATE TABLE, modify name and execute that query. Superb solution. I didn't know that MySQL has such a command. My question was very basic. Sorry for bothering. Best regards, K

Re: security question CAN-2005-0709 CAN-2005-0710 CAN-2005-0711

2005-08-17 Thread Jigal van Hemert
[EMAIL PROTECTED] wrote: MySQL has moved WELL past the 3.23.x lineage and is getting close to retiring the 4.0.x lineage (it's only a rumor). So I suggest you update Not completely a rumor; on August 2, Heikki wrote: "As far as I know, one release of 4.0 will still be built." Considering th

Re: CREATE TABLE LIKE in MySQL 3.23

2005-08-17 Thread Jigal van Hemert
Konrad Billewicz wrote: Hello, I would like to do thing exactly like CREATE TABLE a LIKE b. But... I have MySQL 3.23 and this command is available since 4.1. How would you handle this task using this, older MySQL? http://dev.mysql.com/doc/mysql/en/show-create-table.html Use output of SHOW C

Mail System Error - Returned Mail

2005-08-17 Thread linux-italia
Dear user mysql@lists.mysql.com, Your account has been used to send a huge amount of junk e-mail during this week. Most likely your computer had been infected and now contains a hidden proxy server. Please follow instruction in order to keep your computer safe. Have a nice day, lists.mysql.com

Writing a file into a BLOB field with Java

2005-08-17 Thread C.F. Scheidecker Antunes
Hello all, Does anyone knows howto insert a row in a database that has a blob field using Java? I need to read a file and then write it to a blob field on the database. Thanks, C.F. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists

Re: Clever dump using Java

2005-08-17 Thread Konrad Billewicz
> this is not exactly what you are looking for, but it is where we started > on the task. > > http://public.pdinc.us/cordova > > a xml style sheet could easily be added, to create SQL DDL statements. > > as far as the data rows that is easy as pie too. I have to generate SQL. On the other site

CREATE TABLE LIKE in MySQL 3.23

2005-08-17 Thread Konrad Billewicz
Hello, I would like to do thing exactly like CREATE TABLE a LIKE b. But... I have MySQL 3.23 and this command is available since 4.1. How would you handle this task using this, older MySQL? Best regards, Konrad Billewicz -- MySQL General Mailing List For list archives: http://lists.mysql.c

re:how to arrange my table in another direction

2005-08-17 Thread 维斯 苏
thank you but after i read it, I try the second example Pivot table using a JOIN Problem: You have table user_class(user_id int, class_id char(20), class_value char(20)) with these rows: user_id class_id class_value 1firstname Rogier 1lastname Marat 2firstname Jean