Thanks
ViSolve DB Team.
- Original Message -
From: "Michael Stearne" <[EMAIL PROTECTED]>
To:
Cc: "Jim Ginn" <[EMAIL PROTECTED]>
Sent: Tuesday, September 19, 2006 10:11 PM
Subject: Last Inserted ID Using LOAD DATA
I have a group of updates that need t
I have a group of updates that need to be done using LOAD DATA INFILE.
Within this file there are some INSERTS. Is there anyway that after
an INSERT happens I can use the auto-increment ID that was just
generated in the next statement. Similar to PHP's mysql_insert_id()
function.
Thanks,
Michae
On Wed, 2004-05-05 at 22:49, Paul DuBois wrote:
> At 22:39 -0400 5/5/04, Nathan Jones wrote:
> > > Hi there,
> >>
> >> I seem to be having a problem retrieving the last inserted ID for a
> >> table.
> >>
> >> The query I am using is as
> Well, you don't need the distinct.
>
> Are you inserting with your PHP script? LAST_INSERT_ID(), as per the
>
> manual,
> only returns the id from the last insert on that connect. You cannot
get >the
> LAST_INSERT_ID() for another connection.
j- k-
I used distinct because otherwise
At 22:39 -0400 5/5/04, Nathan Jones wrote:
> Hi there,
I seem to be having a problem retrieving the last inserted ID for a
table.
The query I am using is as follows:
It's far easier than anyone else has mentioned, as of my writing. Just
use the PHP function 'mysql_insert_id(
> Hi there,
>
> I seem to be having a problem retrieving the last inserted ID for a
> table.
>
> The query I am using is as follows:
>
It's far easier than anyone else has mentioned, as of my writing. Just
use the PHP function 'mysql_insert_id()' after y
At 20:34 -0500 5/5/04, Paul DuBois wrote:
At 21:11 -0400 5/5/04, Erich Beyrent wrote:
Hi there,
I seem to be having a problem retrieving the last inserted ID for a
table.
The query I am using is as follows:
mysql> select distinct LAST_INSERT_ID() as LastID from listings;
This can be simplif
At 21:11 -0400 5/5/04, Erich Beyrent wrote:
Hi there,
I seem to be having a problem retrieving the last inserted ID for a
table.
The query I am using is as follows:
mysql> select distinct LAST_INSERT_ID() as LastID from listings;
This can be simplified as SELECT LAST_INSERT_ID as LastID; no n
Erich Beyrent wrote:
Hi there,
I seem to be having a problem retrieving the last inserted ID for a
table.
The query I am using is as follows:
mysql> select distinct LAST_INSERT_ID() as LastID from listings;
++
| LastID |
++
| 3575 |
++
1 row in set (0.00
Erich Beyrent said something like:
> Hi there,
>
> I seem to be having a problem retrieving the last inserted ID for a
> table.
>
> The query I am using is as follows:
>
> mysql> select distinct LAST_INSERT_ID() as LastID from listings;
> ++
>
&g
Hi there,
I seem to be having a problem retrieving the last inserted ID for a
table.
The query I am using is as follows:
mysql> select distinct LAST_INSERT_ID() as LastID from listings;
++
| LastID |
++
| 3575 |
++
1 row in set (0.00 sec)
However, when I run this f
This will only be a problem if the two inserts are using the same mysql connection/link_indentifier.
This isn't usually the case in a web environment, unless you are using a persistent mysql connection across multiple instances of the same script.
mysql_insert_id() returns the last insert id for
At 9:33 + 2/19/04, Mark Maunder wrote:
'connection ID' below should be 'last insert id'. Sorry, it's 2am here
and I'm fresh out of coffee. BTW the information you want is here:
http://www.mysql.com/doc/en/Information_functions.html#IDX1409
"The last ID that was generated is maintained in the se
Thanks Mark...
You popped me out of great confusion/problem.
Binay
- Original Message -
From: "Mark Maunder" <[EMAIL PROTECTED]>
To: "Binay" <[EMAIL PROTECTED]>
Cc: "mysql users" <[EMAIL PROTECTED]>
Sent: Thursday, February 19, 2004 3:03
"Binay" <[EMAIL PROTECTED]> wrote:
> Hi
>
> I have a php script which insert a row in one of my table. Now i want the
> auto_generated id produced by this insert query. I know i can use mysql_insert_id
> function to fetch that auto_generated id. But my question is say two or more person
> visit
'connection ID' below should be 'last insert id'. Sorry, it's 2am here
and I'm fresh out of coffee. BTW the information you want is here:
http://www.mysql.com/doc/en/Information_functions.html#IDX1409
"The last ID that was generated is maintained in the server on a
per-connection basis. This means
The two simultaneous insert statements will be have separate connections
to the database and last_insert_id() is connection specific. So if
you're running apache, and you're worried about two different apache
child processes getting the same connection ID, don't. Because those two
children will hav
Hi
I have a php script which insert a row in one of my table. Now i want the
auto_generated id produced by this insert query. I know i can use mysql_insert_id
function to fetch that auto_generated id. But my question is say two or more person
visiting the same page/script causes a insert opera
On Fri, 9 Nov 2001, Carl Troein wrote:
> Date: Fri, 09 Nov 2001 15:41:21 GMT
> From: Carl Troein <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: Beginner question - getting last inserted ID
>
>
> Anna Åhnberg writes:
>
> > Thanks, I actually
> Anna Åhnberg writes:
>
> > Thanks, I actually already found the chapters but now I also now how to
> > use the function too!
>
> Let me quote from the manual:
> "LAST_INSERT_ID([expr])
> Returns the last automatically generated value that was
> inserted into an AUTO_INCREMENT column.
ailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 10:41 AM
To: [EMAIL PROTECTED]
Subject:Re: Beginner question - getting last inserted ID
Anna Åhnberg writes:
> Thanks, I actually already found the
Anna Åhnberg writes:
> Thanks, I actually already found the chapters but now I also now how to
> use the function too!
Let me quote from the manual:
"LAST_INSERT_ID([expr])
Returns the last automatically generated value that was
inserted into an AUTO_INCREMENT column.
mysql> select L
> The manual has all the necessary information:
> http://www.mysql.com/doc/C/R/CREATE_TABLE.html
> http://www.mysql.com/doc/e/x/example-AUTO_INCREMENT.html
>
> The unofficial FAQ has a chapter on AUTO_INCREMENT:
> http://www.bitbybit.dk/mysqlfaq/faq.html#ch6_0_0
>
> What you're looking for is prob
Anna Åhnberg writes:
> When I do an insert in one of these tables the primary key column gets a
> new ID. How do I get this ID? I guess I cannot use "SELECT MAX(id)
> FROM Table" since old, deleted id's are reused for new rows.
>
> Please, help me!
I shall help you help yourself, for from
Hello!
I am working on my first MySQL client. I have a number of tables, each
containing a AUTO_INCREMENT PRIMARY KEY column. The client is built in
Java and using a JDBC-bridge to connect to the database.
When I do an insert in one of these tables the primary key column gets a
new ID. How do I
25 matches
Mail list logo