Subject Re: [IBO] Why RDB$DB_KEY?
Author Steve Fields
Helen Borrie wrote:
>
> Steve,
> If it is the master, you shouldn't have MasterLinks or double-KeyLinks on it at all. Remove those two properties make your Keylinks simply COUNTER and test again,.
>
> Regards,
> Helen
>
> At 12:45 PM 06-08-01 -0500, you wrote:
> >Helen Borrie wrote:
> > >
> > > At 09:18 AM 06-08-01 -0500, you wrote:
> > > >Hi All,
> > > > With a simple table: Counter=Integer, LastName=VARCHAR(30), etc.
> > > >as OVERTIME.
> > > > I have the primary key on COUNTER, a generator. In the program I
> > > >have a TIB_Query with SELECT * FROM OVERTIME FOR UPDATE, KEYLINKS:
> > > >COUNTER=COUNTER, MASTERLINKS:COUNTER=G_OTCOUNTER, the default
> > > >ordering text (built by right-clicking), and the default SQL text
> > > >generated with the default settings:Prepared Edit, Search Delete,
> > > >Searched Edits.
> > > > When I select the Generate For Table I get the three SQL texts
> > > >but in the Edit SQL I get the normal setup but at the bottom I
> > > >get WHERE RDB$DB_KEY = :DB_KEY
> > > > From this point on I get errors of _Invalid Custom DML Column
> > > >Reference RDB$DB_KEY.
> > > > How do you fix this when it is the default?
> > >
> > > Steve,
> > > Without actually seeing the callstack, I'd guess you have a "weird" situation here because the keylinks entry isn't valid. It should simply be COUNTER. (A keylinks of COUNTER=COUNTER isn't any sort of valid; but if it was a lookup dataset linking to a Keysource, it would be COUNTER=OTHERTABLE.COUNTER).
> > >
> > > Basically this can't be any sort of right if this dataset is a detail in a master-detail construction...
> > >
> > > Regards,
> > > Helen
> > >
> > > All for Open and Open for All
> > > InterBase Developer Initiative · http://www.interbase2000.org
> > > _______________________________________________________
> > >
> > >
> > >
> > >
> > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >Is is THE master. I tried it all ways: no keylink,
> >keylink=COUNTER, COUNTER=COUNTER, anything.
> >The funny thing is that if I use the Generate For
> >Table option it always puts in the RBD$KEY = :DB_KEY
> >line after WHERE...
> >
> >
> >Steve
> >
> >
> >
> >
> >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
> All for Open and Open for All
> InterBase Developer Initiative · http://www.interbase2000.org
> _______________________________________________________
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

Sorry I didn't get back sooner, I have been snowed under by
other projects.
Anyway, let this be a lesson to others about stupidly forgetting
things. I kept getting the RDB$DB_KEY problem because I had left
something out: When I was getting together the program for
Jason to look at I happened across the fact that I had set indexes
in the dataset, but forgot to set a primary key...... The package
I use for working on Interbase tables is still unfamiliar to me
in it's in and outs, so I forgot the step. (I am going to just have
to triple check myself from now on, before I open my mouth!)

Thanks to all anyway!!!!!
Steve Fields