oracle查询表关联字段名,ORACLE查询表的字段名几种方式

1、oracle查询表的字段名并连接成用逗号隔开的字符串  select max(substr(SYS_CONNECT_BY_PATH(COLUMN_NAME, ','),2)) col from (  select 'a.'||COLUMN_NAME as COLUMN_NAME,column_id from sys.user_tab_columns  where table_name='ENTBT_ENT_INFO_OUT')  start with column_id=1  connect by column_id=rownum;  2、oracle查询表的字段名  select 'private String  '||T.COLUMN_NAME||'= null ;     //'||T.COMMENTS from sys.all_col_comments t  where t.owner ='CIQAGENT' AND T.TABLE_NAME ='T_ENT_MONEY'  3、oracle查询表的字段名并转成小写  select ­ 'BuildBtEntUsrInfoSbf.append(""+'  || 'BtEntUsrinfo[i]+' || '"'||Lower(REPLACE(T.COLUMN_NAME,'_',''))|| '>");'  from sys.all_col_comments t  where t.owner ='DVNEWS' AND T.TABLE_NAME ='ORGBT_ENT_USR_IN'  select 'BuildCtCerInfoSbf.append(""+' || 'CtCerInfo['||to_number(T.COLUMN_ID-1)||']+' || '"'||T.COLUMN_NAME|| '>");' from sys.user_tab_columns t where T.TABLE_NAME ='CT_CER' select column_id,'digester.addCallMethod("message/ctsf/'||Lower(replace(T.COLUMN_NAME,'_',''))||'","set'||T.COLUMN_NAME||'",0 );'    from sys.user_tab_columns t ­ where t.table_name = 'CT_SF' order by t.COLUMN_ID ­ select ­        replace('OutEntInfoSbf.append(OutEntInfo.get' || T.COLUMN_NAME || '());'||         chr(13)||'OutEntInfoSbf.append(",");','""','') ­   from sys.user_tab_columns t  where t.table_name = 'BT_ENT_INFO'  order by t.COLUMN_ID select         'if(!Utility.chgnulltospace(OutEntInfo.get' || T.COLUMN_NAME || '()).equals(""))'       ||chr(13)||'{'       ||chr(13)||'OutEntInfoSbf.append("'||T.COLUMN_NAME||'=");'       ||chr(13)||'OutEntInfoSbf.append("''");'       ||chr(13)||'OutEntInfoSbf.append(Utility.chgnulltospace(OutEntInfo.get' || T.COLUMN_NAME || '()));'       ||chr(13)||'OutEntInfoSbf.append("''");'       ||chr(13)||'OutEntInfoSbf.append(",");'       ||chr(13)||'}'   from sys.user_tab_columns t where t.table_name = 'CT_SF' order by t.COLUMN_ID  select '//' || t.COMMENTS || chr(13) || 'private String  ' || b.COLUMN_NAME ||        '= null ;'   from sys.all_col_comments t, user_tab_columns b  where t.table_name= b.TABLE_NAME and t.column_name=b.COLUMN_NAME    and t.owner = 'DVCOMM'    AND T.TABLE_NAME = 'DVINSP_ORI_INV_INFO'  order by b.COLUMN_ID select 'PerInfo.set'||T.COLUMN_NAME || '(Utility.chgnull(rest.getString("'||T.COLUMN_NAME||'")))'||';' from sys.user_tab_columns t where T.TABLE_NAME ='S_PER_INFO' order by t.COLUMN_ID select 'sbf.append(""+' || 'Utility.chgnull(PerInfo.get'||T.COLUMN_NAME||'())+' || '"'||T.COLUMN_NAME|| '>");' from sys.user_tab_columns t where T.TABLE_NAME ='S_PER_INFO' order by t.COLUMN_ID

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值