Ok, thanks a lot =) On 10/22/11, Michael Van Canneyt <mich...@freepascal.org> wrote: > ... And mainly the reason I think it is not abstractable... :-)
In this case I would suggest to abstract it like this: // ASequenceName -> The name of the sequence for usage in Postgres, etc. Ignored for MSSQL, etc. // ARecordValues -> The values of the fields, all should be placed in the sequence in which they exist in the table columns. nil is accepted. // Returns the index to the primary key TSQLQuery.InsertNewRecordWithAutoGeneratedPrimaryKey(ASequenceName: string; ARecordValues: array of const): Integer; Then it will ... insert a new record with the record values that you provided and give back the primary key for it. At least that's how I would expect it =D For each database it would simply figure out if it needs to get the sequence number or if it will auto-generate or whatever. -- Felipe Monteiro de Carvalho _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal