Re: Accessing last_insert_id problem.

2003-01-02 Thread Matthew Smith
, Jeff Snoxell wrote: Date: Wed, 18 Dec 2002 12:21:14 + From: Jeff Snoxell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Accessing last_insert_id problem. Hi, I'm adding records to a db using the Perl DBI. Subsequent to adding a record I need to know the value of the auto

RE: Accessing last_insert_id problem.

2002-12-20 Thread Will Merrell
Jeff Snoxell wrote: At 09:46 19/12/02 -0500, you wrote: Jeff Snoxell wrote: Nope. That doesn't do it either! I go: TRUNCATE TABLE my_table Are you using InnoDB tables? You'll have to do something akin to ALTER TABLE my_table AUTO_INCREMENT=1 ... at least according to Paul ... :)

re: Accessing last_insert_id problem.

2002-12-19 Thread Jeff Snoxell
I'm working with MySQL 3.23.36 so, according to MySQL, Paul Dubois, New Riders running the query: DELETE FROM my_table_name should reset the auto-increment value... but it doesnt'. What SQL do I use to reset the val. You can't believe anything that book says. The author didn't even include

re: Accessing last_insert_id problem.

2002-12-19 Thread Wico de Leeuw
http://www.mysql.com/doc/en/SET_OPTION.html last option(s) maybe you can do somehting with that Gr At 10:54 19-12-02 +, Jeff Snoxell wrote: I'm working with MySQL 3.23.36 so, according to MySQL, Paul Dubois, New Riders running the query: DELETE FROM my_table_name should reset the

Re: Accessing last_insert_id problem.

2002-12-19 Thread Jeff Snoxell
At 09:46 19/12/02 -0500, you wrote: Jeff Snoxell wrote: Nope. That doesn't do it either! I go: TRUNCATE TABLE my_table Are you using InnoDB tables? You'll have to do something akin to ALTER TABLE my_table AUTO_INCREMENT=1 ... at least according to Paul ... :) No, I'm using MyISAM I

Re: Accessing last_insert_id problem.

2002-12-19 Thread Paul DuBois
At 15:13 + 12/19/02, Jeff Snoxell wrote: At 09:46 19/12/02 -0500, you wrote: Jeff Snoxell wrote: Nope. That doesn't do it either! I go: TRUNCATE TABLE my_table Are you using InnoDB tables? You'll have to do something akin to ALTER TABLE my_table AUTO_INCREMENT=1 ... at least

Accessing last_insert_id problem.

2002-12-18 Thread Jeff Snoxell
Hi, I'm adding records to a db using the Perl DBI. Subsequent to adding a record I need to know the value of the auto-incrementing 'Ref' field so that I can place a copy of the relavent details into a log file. I could query for the LAST_INSERT_ID but what if another process has added another

re: Accessing last_insert_id problem.

2002-12-18 Thread Victoria Reznichenko
On Wednesday 18 December 2002 14:21, Jeff Snoxell wrote: I'm adding records to a db using the Perl DBI. Subsequent to adding a record I need to know the value of the auto-incrementing 'Ref' field so that I can place a copy of the relavent details into a log file. I could query for the

re: Accessing last_insert_id problem.

2002-12-18 Thread Jeff Snoxell
Hi, I've got that sussed now and am happily using the aquired ref to subsequently play with the record etc. One other related problem and I recon I'm sorted How do I reset the auto-increment value? I'm working with MySQL 3.23.36 so, according to MySQL, Paul Dubois, New Riders running the

re: Accessing last_insert_id problem.

2002-12-18 Thread Wico de Leeuw
At 15:31 18-12-02 +, Jeff Snoxell wrote: Hi, I've got that sussed now and am happily using the aquired ref to subsequently play with the record etc. One other related problem and I recon I'm sorted How do I reset the auto-increment value? I'm working with MySQL 3.23.36 so, according

Re: Accessing last_insert_id problem.

2002-12-18 Thread Michael T. Babcock
Jeff Snoxell wrote: DELETE FROM my_table_name should reset it... but it doesnt'. I'm glad the DELETE FROM doesn't, or else my foreign keys would all get screwed up :) TRUNCATE should do what you want (as someone else pointed out). -- Michael T. Babcock C.T.O., FibreSpeed Ltd. ... SQL

Re: Accessing last_insert_id problem.

2002-12-18 Thread Paul DuBois
At 12:21 + 12/18/02, Jeff Snoxell wrote: Hi, I'm adding records to a db using the Perl DBI. Subsequent to adding a record I need to know the value of the auto-incrementing 'Ref' field so that I can place a copy of the relavent details into a log file. I could query for the LAST_INSERT_ID

re: Accessing last_insert_id problem.

2002-12-18 Thread Paul DuBois
At 15:31 + 12/18/02, Jeff Snoxell wrote: Hi, I've got that sussed now and am happily using the aquired ref to subsequently play with the record etc. One other related problem and I recon I'm sorted How do I reset the auto-increment value? I'm working with MySQL 3.23.36 so, according