Subject RE: [firebird-support] Re: Modify Primary key
Author Alan McDonald
you don't ned exclusive access - the only thing which needs a special access
(not exclusive but primary connection) is validation.

There are so many ways to do this without fooling around with system tables.
What tool(s) are you using - most of the good ones do all this for you with
a point and click method

Alan

> -----Original Message-----
> From: skotaylor [mailto:scott@...]
> Sent: Friday, 18 July 2003 5:35 AM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Re: Modify Primary key
>
>
> --- In firebird-support@yahoogroups.com, "Alexander V.Nevsky"
> <ded@h...> wrote:
> > --- In firebird-support@yahoogroups.com, "skotaylor" <scott@d...>
> > wrote:
> > > I need to add another field to a primary key on a live database. I
> > > added the record to the RDB$INDEX_SEGMENTS and all looks good except
> >
> > Scott, I'm amazing why people don't like broad, paved with asphalt
> > roads and prefer circuitous wild pathes :)
>
> I'm just a circuitously wild guy ;)
>
> Besides, I couldn't locat the proper syntax and everything else I
> tried just popped up errors.
>
> > Why not just
> >
> > Alter Table T Drop Constraint T_PK;
> > Commit;
> > Alter Table T Add Constraint T_PK Primary Key (OldCol, NewCol);
> > Commit;
>
> What does T_PK stand for?
>
> I tried:
> alter table fuellog drop constraint INTEG_68
>
> and I get
> ISC ERROR CODE:335544351
>
> ISC ERROR MESSAGE:
> unsuccessful metadata update
> object INDEX is in use
>
> > if you have FKs on another tables references on this PK, you should
> > drop them before dropping it and re-create after creation new one.
>
> No, none.
>
> > Anyway, you should change them too. Perhaps you'll be forced to
> > reconnect several times due to "object in use" exception.
>
> hmmm... Like the error I got. I know it's not in use, currently, but
> tried many times as you said; still no luck.
>
> > Hacks of
> > system table is last what reasonables person should try to do, use
> > documented ways.
>
> I would if I could find the document that tells me how to do this. I
> have all the ib_IB6_docs .pdf files from ibphoenix site and the SQL
> ref.html one as well. Maybe I just getting the syntax messed up?
>
> Maybe I need to have exclusive access to alter a primary key, is this
> true?
>
> Cheers.
>
> Scott.
>
>
>
>
> To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>