select t1.COLUMN_NAME 字段名,t1.DATA_TYPE 数据类型,t2.comments 注释 from (select t.COLUMN_NAME,t.DATA_TYPE from user_tab_columns t where t.TABLE_NAME=upper(‘vw_personbaseprint_data‘)) t1,(select tt.column_name,tt.comments from user_col_comments tt where tt.table_name=upper(‘vw_personbaseprint_data‘)) t2 where t1.COLUMN_NAME=t2.column_name本文出自 “11075795” 博客,谢绝转载!原文:http://11085...
select table_name from user_tables; //当前用户拥有的表
select table_name from all_tables; //所有用户的表
select table_name from dba_tables; //包括系统表
select table_name from dba_tables where owner=‘用户名‘
user_tables:
table_name,tablespace_name,last_analyzed等
dba_tables:
ower,table_name,tablespace_name,last_analyzed等
all_tables:
ower,table_name,tablespace_name,last_analyzed等
...
--数据库导出表,字段名,长度,类型,字段注释,表注释语句
SELECT T1.TABLE_NAME 英文表名,
T1.COLUMN_NAME 字段名,
T1.DATA_TYPE || ‘(‘ || T1.DATA_LENGTH || ‘)‘ 字段类型及长度,
T2.COMMENTS 字段注释,
t3.COMMENTS 表注释
FROM USER_TAB_COLS T1, USER_COL_COMMENTS T2,user_tab_comments t3
WHERE T1.TABLE_NAME = T2.TABLE_NAME
AND T1.COLUMN_NAME = T2.COLUMN_NAME and t3.TABLE_NAME = t1.TABLE_NAME and ...
大致语法为:
comment on TABLE table_name IS ‘备注内容‘;权限要求:
默认情况下用户只能给属于自己的对象添加注释。
如果要想给其他用户对象添加注释需要拥有权限:COMMENT ANY TABLE相关数据字段视图:
USER_TAB_COMMENTS
DBA_TAB_COMMENTS
ALL_TAB_COMMENTS
USER_COL_COMMENTS
DBA_COL_COMMENTS
ALL_COL_COMMENTS示例如下:
drop table t;
create table t(id number);select * from user_tab_comments;TABLE_NAME ...
效果如下:comment on column table1.Id is q‘{PK}‘;comment on column table1.col1 is q‘{Counterparty Organization ID}‘;comment on column table1.col2 is q‘{Agreement Description}‘;--生成html格式
SET MARKUP HTML ON SPOOL ON pre off entmap offSET ECHO OFFSET TERMOUT OFFSET TRIMOUT OFFset feedback offset heading onset linesize 200set pagesize 10000set timing offcol nullable for a8spool t1.htmlselec...
# coding=utf-8
__author__ = ‘jspdba‘
u‘‘‘
读取oracle注释
‘‘‘
import cx_Oracle # 导入模块SQL=r"""
select * from user_col_comments t where 1=1
and t.comments is not null
and t.table_name = ‘@TABLE‘
"""
words=["custom","code","trans","mode","date","confirm","balance","amount","after",
"type","area","game","flow","is","big","win","status","flag","num","client",
"reward","id"...
select table_name from user_tables; //当前用户拥有的表
select table_name from all_tables; //所有用户的表
select table_name from dba_tables; //包括系统表
select table_name from dba_tables where owner=‘用户名‘
user_tables:
table_name,tablespace_name,last_analyzed等
dba_tables:
ower,table_name,tablespace_name,last_analyzed等
all_tables:
ower,table_name,tablespace_name,last_analyzed等
...
获得表的注释,Oracle专用
public string GetTableDescription(){string result="";using (OracleConnection conn = new OracleConnection(this.SourceTable.Database.ConnectionString)){OracleCommand comm = new OracleCommand("select Comments from user_tab_comments where table_name=‘"+this.SourceTable.Name+"‘", conn); conn.Open();result =Convert.ToString(comm.ExecuteScalar());comm.Dispose();conn.Clos...
添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….);
修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….);
删除字段的语法:alter table tablename drop (column);
添加、修改、删除多列的话,用逗号隔开。
使用alter table 来增加、删除和修改一个列的例子。
创建表结构:create table test1(id varchar2(20) not null);
...
--创建表
create table test ( id varchar2(200) primary key not null,sort number, name varchar(200)
)
--字段加注释
comment on column test.id is ‘id‘;
comment on column test.sort is ‘序号‘;
--表加注释
comment on table test is ‘测试表‘
二.Mysql--创建表
create table test ( id varchar(200) not null,sort int(11) comment ‘排序‘,name varchar(200) comment ‘名称‘,
)
--表加注释
alter table tes...
table t_OUTString
(
Tname varchar2(50),
OUTString clob,
OUTSTRING2 clob,
createddate date
); create or replace procedure Pro_ExToSql(SStrin in varchar2 ,TString in varchar2) isRString varchar2(30000);RowString varchar2(30000);LeaveString varchar2(30000);midStr varchar2(30000);LeftStr varchar2(30000);RightStr varchar2(30000);V_Cname varchar2(100);V_Cty...
select table_name from user_tables; //当前用户拥有的表 select table_name from all_tables; //所有用户的表
select table_name from dba_tables; //包括系统表
select table_name from dba_tables where owner=‘用户名‘user_tables:
table_name,tablespace_name,last_analyzed等
dba_tables:
ower,table_name,tablespace_name,last_analyzed等
all_tables:
ower,table_name,tablespace_name,last_analyzed等
all_ob...
= True
InteractiveMode = im_BatchDim mdl ‘the current model‘get the current active model
Set mdl = ActiveModel
If (mdl Is Nothing) Then
MsgBox "There is no current Model"
ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) Then
MsgBox "The current model is not an Physical Data model."
Else
ProcessFolder mdl
End If‘This routine copy name into code for each table, each column and each view
‘of the current ...
table WARNINGRECORD
(RecordID varchar(36) primary key not null
);comment on column WARNINGRECORD.RecordID is ‘告警编号‘;
现在想通过pl/sql语句块执行,代码如下:declare tableExist number;
beginSelect count(1) into tableExist from all_tables where TABLE_NAME=‘WARNINGRECORD‘;if tableExist>0 thenexecute immediate ‘drop table WARNINGRECORD‘;return;end if;execute immediate ‘CREATE TABLE WARNINGREC...
table_name from user_tables; //当前用户拥有的表 select table_name from all_tables; //所有用户的表 select table_name from dba_tables; //包括系统表
表的注释select * from user_tab_comments; //当前用户拥有表的注释
select * from dba_tab_comments; //全部用户表的注释select * from all_tab_comments; //全部用户表的注释
dba_tab_comments, all_tab_comments 比 user_tab_comments 要多一个ower列
列的注释sel...