7 messages in com.mysql.lists.perlRe: $dbh->last_insert_id() not...| From | Sent On | Attachments |
|---|---|---|
| Daniel Kasak | 15 Jun 2004 16:10 | |
| William R. Mussatto | 15 Jun 2004 16:21 | |
| Daniel Kasak | 15 Jun 2004 16:39 | |
| William R. Mussatto | 15 Jun 2004 17:02 | |
| Jochen Wiedmann | 15 Jun 2004 23:40 | |
| Daniel Kasak | 16 Jun 2004 15:20 | |
| lei shen | 17 Jun 2004 07:44 |
| Subject: | Re: $dbh->last_insert_id() not working![]() |
|---|---|
| From: | William R. Mussatto (muss...@csz.com) |
| Date: | 06/15/2004 05:02:18 PM |
| List: | com.mysql.lists.perl |
Daniel Kasak said:
William R. Mussatto wrote:
syntax error: should be $pk = $dbh->{'mysql_insertid'};
Thanks for the answer :) Someone else in the main MySQL list said that to me, right before suggesting I come here.
That's not what my DBI docs say though:
$rv = $dbh->last_insert_id($catalog, $schema, $table, $field);
Any if I use the suggested:
$pk = $dbh->{'mysql_insertid');
then I'm locking the object to work with MySQL only, and I'd really prefer to use DBI's more portable 'last_insert_id()' function ... if the damned thing works.
But thanks for the suggestion. I will use it for now to get things up & running, and I might go bug the DBI developers if I can't get the above working.
-- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: dka...@nusconsulting.com.au website: http://www.nusconsulting.com.au
Put it, and any other mysql unique stuff into a .pm file and refer to that. Then you will be able to change it only in one place. Just went through convertsion MS SQL -> mysql and the date functions are NOT THE SAME!!. Some databases don't even have an autoincrement function, so its not part of the SQL standard.
-- William R. Mussatto, Senior Systems Engineer Ph. 909-920-9154 ext. 27 FAX. 909-608-7061




