sql server 2005: --SQL SERVER 2005 生成代码需要知道的SQL语句 use LibrarySystem --查询当前数据库所有表和其的主键字段,字段类型,长度,是否为空值 SELECT d.name as 'TableName',a.name as 'FieldName',b.name as 'TypeName',a.length as 'Length',a.isnullable as 'IS_NULL' FROM syscolumns a, systypes b…
-- Oracle 11 G --20160921 涂聚文再次修改 --Geovin Du --GetTables SELECT owner, object_name, created FROM all_objects WHERE (owner in ( select USERNAME from user_users )) AND object_type = 'TABLE' ORDER BY owner, object_name; ---GEOVIN SELECT owner, object_n…
#数据库MySQL 6.7 use sakila; #查询表名 show tables; # SELECT TABLE_NAME,TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='sakila'; select column_name from information_schema.columns where table_schema='sakila' and table_name='actor'; #表结构 字段名, 类…
ref: https://www.postgresql.org/docs/9.6/static/plpgsql-structure.html 一. 函数结构 CREATE FUNCTION somefunc(integer, text) RETURNS integer AS 'function body text' LANGUAGE plpgsql; PL/pgSQL是块结构(block-structured)语言,上面示例里的function body必须是一个块(block),块结构如下 […
一.基本语法(以及与informix的比较) create [or replace] procedure procedure_name (varible {IN|OUT|IN OUT} type) {IS|AS} [varible { in | out | in out }] type;[varible { in | out | in out }] type;...... [cursor curor_name IS select subclause] begin body e…