Tomasz Tyrakowski wrote:
>
> That's the procedure I've been using in the past in such cases:
[...]

Thank you very much; I'll save this useful "instruction manual" for later :-)

> 1. drop the current primary key (alter table MyTable drop constraint
> OldPrimaryKeyName)

That's what I wanted to do, but I didn't remember "drop constraint".
I just tried "drop index", but it wouldn't let me do this because of
"cannot drop index because index is primary key" (or something similar).
So I thought it might be not possible at all.

> 4. fill the new column using the generator:
> update MyTable set NewKey=(select gen_id(MyGen,1) from RDB$DATABASE)

Brilliant :-) (I already wondered how to fill up an "incrementing"
column automagically.)

Thanks again,

-Matt



------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu.  Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to