Użytkownik Sibylle Koczian napisał:
> Database: taken from tutorial.sqlite and minimized to this schema:
>
> sqlite>  .schema
> CREATE TABLE reccat (recid INTEGER NOT NULL REFERENCES recipes(id),
> catid INTEGER NOT NULL REFERENCES reccats(id),
> PRIMARY KEY (recid, catid));
> CREATE TABLE reccats (id INTEGER PRIMARY KEY, descrp text NOT NULL UNIQUE);
> CREATE TABLE recipes (id INTEGER PRIMARY KEY, title text NOT NULL UNIQUE,
>    date date NOT NULL default ‚0000-00-00‘);
> CREATE INDEX recipes_date on recipes (date);
>
> Table reccat now has a composite primary key consisting of its two columns.
>
> Data: from tutorial table recipes ID 1-20, complete table reccats, all
> records from reccat with recid 1-20.
>
> Start of application: everything looks good, correct entries selected in
> checklist, correct list of linked categories in terminal.
>
> Checked additional category (No. 41, Breakfast and Brunch) for recipe
> No. 1.  Output in terminal:
>
> idx = 6, idxKey = 41
> addLink, catid = 41
> 2010-12-12 11:21:53 - INFO - SQL: BEGIN
> 2010-12-12 11:21:53 - INFO - SQL: begin
> 2010-12-12 11:21:53 - INFO - SQL: update „reccat“ set „catid“ = ? where
> „recid"=1  AND „catid"=11 , PARAMS: 41
> 2010-12-12 11:21:53 - INFO - SQL: COMMIT
> 2010-12-12 11:21:53 - INFO - SQL: commit
>
> This is wrong, of course, it should be an INSERT. Why UPDATE?
>
> Closing the application I get the message box „Do you want to save the
> changes?“. Clicking „Yes“: Save failed, foreign constraint failed.
> Messages in terminal:
> 2010-12-12 11:25:04 - INFO - SQL: BEGIN
> 2010-12-12 11:25:04 - INFO - SQL: begin
> 2010-12-12 11:25:04 - INFO - FAILED SQL: insert into „reccat“ („recid“,
> „catid“) values (?,?) , PARAMS: 1, 0
> 2010-12-12 11:25:04 - INFO - DBQueryException encountered in execute():
> foreign key constraint failed
> insert into „reccat“ („recid“, „catid“) values (?,?)
> 2010-12-12 11:25:04 - INFO - DBQueryException aufgetreten in save():
> foreign key constraint failed
> 2010-12-12 11:25:04 - ERROR - Error in scanChangedRows: foreign key
> constraint failed
> 2010-12-12 11:25:04 - ERROR - Error in scanChangedRows: foreign key
> constraint failed
> 2010-12-12 11:25:04 - INFO - SQL: ROLLBACK
> 2010-12-12 11:25:04 - INFO - SQL: rollback
>
>    

Could you show me please, bizobj definition properties:
PrimaryKey, LinkField, ParentLinkField?

-- 
Regards
Jacek Kałucki

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to