Re: err 297....
Posted in 1999
Topics: Server Administration, Triggers, Constraints & Referential Integrity
On Sun, 7 Mar 1999, Jonathan Leffler wrote:
Thanks Jonathan!.
still i have some newbie questions.
where do i put this finderr thing? I read the error at the pdf, but it
didn't quite fulfill my curiosity.
can't I do something like "set explain on;"? or something like a more
verbose mode?
so, the thing of the error "297" means that i can't refer to a single
value(column) of a compound key, but the whole key?
thank you.
=)
> Roberto Dircio Palacios-Macedo wrote:
> >
> > Dear informix supergurus:
> >
> > 1. I want to see more than the one-line-error-message at dbaccess, but
> > don't know howto....
>
> finderr -297
>
> > 2. I want to know why the heck error 297 appears as explained below...
>
> Because there is not a unique constraint on morph_descrips(morph_id).
> There is a unique index on morph_descrips(morph_id, seqno), but that
> is no good in a references clause; you have to have a unique index on
> exactly the columns referenced.
>
> To fix your problem, I think I'd choose to create a table of
> morphological features which is described by the morphological
> descriptions:
>
> CREATE TABLE morph_feature
> (
> morph_id CHAR(200) NOT NULL PRIMARY KEY,
> char_id CHAR(200) NOT NULL,
> parent_char_id CHAR(200) REFERENCES ...
> );>
> CREATE TABLE morph_descrip
> (
> morph_id CHAR(200) NOT NULL REFERENCES morph_feature,
> seqno INTEGER NOT NULL,
> value CHAR(200) NOT NULL,
> PRIMARY KEY(morph_id, seqno)
> );>
> I'd also review very carefully why you are using CHAR(200) for
> all these keys -- that is awfully big. There may be sound reasons,
> but it feels a bit like overkill. Also, my design assumes that there's
> a single char_id and parent_char_id for a single morph_feature, so
> that if there a 6 rows in your version of morph_descrip for a
> single morph_id, then all 6 rows have the same values for char_id
> and parent_char_id. If that's wrong, then you have to move the
> columns from morph_feature to morph_descrip.
>
>
> > please help !!!!!!!!!
> >
> > --------
> > Damn error appears at creating the table "couplets"....
> >
> > 297: Cannot find unique constraint or primary key on referenced table
> > (is092756.morph_descrips)> >
> > Here is the sql.
> >
> > --------------------------------------------
> > -- TAXA
> > --------------------------------------------
> > create table taxa (
> > taxon_id char(200) not null primary key,
> > rank text,
> > supertaxon_id text,
> > taxonomy text,
> > node_type char(1)
> > );> >
> > --------------------------------------------
> > -- CHARACTERISTICS (catalog of possible structure and characteristic names)
> > --------------------------------------------
> > create table characteristics
> > (
> > char_id char(200) not null primary key,
> > char_name char(200)
> > );> >
> > --------------------------------------------
> > -- MORPH_DESCRIPS (MORPHOLOGIC DESCRIPTIONs)
> > --------------------------------------------
> > create table morph_descrips
> > (
> > morph_id char(200) not null,
> > seq_no int not null,
> > char_id char(200) not null references characteristics,
> > value char(200),
> > parent_char_id char(200) references characteristics(char_id),
> > primary key (morph_id, seq_no)
> > );> >
> > --------------------------------------------
> > -- TYPICAL_SUBCHARS (typical struct/char organizations)
> > --------------------------------------------
> > create table typical_subchars
> > (
> > taxon_id char(200) not null,
> > char_id char(200) not null references characteristics,
> > parentchar_id char(200) not null references characteristics
> > );> >
> > --------------------------------------------
> > -- COUPLETS (components of taxonomic keys)
> > --------------------------------------------
> > create table couplets
> > (
> > taxon_id char(200) not null references taxa,
> > couplet_id text not null,
> > seq_no int not null,
> > parent_couplet_id text,
> > morph_id char(200) not null references morph_descrips(morph_id)
> > );>
>
> --
> Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
> Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
> #include <disclaimer.h>
>
>
____roberto dircio palacios macedo__________________________________
__ | |
/\\_\\__ | Interactive and | http://ict.udlap.mx/people/roberto
\\/_/\\_\\ | Cooperative | tel:(22)292431
/\\_\\/_/ | Technologies Lab. | mail: is092756@cca.pue.udlap.mx
\\/_/ ict | UDLA-P, Mexico. |
__________|____________________|____________________________________
Just for the sake of it make sure you're always frowning
it shows the world that you have substance and depth. Tennant/Lowe
____________________________________________________________________
Roberto Dircio Palacios-Macedo wrote: > > On Sun, 7 Mar 1999, Jonathan Leffler wrote: > > Thanks Jonathan!. > > still i have some newbie questions. > where do i put this finderr thing? I read the error at the pdf, but it > didn't quite fulfill my curiosity. > can't I do something like "set explain on;"? or something like a more > verbose mode? Finderr is a command line utility in $INFORMIXDIR/bin that you run to retrieve the text of an error message. There are also 4GL and ESQL/C functions to retrieve the same error message for you apps to use. > so, the thing of the error "297" means that i can't refer to a single > value(column) of a compound key, but the whole key? Correct. [SNIP] Art S. Kagel