RE: Problem in retriving in column name using constraint name
Posted in 1997
select i.part1, i.part2, ...., i.part16
from sysconstraints c, sysindexes i
where c.idxname = i.idxname
should do the job
------------------------------------------------------------------------
-
Frido van Orden
FAA Partners BV
Planetenbaan 117
3606 AK Maarssen
The Netherlands
Phone: +31-346-587076
Fax: +31-346-587086
Email: fridoo@faapartners.com
------------------------------------------------------------------------
-
} -----Original Message-----
} From: Voora.Srinivas@blr.sni.de [SMTP:Voora.Srinivas@blr.sni.de]
} Sent: Tuesday, December 02, 1997 2:31 PM
} To: Informix-list@rmy.emory.edu
} Subject: Problem in retriving in column name using constraint
} name
}
} Hello,
}
} I got a problem in retriving information from system catalog.
} I created the following table in the database
}
} CREATE TABLE Address
} (
} number INTEGER NOT NULL,
} name CHAR(35) NOT NULL,
} vorname CHAR(35) NOT NULL,
} children DECIMAL(22) NOT NULL,
} UNIQUE (number),
} UNIQUE (name)
} ) LOCK MODE ROW;
}
} and i delebarately entered two rows with same names . The sqlca
} structure
} has returned the following information
}
} result last sqlstat/stat type (sqlca.sqlcode): -268
} dec
} informix error message (sqlca.sqlerrm):
} >>voora.u102_8<<
} esitmated nr of rows returned (sqlca.sqlerrd[0]): 1 dec
} serial value or ISAM err code (sqlca.sqlerrd[1]): 0 dec
} number or rows processed (sqlca.sqlerrd[2]): 0 dec
} estimated cost (sqlca.sqlerrd[3]): 1 dec
} offset of error in statement (sqlca.sqlerrd[4]): 73 dec
} rowid of last row processed (sqlca.sqlerrd[5]): 0 dec
}
} The system has assigned the names to the Unique constraints
} __________________________________
} Constraint Name Column Name
} __________________________________
} u102_7 number
} u102_8 name
} ___________________________________
} My problem is i want to retrive the column name(ie name) using
} Constraint Name(u102_8)
} using an SQL statement from system catalogs.
}
} Please provide me the relating info.
}
} Regards
} voora srinivas
} voora.srinivas@blr.sni.de