Subject RE: [IBO] Foreign key
Author Malcolm Smith
Helen,

I don't even know what the 'FOR UPDATE' does. I saw it in another demo.

The master table only has two columns, an ID and a DESCRIPTION. I currently
have SELECT* only because I'm getting an error relating to the fact the
field is a required field in a key link.

Additionally I have a trigger/generator on the ID field. When I add a new
record I get an exception raised. Is this where I need to explicitly define
an InsertSQL command - to trigger the trigger (no pun intended) - I've put
one in and it works so I guess this is correct.

Thanks for the tip on the bars.

The application is now working. I just need the confirmation regarding my
InsertSQL requirement.

Thanks to those that took the time to look at my app.

Malcolm Smith
MJ Freelancing
ABN: 30 671 763 146
http://www.mjfreelancing.com




-----Original Message-----
From: Helen Borrie [mailto:helebor@...]
Sent: Tuesday, 20 August 2002 10:06
To: IBObjects@yahoogroups.com
Subject: RE: [IBO] Foreign key


At 07:50 AM 20-08-02 +1000, you wrote:
>I have placed my BCB5 sample project and database at
>http://www.mjfreelancing.com/download/IBOTest.zip
>
>Can someone please have a look at this very simple problem.
>
>Mal

Some suggestions:

Looking at your DFM (I don't have BCCPB) I see that you include the FOR
UPDATE clause in the select queries. Try removing that, and your EditSQL
sentence, and see whether it then works. Apart from that the setup looks
right.

Try explicitly listing the columns you want in the sets, rather than using
select *. This is a rule I recommend and follow, since it makes your app
easier to troubleshoot and maintain. (All data in IBO "boils down" to
TIB_Column).

Also, you don't need all those bars. If you set the property ReceiveFocus
to true on a Bar component, then the bar will operate on whichever dataset
has the focus...not that superfluous bar comps should cause any
problems...but it's just a thought that the extra bar comps might be
stepping on the masterlinking in some way.

Another possibility might be that the Keylinks in the detail set don't
uniquely identify a row. Is there any chance of that? Or that the linking
keys are somehow mismatched, e.g. by type, size or case?

Is it possible that your app is forgetting to open the detail set...?

Have you tested the two datasets in IB_SQL in a joined query, to see
whether the master keys actually find the foreign keys in the detail?

You don't say what database version you are using. If it's IB 6.x or
Firebird, could there be some quoted identifiers in there that you
overlooked?

Helen


>-----Original Message-----
>From: Jason Wharton [mailto:jwharton@...]
>Sent: Tuesday, 20 August 2002 06:55
>To: IBObjects@yahoogroups.com
>Subject: Re: [IBO] Foreign key
>
>
>There is simply something confusing you here. EditSQL should have no
bearing
>on whether you can select data in a master-detail setup or not.
>
>Jason Wharton
>CPS - Mesa AZ
>http://www.ibobjects.com
>
>-- We may not have it all together --
>-- But together we have it all --
>
>
>----- Original Message -----
>From: "Malcolm Smith" <mjfreelancing@...>
>To: "IBObjects List (E-mail)" <IBObjects@yahoogroups.com>
>Sent: Monday, August 19, 2002 1:42 AM
>Subject: [IBO] Foreign key
>
>
> > I'm starting out with IBO.
> >
> > I created my first sample master-detail table today in BCB5 and was
>getting
> > a 'cannot use blank SQL statement' (or similar). Looking at demos I
could
> > not work out why.
> >
> > After looking at some other sources I found a sample that used an
EditSQL
> > statement. I could only get my application to work if I added:
> >
> > update GROUPS
> > set
> > GRP_DESCRIPTION = :GRP_DESCRIPTION
> > where
> > GRP_DESCRIPTION = :OLD_GRP_DESCRIPTION
> >
> > to the EditSQL string in my master query.
> >
> > Why is this ?
> >
> > My database is very basic and I only added the foreign key because from
my
> > BDE experiences I thought I needed it. It is not used for anything else
>(at
> > the moment). Can I get rid of it and hence the above SQL statement.
> >
> >
> >
> > Malcolm Smith
> > MJ Freelancing
> > ABN: 30 671 763 146
> > http://www.mjfreelancing.com
> >
> > CORintel
> > ABN: 30 336 110 329
>
>
>
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
>keyword-searchable FAQ, community code contributions and more !
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
>keyword-searchable FAQ, community code contributions and more !
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

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