Subject RE: [IBO] Can not edit/remove on dataset.
Author Don Schoeman
Hi Sven,

You are perfectly correct, I do not wish to modify any of the fields in the
TEAMS table but I do wish to add, edit and remove rows in the SCHEDULE
table. I'll explain to you what happens when I set the KeyRelation to
SCHEDULE and the KeyLinks to SCHEDULE.MATCH_NO:

I get the following exception as soon as I try to post the changes made to
the record:

Multiple rows in singleton fetch

Check KeyLinks and JoinLinks properties

SELECT SCHEDULE.MATCH_NO, SCHEDULE.OPP_TEAM_ID. SCHEDULE.MATCH_DATE,
SCHEDULE.MATCH_TIME, SCHEDULE.COURT, SCHEDULE.PLAYED,
TEAMS.TEAM_ID, TEAMS.NAME
FROM SCHEDULE, TEAMS
WHERE SCHEDULE.MATCH_NO=? /*BIND_0*/
FOR UPDATE

I fail to figure out why this exception occurs. I've tried every combination
possible in the KeyLinks property. This is also the reason why I changed it
to TEAMS.TEAM_ID. When the user adds/edits a SCHEDULE entry, he can select
the opponent team from a TIB_LookupComboBox which then places the
TEAMS.TEAM_ID value into the SCHEDULE.OPP_TEAM_ID field. This all works
perfectly, I simply can not post the record once the user is done with it.

Thanks for you and Jason's helpfulness,

Best Regards,
Don Schoeman





-----Original Message-----
From: Svein Erling Tysvar
[mailto:svein.erling.tysvaer@...]
Sent: 29 June 2001 11:16
To: ibobjects@yahoogroups.com
Subject: Re: [IBO] Can not edit/remove on dataset.


Don Schoeman wrote:
>I've already tried it that way around also which then allows you to
>insert/edit/remove records, but then the posting of the new record fails
>with a "multiple rows returned in singleton select" error. I think the
>KeyLinks property should be set to TEAMS.TEAM_ID but like Jason said, I
will
>probably have to write my own EditSQL and DeleteSQL statements.

Huh?

How can it be correct to have the KeyLinks and KeyRelation refer to
different datasets? Since TEAM_ID is the primary key of TEAMS, I think
SCHEDULE.MATCH_NO (the primary key for SCEDULE) would be the field uniquely
identifying each record. I cannot see why you need your own EditSQL or
DeleteSQL for this one - that is, unless you want to be able to modify some
of the TEAMS fields.

Set



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