with these very strings.
Is it possible to add to the syntax of the INSERT operator appoximately
in such way:
INSERT [IGNORE] INTO ... - a general syntax
SELECT list INSERT [IGNORE] INTO ... - an added one.
UPDATE ... - a general syntax
SELECT list UPDATE - an added one.
Where can it be needed
On Jan 30, 2008 12:50 PM, Dmitry E. Oboukhov wrote:
Is it possible to add to the syntax of the INSERT operator appoximately
in such way:
SELECT list INSERT [IGNORE] INTO ... - an added one.
SELECT list UPDATE - an added one.
PS: I understand that adding the changes into a language
On Jan 30, 2008 12:50 PM, Dmitry E. Oboukhov wrote:
Is it possible to add to the syntax of the INSERT operator appoximately
in such way:
SELECT list INSERT [IGNORE] INTO ... - an added one.
SELECT list UPDATE - an added one.
PS: I understand that adding the changes
Hi William,
William Newton wrote:
Hello List,
I have this table that has a single row in it:
CREATE TABLE `quicktable` (
`x` int(11) NOT NULL auto_increment,
`quick_id` int(11) NOT NULL default '0',
PRIMARY KEY (`x`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
select *
Hello List,
I have this table that has a single row in it:
CREATE TABLE `quicktable` (
`x` int(11) NOT NULL auto_increment,
`quick_id` int(11) NOT NULL default '0',
PRIMARY KEY (`x`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
select * from quicktable;
+---+--+
| x |
Your solution is as good as any I can think of. If your source tables are
InnoDB you could wrap your SELECT/UPDATE processing in a transaction to
help make it even more robust. It might speed things up if you omit the
offset to your LIMIT clause and just do:
SELECT pkfield
FROM source_table
[EMAIL PROTECTED] wrote:
Your solution is as good as any I can think of. If your source tables
are InnoDB you could wrap your SELECT/UPDATE processing in a transaction
to help make it even more robust. It might speed things up if you omit
the offset to your LIMIT clause and just do:
Yes
Hi all,
I need to select the top 1000 records based on the usage field and update
the checked field to '1'.
I am currently doing it in 2 statements; i.e. select first then update from
a MYSQL_ROW array. How do I do it in just a single statement?
Please advice on a better way. Also...will doing
- Original Message -
From: darren [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 28, 2004 11:42 AM
Subject: select and update field in one query
Hi all,
I need to select the top 1000 records based on the usage field and
update
the checked field to '1'.
I am currently
:
Fax to:
06/28/2004 11:42 Subject: select and update field in
one query
Rhino wrote:
- Original Message -
From: darren [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 28, 2004 11:42 AM
Subject: select and update field in one query
Hi all,
I need to select the top 1000 records based on the usage field and
update
the checked field to '1'.
I am currently
Dyego Souza do Carmo writes:
How-To-Repeat:
create table teste ( id integer auto_increment unique,imagem LONGBLOB not null);
insert into teste (id) values (1);
update teste set image = (IMG OF 300K) where id = 1;
select if(imagem is null, ERRO, OK) from escriba2.teste where id = 1;
* My
How-To-Repeat:
create table teste ( id integer auto_increment unique,imagem LONGBLOB not null);
insert into teste (id) values (1);
update teste set image = (IMG OF 300K) where id = 1;
select if(imagem is null, ERRO, OK) from escriba2.teste where id = 1;
* My System is Linux 2.4.18
* Table table
it will impact you.
HTH,
Dan Cumpian
-Original Message-
From: Jeff Snoxell
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:56 PM
To: [EMAIL PROTECTED]
Subject: SELECT and UPDATE at the same time?
Hello again,
I'm selecting a group of records from my
database. I
that?
through the record set. But that doesn't sound
like it will impact you.
HTH,
Dan Cumpian
-Original Message-
From: Jeff Snoxell
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:56 PM
To: [EMAIL PROTECTED]
Subject: SELECT and UPDATE at the same time?
Hello again
Cumpian; 'Jeff Snoxell'; [EMAIL PROTECTED]
Subject: RE: SELECT and UPDATE at the same time?
At 13:23 -0500 12/19/02, [EMAIL PROTECTED] wrote:
Well, the only basis I have is personal experience from connecting to a
local
MySQL database. The components I use for connecting to MySQL with
Delphi does
cache
At 17:56 + 12/18/02, Jeff Snoxell wrote:
Hello again,
I'm selecting a group of records from my database. I then loop
through the selected records and do some work based on what I find.
But what I also want to do as I interrogate each record is update
some of its fields with new values...
Hello again,
I'm selecting a group of records from my database. I then loop through the
selected records and do some work based on what I find. But what I also
want to do as I interrogate each record is update some of its fields with
new values... but won't that screw up the outer loop? I mean
SELECT * FROM my_table WHERE Age 50 AND UPDATE Status = OLD
No. That's goofy anyway. Why wouldn't you just use a regular
UPDATE query?
UPDATE mytable Status = OLD WHERE Age 50;
Cos I want to do a fairly long-winded process on the records of those who
are Age50 and subsequently update
address : [EMAIL PROTECTED]
[EMAIL PROTECTED]
- Original Message -
From: Jeff Snoxell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 7:56 PM
Subject: SELECT and UPDATE at the same time?
Hello again,
I'm selecting
]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 18, 2002 7:56 PM
Subject: SELECT and UPDATE at the same time?
Hello again,
I'm selecting a group of records from my database. I then loop through the
selected records and do some work based on what I find. But what I also
want to do as I
:54 PM
To: [EMAIL PROTECTED]
Subject: Re: Re: SELECT and UPDATE at the same time?
SELECT * FROM my_table WHERE Age 50 AND UPDATE Status = OLD
No. That's goofy anyway. Why wouldn't you just use a regular
UPDATE query?
UPDATE mytable Status = OLD WHERE Age 50;
Cos I want to do a fairly long
-Original Message-
From: Jeff Snoxell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:56 PM
To: [EMAIL PROTECTED]
Subject: SELECT and UPDATE at the same time?
Hello again,
I'm selecting a group of records from my database. I then loop through
the
selected records and do some
that?
through the record set. But that doesn't sound like it will impact you.
HTH,
Dan Cumpian
-Original Message-
From: Jeff Snoxell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 12:56 PM
To: [EMAIL PROTECTED]
Subject: SELECT and UPDATE at the same time?
Hello again
Hi there,
I have a medium-size table (3 million rows) with several pieces of data
including an ID and a number (called id and num below). I have a program
which builds a hash in perl from a data file of the 'new' numbers for each
id, only some of which have changed (5-10%).
To update the table
At 17:00 + 3/8/02, Corin Hartland-Swann wrote:
Hi there,
I have a medium-size table (3 million rows) with several pieces of data
including an ID and a number (called id and num below). I have a program
which builds a hash in perl from a data file of the 'new' numbers for each
id, only some
* Paul DuBois
At 17:00 + 3/8/02, Corin Hartland-Swann wrote:
[...]
This works for a varying number of rows (usually 5,000 to 10,000) before
it silently exits the loop. I'm using MySQL 3.23.49a
[...]
That's also your problem. With mysql_use_result, it's *required*
that you completely
At 21:14 +0100 3/8/02, Roger Baklund wrote:
* Paul DuBois
At 17:00 + 3/8/02, Corin Hartland-Swann wrote:
[...]
This works for a varying number of rows (usually 5,000 to 10,000) before
it silently exits the loop. I'm using MySQL 3.23.49a
[...]
That's also your problem. With
Hi there,
On Fri, 8 Mar 2002, Paul DuBois wrote:
At 21:14 +0100 3/8/02, Roger Baklund wrote:
* Paul DuBois
At 17:00 + 3/8/02, Corin Hartland-Swann wrote:
[...]
This works for a varying number of rows (usually 5,000 to 10,000) before
it silently exits the loop. I'm using MySQL
Hi!
I need to SELECT some rows using a lengthy WHERE-clause and then to UPDATE these rows
just to set a flag. What is the best way to do this (performance-wise)? Being able to
do that in one single query would be great because otherwise I had to use transactions
to be sure to match _exactly_
Subject: SELECT and UPDATE in one query?
Hi!
I need to SELECT some rows using a lengthy WHERE-clause and then to UPDATE
these rows just to set a flag. What is the best way to do this
(performance-wise)? Being able to do that in one single query would be great
because otherwise I had to use
Hi,
I seem to be experiencing similair problems to what Sam Lam
reported earlier this month (Subject: tables locked during long
compound INSERT/DELETE?).
What I've observed is that when I'm issuing an UPDATE on a table
that also has SELECT queries being executed on it, everything seems
to clog
, at this moment, installing MySQL version
3.23.36. I noted that the "SELECT...FOR UPDATE"
feature has been added. What does this do and how is
it used? The online manual simply mentions that it
exists; but doesn't explain what it is or how to use
it.
Thanks,
An
33 matches
Mail list logo