oracle 获得字段信息,以及将字段转换为驼峰格式

1,获得表字段

SELECT

a.COLUMN_NAME columnName, --字段名

nvl2(a.DATA_SCALE,a.DATA_TYPE||'('||a.DATA_LENGTH||','||a.DATA_SCALE||')',a.DATA_TYPE||'('||a.DATA_LENGTH||')')lx,

comments

FROM

user_tab_columns a

INNER JOIN user_tables d on a.TABLE_NAME=d.TABLE_NAME 

LEFT JOIN user_col_comments m ON m.COLUMN_NAME=a.COLUMN_NAME AND m.TABLE_NAME=d.TABLE_NAME

LEFT join user_tab_columns b on m.table_name=b.table_name and m.column_name=b.column_name

where d.TABLE_NAME='SF_EQ_PERFECT_INFO' order by b.column_id

2,获得字段的驼峰格式

select lower(substr('first_second_three',1,1)) || substr(REPLACE(INITCAP('FIRST_second_three'),'_',''),2) from dual


爆款云服务器s6 2核4G 低至0.46/天,具体规则查看活动详情Blog Img