原文地址: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数据表结构分析资料整理之约束查询代码的更多相关文章

  1. Zabbix的数据表结构

    看到Zabbix的数据表结构吧,就知道数据量大了 性能问题很让人担忧,不过基于Zabbix数据库导出报表,或自动跑报表的时候,就必须去了解一下zabbix的数据表结构了,得知道XX放在哪才能找到XX, ...

  2. 25 Zabbix系统数据表结构介绍

    点击返回:自学Zabbix之路 点击返回:自学Zabbix4.0之路 点击返回:自学zabbix集锦 25 Zabbix系统数据表结构介绍 自学Zabbix之路15.1 Zabbix数据库表结构简单解 ...

  3. navicat如何导出mysql数据表结构

    我们在创建数据库时会对字段进行设置,比如类型.长度等,如果字段多的话一个个设置非常麻烦,可以从其他地方已有的表导入数据表结构,怎么操作呢?我们拿navicat导出mysql数据表结构为例: 1.点击“ ...

  4. (笔记)Mysql命令desc:获取数据表结构

    desc命令用于获取数据表结构. desc命令格式:    desc 表名;同样    show columns from 表名;也能获取数据表结构. 举例如下:mysql> desc MyCl ...

  5. phpmyadmin数据表结构没有显示注释列

    新开的一个项目,用phpmyadmin作为图形化操作数据库工具.创建数据表时为其每列添加好注释,浏览数据表内容有显示注释内容,但是查看数据表结构没有显示注释列,不方便直观查看数据表每列的意思. 上网搜 ...

  6. Activiti学习(二)数据表结构

    Activiti工作流引擎数据库表结构 数据库表的命名 Acitiviti数据库中表的命名都是以ACT_开头的.第二部分是一个两个字符用例表的标识.此用例大体与服务API是匹配的. l        ...

  7. jdbcTemplate 获取数据表结构

    jdbcTemplate 操作方法 /** *1.方法一: */ String sql = "select * from "+ tableName; //RowCountCallb ...

  8. mysql导出数据表结构,必须退出mysql命令.重新使用msyqldump命令

    只导出数据库中所有表结构(-d 减去数据) 导出所有表结构和数据 mysqldump -uroot --default-character-set=utf8 -p123-d必须空格good>H: ...

  9. python --商品评价---- 数据表结构以及理解

    商品评论(评价)功能 1.概述 评论功能已经成为APP和网站开发中的必备功能.本文主要介绍评论功能的数据库设计. 评论功能最主要的是发表评论和回复评论(删除功能在后台).评论功能的拓展功能体现有以下几 ...

随机推荐

  1. FZU 2086 餐厅点餐(模拟)

    Problem 2086 餐厅点餐 Problem Description Jack最近喜欢到学校餐厅吃饭,好吃干净还便宜. 在学校餐厅,有a种汤,b种饭,c种面条,d种荤菜,e种素菜. 为了保证膳食 ...

  2. Jquery Easyui与Jquery Bootstrap(Metronic Bootstrap)的简单比较

    1,通常来看WEB前端用 bootstrap 比较好,后台用EASYUI比较好.Easyui适合工厂企业的管理系统如ERP,CRM之类的,Bootstrap适用于多屏跨设备浏览. 简言之,一个适合上班 ...

  3. 修改release management client对应的服务器的地址

    参考资料:http://stackoverflow.com/questions/25313053/how-to-change-a-release-management-server-name-in-r ...

  4. BIEE应用存储过程并从前台传参

    1.     RPD操作 1.1修改连接池属性 在连接脚本添加SQL,这里选择在查询前执行 新建SQL脚本

  5. U3D音频系统

    一.基本信息 1.支持的声音格式 WAV OGG MP3 AIFF MOD S3M xm IT    导入以后,unity会选择的压缩方式: WAV:无损,音质好,文件大,适用于较短文件 OGG.MP ...

  6. Java错误提示is not an enclosing class

    今天脑袋晕乎乎的,犯了个低级错误,好半天才反应过来 一直提示:is not an enclosing class 我居然把 RegisterActivity.class 写成了 RegisterAct ...

  7. 回文质数 Prime Palindromes

    题目描述 因为151既是一个质数又是一个回文数(从左到右和从右到左是看一样的),所以 151 是回文质数. 写一个程序来找出范围[a,b](5 <= a < b <= 100,000 ...

  8. 万恶的tileMap

    先吐槽下.. 本来,我们准备用tileMap来做地图的,但发现一个问题,就是tileMap层中不能添加cc.Sprite,这导致了tileMap只适合做2D平面没有遮挡的游戏,并且主角是不能有效率的进 ...

  9. Blob写入文件

    1.Spring自带方法,定义输出流就可以写入文件 final OutputStream os; os = new FileOutputStream(new File("300.zip&qu ...

  10. DB2中coalesce函数的应用

    在ETL项目中经常会碰到这样的一种情况: 目标表中的某列来源于不同的源数据表A,B,C.如果在A中没有有效的数据则从B中取,如果B中没有则从C中取,如果C中也没有则设置为空值. 遇到这样的情况可能,有 ...