Informix数据表结构分析资料整理之约束查询代码
来源:互联网 发布:java权限框架哪个好 编辑:程序博客网 时间:2024/04/30 14:30
原文地址:http://blog.csdn.net/xqf222/article/details/6271219
本文主要整理了Informix数据库相关系统表数据,已分析整个Informix数据表结构,同时方便代码自动生成.
提示一:systables 存放Informix数据库中所有数据表相关数据
提示二:sysconstraints 存放Informix数据库中所有约束相关数据
--获取所有用户表的主键约束名称
select a.tabname,b.constrname,b.* from systables a join sysconstraints b on a.tabid=b.tabid where a.tabid >99 and a.tabtype='T' and b.constrtype ='P' order by a.tabname
--获取所有未设置主键的用户数据表OK
Select * from systables a where tabid >99 and tabtype='T' and not exists (Select 1 from sysconstraints b where a.tabid=b.tabid and b.constrtype ='P');
--获取所有用户表的外键约束名称
select a.tabname,b.constrname from systables a join sysconstraints b on a.tabid=b.tabid where a.tabid >99 and a.tabtype='T' and b.constrtype ='R' order by a.tabname
--获取所有未设置外键约束的用户数据表OK
Select * from systables a where tabid >99 and tabtype='T' and not exists (Select 1 from sysconstraints b where a.tabid=b.tabid and b.constrtype ='R');
--获取所有用户表的检查约束名称
select a.tabname,b.constrname from systables a join sysconstraints b on a.tabid=b.tabid where a.tabid >99 and a.tabtype='T' and b.constrtype ='C' order by a.tabname
--获取所有未设置检查约束的用户数据表OK
Select * from systables a where tabid >99 and tabtype='T' and not exists (Select 1 from sysconstraints b where a.tabid=b.tabid and b.constrtype ='C');
--获取所有用户表的唯一约束名称
select a.tabname,b.constrname from systables a join sysconstraints b on a.tabid=b.tabid where a.tabid >99 and a.tabtype='T' and b.constrtype ='U' order by a.tabname
--获取所有未设置唯一约束的用户数据表OK
Select * from systables a where tabid >99 and tabtype='T' and not exists (Select 1 from sysconstraints b where a.tabid=b.tabid and b.constrtype ='U');
--获取所有用户表的非空约束名称
select a.tabname,b.constrname from systables a join sysconstraints b on a.tabid=b.tabid where a.tabid >99 and a.tabtype='T' and b.constrtype ='N' order by a.tabname
--获取所有未设置非空约束的用户数据表OK
Select * from systables a where tabid >99 and tabtype='T' and not exists (Select 1 from sysconstraints b where a.tabid=b.tabid and b.constrtype ='N');
- Informix数据表结构分析资料整理之约束查询代码
- Informix数据表结构分析资料整理之约束查询代码
- Informix数据表结构分析资料整理之约束查询代码
- Informix数据表结构分析资料整理之字段类型说明和查询SQL语句
- Informix数据表结构分析资料整理之字段类型说明和查询SQL语句
- Informix数据表结构分析资料整理之字段类型说明和查询SQL语句
- activiti 数据表结构分析
- 【oracle资料整理】--【8】约束
- MySQL之约束、修改数据表
- sql 查询数据表的结构
- Oracle查询数据表结构SQL
- AlphaGo结构资料整理
- 在INFORMIX环境下,向已存在的数据表增加字段并调整数据表primary key约束的操作流程
- wordpress代码分析之库结构分析
- INFORMIX数据库下之模糊查询match
- Oracle查询数据表结构/字段/类型/大小
- 脚本查询数据表结构返回,可扩展
- 整理代码结构
- java swing 设置窗口背景颜色
- Informix数据表结构分析资料整理之字段类型说明和查询SQL语句
- 割点割边 模板
- awt简单应用五 -单选框
- 从K近邻算法、距离度量谈到KD树、SIFT+BBF算法
- Informix数据表结构分析资料整理之约束查询代码
- awt简单案例六 -文本框TextField
- Android Fragments 详细使用
- .NET轻量级开发工具
- awt简单应用 布局管理器 BorderLayout GridLayout
- awt简单应用 panel面板
- KNOW: Design Pattern
- YII学习资料
- Awt事件处理机制