-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
CONNECT 'C:\Databases\FireBird\Test.fdb' USER 'xxxx' PASSWORD 'xxxx';

CREATE TABLE dummy (id INTEGER NOT NULL, data VARCHAR(50), PRIMARY KEY(id));
CREATE GENERATOR dummyid;
SET GENERATOR dummyid TO 1;
INSERT INTO dummy VALUES(GEN_ID(dummyid,1), 'foo');
INSERT INTO dummy VALUES(GEN_ID(dummyid,1), 'bar');
SELECT * FROM dummy;
COMMIT;
DROP GENERATOR dummyid;
DROP TABLE dummy;

CREATE TABLE dummy (id INTEGER NOT NULL, data VARCHAR(50), PRIMARY KEY(id));
CREATE SEQUENCE dummyid;
ALTER SEQUENCE dummyid RESTART WITH 1;
INSERT INTO dummy VALUES(NEXT VALUE FOR dummyid, 'foo');
INSERT INTO dummy VALUES(NEXT VALUE FOR dummyid, 'bar');
SELECT * FROM dummy;
COMMIT;
DROP SEQUENCE dummyid;
DROP TABLE dummy;
