how to get "autonumber" when using INSERT INTO - Mailing list pgsql-sql

From Richard Chrenko
Subject how to get "autonumber" when using INSERT INTO
Date
Msg-id 372EAF88.49FB@bluewin.ch
Whole thread Raw
List pgsql-sql
I'm trying what seems to me a trivial SQL task using Microsoft ADO to
write an Access table. I have several default tables containing the same
20 fields (but different data). I want to append the contents of these
tables into a "master" table which contains the same 20 fields in
addition to an autonumber field such that each appended record has a
unique identifier.

The following SQL queries succeed when run directly from Access

INSERT INTO mastertbl SELECT * FROM default1;
INSERT INTO mastertbl SELECT * FROM default2;

where mastertbl contains the same fields as default1 and default2 in
addition to an autonumber field. However, when these queries are
submitted via ADO from another application I get an error message that
the number of fields are unequal.

Please help me to get this to work using ADO!


pgsql-sql by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: [SQL] How to find SQL Functions
Next
From: Matt Behrens
Date:
Subject: Selecting with a large number of foreign keys