-----BEGIN PGP SIGNED MESSAGE-----
I am using, which is written for connecting to another server
and uses the AUTO_INCREMENT and BLOB fields (for storing
text). Apparently it was written for mysql(?).
I wanted to write a #define or two to change the relevant
places, such as
#define IDKEY "INTEGER AUTO_INCREMENT PRIMARY
KEY" // mysql version
#define IDKEY "SERIAL PRIMARY KEY" // postgres
and currently stumbled upon mysql version of inserting the
autoincrement value: NULL
CREATE TABLE mytable (id SERIAL PRIMARY KEY, textfield
the mysql variant for inserting a row would be:
INSERT INTO mytable VALUES (NULL, 'textvalue');
and NULL would get translated into the real value.
Now, if I want to write a general #define, I'd need to have a way
to specify 'default' for SERIAL field, for, if I omit the id field in
VALUES, I need to specify all the rest of the fields explicitly.
Is there any value I could put in place of id in VALUES part, to
make it replaced with the next value in sequence?
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.2 -- QDPGP 2.61a
-----END PGP SIGNATURE-----
pgsql-sql by date
|Next:||From: Alessio Bragadini||Date: 2000-02-25 15:14:26|
|Subject: Re: [SQL] INSERT w/o variable names for a SERIAL type?|
|Previous:||From: Nedu||Date: 2000-02-25 13:54:13|
|Subject: Problem - Postgres Running continously|