Re: postgres - mysql last_inserted_id
| From: | Martín Marqués | Date: | Fri, 01 Jul 2005 14:24:20 +0000 |
| Subject: | Re: postgres - mysql last_inserted_id | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-217979@lists.php.net to get a copy of this message | ||
El Vie 01 Jul 2005 06:27, david forums escribió:
>
> before any insert call the id.
>
> select nextval('tablename_seq');
>
> and pass this id to your insert.
No. Best is to but a DEFAULT clause of nextval('tablename_seq') in the table
definition.
--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
---------------------------------------------------------
Martín Marqués | Programador, DBA
Centro de Telemática | Administrador
Universidad Nacional
del Litoral
---------------------------------------------------------