Re: last_insert_id problem

2006-07-07 Thread John L Meyer
Afshad Dinshaw wrote: Hi Im using the latest version of mysql. When I run the following query : select last_insert_id() if get the error message: function vcontacts.last_insert_id does not exist note: vcontacts is the name of my database. anyone know why? thanks I can run it both upperca

last_insert_id problem

2006-07-07 Thread Afshad Dinshaw
Hi Im using the latest version of mysql. When I run the following query : select last_insert_id() if get the error message: function vcontacts.last_insert_id does not exist note: vcontacts is the name of my database. anyone know why? thanks

Re: Accessing last_insert_id problem.

2003-01-02 Thread Matthew Smith
Dec 2002, 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 &g

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 ac

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 accordin

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 belie

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 a

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 incl

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 t

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 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 ht

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 t

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 th

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 "L

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 anothe