You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Veaceslav Chicu (JIRA)" <de...@db.apache.org> on 2005/11/11 17:25:03 UTC

[jira] Created: (DERBY-702) fk fields order

fk fields order
---------------

         Key: DERBY-702
         URL: http://issues.apache.org/jira/browse/DERBY-702
     Project: Derby
        Type: Bug
    Reporter: Veaceslav Chicu


create table acc.account
(
account_id integer not null,
plan_id integer not null
);
create table acc.trans
(
plan_id integer not null,
credit_id integer not null,
);
alter table acc.account add constraint account_pk primary key
(account_id, plan_id);

alter table acc.trans add constraint trans_credit_fk foreign key
(plan_id, credit_id) references acc.account (plan_id, account_id)
	on delete restrict on update restrict;

SQL Exception: Constraint 'TRANS_CREDIT_FK' is invalid: there is no
unique or primary key constraint on table 'ACC.ACCOUNT' that matches the
number and types of the columns in the foreign key.

if in trans_credit_fk I change with places plan_id, account_id, it works

it's a probleme of order, but message is wrong

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-702) fk fields order

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-702:
--------------------------------

    Issue & fix info: [Newcomer, Repro attached]
             Urgency: Normal

Triaged for 10.5.3: assigned normal urgency, marked as "newcomer" and "repro attached". This could be resolved by improving the wording of the error message.

> fk fields order
> ---------------
>
>                 Key: DERBY-702
>                 URL: https://issues.apache.org/jira/browse/DERBY-702
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Veaceslav Chicu
>         Attachments: w.sql
>
>
> create table acc.account
> (
> account_id integer not null,
> plan_id integer not null
> );
> create table acc.trans
> (
> plan_id integer not null,
> credit_id integer not null,
> );
> alter table acc.account add constraint account_pk primary key
> (account_id, plan_id);
> alter table acc.trans add constraint trans_credit_fk foreign key
> (plan_id, credit_id) references acc.account (plan_id, account_id)
> 	on delete restrict on update restrict;
> SQL Exception: Constraint 'TRANS_CREDIT_FK' is invalid: there is no
> unique or primary key constraint on table 'ACC.ACCOUNT' that matches the
> number and types of the columns in the foreign key.
> if in trans_credit_fk I change with places plan_id, account_id, it works
> it's a probleme of order, but message is wrong

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-702) fk fields order

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-702?page=all ]

Mike Matrigali updated DERBY-702:
---------------------------------

    Component: SQL

> fk fields order
> ---------------
>
>          Key: DERBY-702
>          URL: http://issues.apache.org/jira/browse/DERBY-702
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Reporter: Veaceslav Chicu

>
> create table acc.account
> (
> account_id integer not null,
> plan_id integer not null
> );
> create table acc.trans
> (
> plan_id integer not null,
> credit_id integer not null,
> );
> alter table acc.account add constraint account_pk primary key
> (account_id, plan_id);
> alter table acc.trans add constraint trans_credit_fk foreign key
> (plan_id, credit_id) references acc.account (plan_id, account_id)
> 	on delete restrict on update restrict;
> SQL Exception: Constraint 'TRANS_CREDIT_FK' is invalid: there is no
> unique or primary key constraint on table 'ACC.ACCOUNT' that matches the
> number and types of the columns in the foreign key.
> if in trans_credit_fk I change with places plan_id, account_id, it works
> it's a probleme of order, but message is wrong

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-702) fk fields order

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick Hillegas updated DERBY-702:
--------------------------------

    Attachment: w.sql

Attaching repro, w.sql

> fk fields order
> ---------------
>
>                 Key: DERBY-702
>                 URL: https://issues.apache.org/jira/browse/DERBY-702
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Veaceslav Chicu
>         Attachments: w.sql
>
>
> create table acc.account
> (
> account_id integer not null,
> plan_id integer not null
> );
> create table acc.trans
> (
> plan_id integer not null,
> credit_id integer not null,
> );
> alter table acc.account add constraint account_pk primary key
> (account_id, plan_id);
> alter table acc.trans add constraint trans_credit_fk foreign key
> (plan_id, credit_id) references acc.account (plan_id, account_id)
> 	on delete restrict on update restrict;
> SQL Exception: Constraint 'TRANS_CREDIT_FK' is invalid: there is no
> unique or primary key constraint on table 'ACC.ACCOUNT' that matches the
> number and types of the columns in the foreign key.
> if in trans_credit_fk I change with places plan_id, account_id, it works
> it's a probleme of order, but message is wrong

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.