Changing range of identity column for future inserts

2005-11-15 Thread Dan Buettner
I would like to change one of my tables so that future inserts use a higher range of numbers for the primary key values. I have a table 'event' with column: id int unsigned not null auto_increment primary key Currently new records are going into the table with id column values in the

RE: Changing range of identity column for future inserts

2005-11-15 Thread mel list_php
, melanie From: Dan Buettner [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: Changing range of identity column for future inserts Date: Tue, 15 Nov 2005 08:50:03 -0600 I would like to change one of my tables so that future inserts use a higher range of numbers for the primary key values. I

Re: Changing range of identity column for future inserts

2005-11-15 Thread Michael Stassen
mel list_php wrote: From: Dan Buettner [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: Changing range of identity column for future inserts Date: Tue, 15 Nov 2005 08:50:03 -0600 I would like to change one of my tables so that future inserts use a higher range of numbers for the primary

RE: Changing range of identity column for future inserts

2005-11-15 Thread Dan Buettner
@lists.mysql.com Subject: Changing range of identity column for future inserts Date: Tue, 15 Nov 2005 08:50:03 -0600 I would like to change one of my tables so that future inserts use a higher range of numbers for the primary key values. I have a table 'event' with column: id int unsigned not null

Questions about last_insert_id() instead of @@IDENTITY

2005-09-07 Thread Ryan Stille
I am migrating from MS SQL Server to MySQL 4.1. I have code in my ColdFusion/SQL Server application that went something like this: cfquery name=insertquery SET NOCOUNT ON INSERT INTO TABLE () SELECT @@IDENTITY AS adid SET NOCOUNT OFF /cfquery That whole block was processed in coldfusion

Re: Questions about last_insert_id() instead of @@IDENTITY

2005-09-07 Thread Tim
On 9/7/2005 1:17 PM Ryan Stille intelligently wrote: I am migrating from MS SQL Server to MySQL 4.1. I have code in my ColdFusion/SQL Server application that went something like this: cfquery name=insertquery SET NOCOUNT ON INSERT INTO TABLE () SELECT @@IDENTITY AS adid SET NOCOUNT

RE: Questions about last_insert_id() instead of @@IDENTITY

2005-09-07 Thread Ryan Stille
it might be best to ask this in the cf forums, however did you try to separate the statements with a ; ? I haven't tried 2 query statements for MySQL in cfquery...yet ;-) Also I believe MySQL 3.23+ supports @@identity Yes I've tried semicolons after the statements, and I've tried setting

Re: Questions about last_insert_id() instead of @@IDENTITY

2005-09-07 Thread Remo Tex
that went something like this: cfquery name=insertquery SET NOCOUNT ON INSERT INTO TABLE () SELECT @@IDENTITY AS adid SET NOCOUNT OFF /cfquery That whole block was processed in coldfusion as a single query. I gave it a name of insertquery, and I can get the ID back as insertquery.adid. I am

Getting Identity after INSERT

2004-03-15 Thread Alex Curvers
Hi All Whats the preferred syntax to insert values in multiple (related) tables I insert one record, then i need the ID of the inserted value to add it the with the other inserts with MSSQL stored procs its INSERT INTO . SELECT @MyID = @@IDENTITY after

Re: Getting Identity after INSERT

2004-03-15 Thread Victoria Reznichenko
INTO . SELECT @MyID = @@IDENTITY after that you can use @MyID So whats the preferred method with MySQL, is there a easy way to get the Identity back from a just inserted record, or do i just have to do a select based on a value i did just insert ? Use AUTO_INCREMENT column

@@identity

2004-03-10 Thread Aaron
How can I select the last record that was inserted? An ASP/VB example would be great too! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: @@identity

2004-03-10 Thread Daniel Kasak
Aaron wrote: How can I select the last record that was inserted? An ASP/VB example would be great too! I believe you have it already. I use: select last_insert_id() as MyID but from memory @@identity is a synonym of last_insert_id() Dan -- sig Daniel Kasak IT Developer NUS

Re: @@identity

2004-03-10 Thread Rocar Peças
: Aaron [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 10, 2004 7:04 PM Subject: @@identity How can I select the last record that was inserted? An ASP/VB example would be great too! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe

RE: @@identity

2004-03-10 Thread Victor Pendleton
Rough example. Assuming that you are using the same connection since last_insert_id() is connection specific. rset.open INSERT INTO table1 values(someValue) rset.open SELECT last_insert_id() as identity identity = rset.fields(identity) -Original Message- From: Aaron To: [EMAIL

RE: @@identity

2004-03-10 Thread Aaron
Great - thanks! -Original Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED] Sent: March 10, 2004 5:36 PM To: 'Aaron '; '[EMAIL PROTECTED] ' Subject: RE: @@identity Rough example. Assuming that you are using the same connection since last_insert_id() is connection specific

IDENTITY column

2003-12-23 Thread Caroline Jen
Hi, I am a beginner in using database. And I appreciate your support and help. When we first create a table, 1. is it possible to create a column that identifies each record that is to be inserted? 2. If we can create this IDENTITY column, how do we create it? Do we set a maximum

Re: IDENTITY column

2003-12-23 Thread Matt Fuller
database. And I appreciate your support and help. When we first create a table, 1. is it possible to create a column that identifies each record that is to be inserted? 2. If we can create this IDENTITY column, how do we create it? Do we set a maximum to the value of this column? Or the value

@@identity

2003-06-18 Thread Jonas Geiregat
I'm using php + mysql for my project I want to get the last insert ID. I could use the php function mysql_last_id(); but I could aslo use @@identity. Now some people have advised me NOT to use @@identity, cause it's not save buggy sometimes slow .. is this true am I better of with the php

RE: @@identity

2003-06-18 Thread Carter, Scott
: Wednesday, June 18, 2003 1:37 PM To: 'Mysql' Subject: @@identity I'm using php + mysql for my project I want to get the last insert ID. I could use the php function mysql_last_id(); but I could aslo use @@identity. Now some people have advised me NOT to use @@identity, cause it's not save buggy

RE: @@identity

2003-06-18 Thread Twibell, Cory L
: Wednesday, June 18, 2003 12:59 PM To: 'Jonas Geiregat'; 'Mysql' Subject: RE: @@identity This may not be the correct solution exactly, but what I do to ensure that I get the correct ID back is the following: I know what I just inserted, therefore I can use this information in a WHERE clause to ensure

Re: @@identity

2003-06-18 Thread Eric Calvert
On Wednesday 18 June 2003 13:59, Carter, Scott wrote: This may not be the correct solution exactly, but what I do to ensure that I get the correct ID back is the following: I know what I just inserted, therefore I can use this information in a WHERE clause to ensure retrieving the correct ID.

RE: @@identity

2003-06-18 Thread Jennifer Goodie
One should always use the LAST_INSERT_ID() or after an insert, select max(id) from myTable. Select max(id) from myTable should never be used to get the last insert id. On a high traffic table you are not guaranteed it will be the ID for the record you just inserted, another could have been

Re: @@identity

2003-06-18 Thread Don Read
On 18-Jun-2003 Jonas Geiregat wrote: I'm using php + mysql for my project I want to get the last insert ID. I could use the php function mysql_last_id(); but I could aslo use @@identity. Now some people have advised me NOT to use @@identity, cause it's not save buggy sometimes slow

Re: @@identity

2003-06-18 Thread Jonas Geiregat
Don Read wrote: On 18-Jun-2003 Jonas Geiregat wrote: I'm using php + mysql for my project I want to get the last insert ID. I could use the php function mysql_last_id(); but I could aslo use @@identity. Now some people have advised me NOT to use @@identity, cause it's not save buggy sometimes

@@IDENTITY

2002-06-21 Thread Arul
Hi I m using mysql 3.23.51 on win 2k Well..I have a user table where i have the userid column as primary key and auto_increment column and name as varchar(25). I insert values in the table such as Insert into user (name) values ('AA'); Then When i do select @@Identity in the next time

Re: @@IDENTITY

2002-06-21 Thread Arul
Even the last_insert_id() returns 0 is it coz the table type is INNODB - Original Message - From: Jan Peuker [EMAIL PROTECTED] To: Arul [EMAIL PROTECTED] Sent: Friday, June 21, 2002 4:16 PM Subject: Re: @@IDENTITY You are using M$-Syntax, in MySQL you should use: SELECT

Re: @@IDENTITY

2002-06-21 Thread Tod Harter
Subject: Re: @@IDENTITY You are using M$-Syntax, in MySQL you should use: SELECT last_insert_id() http://www.mysql.com/doc/e/x/example-AUTO_INCREMENT.html regards, jan - Original Message - From: Arul To: MySQL Sent: Friday, June 21, 2002 12:17 PM Subject

FYI: @@IDENTITY

2002-05-29 Thread Richard Davidson
I don't know if this is just weirdness on my system but I thought I would pass this on in case anyone runs into this problem. I'm converting some Java/JDBC code from a commercial DBMS to MySQL. The existing code executed the SQL statement Select @@identity after an INSERT to retrieve

RE: @@IDENTITY

2002-05-29 Thread Venu
-Original Message- From: Richard Davidson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 1:31 PM To: MySql List; [EMAIL PROTECTED] Subject: FYI: @@IDENTITY I don't know if this is just weirdness on my system but I thought I would pass this on in case anyone runs