Re: [firebird-support] New auto-increment column, existing data

2016-11-15 Thread Helen Borrie hele...@iinet.net.au [firebird-support]
On 15/11/2016 19:58, 'Some One' anotherpersonsomewh...@mail.com [firebird-support] wrote: > I am trying to add new auto-increment primary keys for existing table. > > This is what I have: > == > set term ~ ; > execute block > as > declare dbkey char(8); > begi

Re: [firebird-support] New auto-increment column, existing data

2016-11-15 Thread setysvar setys...@gmail.com [firebird-support]
Den 15.11.2016 20:58, skrev 'Some One' anotherpersonsomewh...@mail.com [firebird-support]: > I am trying to add new auto-increment primary keys for existing table. > > > This is what I have: > == > set term ~ ; > execute block > as > declare dbkey char(8); > b

Re: [firebird-support] New auto-increment column, existing data

2016-11-15 Thread 'Some One' anotherpersonsomewh...@mail.com [firebird-support]

Re: [firebird-support] New auto-increment column, existing data

2016-11-15 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
There are a few things missing from your setup. Try this; there may be other ideas for you too, but this works. create a new table CREATE TABLE A_AUTO_TEST ( NEW_FIELD INTEGER NOT NULL, SOME_DATA CHAR(10) ); ensure the field you want is the PK ALTER TABLE A_AUTO_TEST ADD CONSTRAINT P

[firebird-support] New auto-increment column, existing data

2016-11-15 Thread 'Some One' anotherpersonsomewh...@mail.com [firebird-support]
I am trying to add new auto-increment primary keys for existing table. This is what I have: == set term ~ ; execute block as declare dbkey char(8); begin for select rdb$db_key from mytable into :dbkey do begin ... end end~ set term ; ~