Received: from www.usis.bkc.lv (root@www.usis.bkc.lv [195.244.132.3]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA11024 for ; Fri, 25 Feb 2000 08:59:21 -0500 (EST) (envelope-from emils@mail.usis.bkc.lv) Received: from mail.usis.bkc.lv (mail [195.244.132.2]) by www.usis.bkc.lv (8.9.3/8.9.3) with ESMTP id QAA06635 for ; Fri, 25 Feb 2000 16:28:09 +0200 Message-Id: <200002251428.QAA06635@www.usis.bkc.lv> Received: from USIS-RIGA/SpoolDir by mail.usis.bkc.lv (Mercury 1.44); 25 Feb 100 16:00:18 EET Received: from SpoolDir by USIS-RIGA (Mercury 1.44); 25 Feb 100 15:59:47 EET From: "Emils Klotins" Organization: USIS Riga To: Date: Fri, 25 Feb 2000 15:59:40 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: INSERT w/o variable names for a SERIAL type? Priority: normal X-PM-Encryptor: QDPGP, 4 X-mailer: Pegasus Mail for Win32 (v3.12b) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello. 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 ie. CREATE TABLE mytable (id SERIAL PRIMARY KEY, textfield text); 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? Emils -----BEGIN PGP SIGNATURE----- Version: PGP 6.5.2 -- QDPGP 2.61a Comment: http://community.wow.net/grt/qdpgp.html iQA/AwUBOLZuld0sxa1MAPWHEQJtVACg3Nsd7YiH3q2aXkIMSM/mjaLD3fgAn0bu S4NHXOsVsS26nntkkInqxBJw =HodA -----END PGP SIGNATURE-----