Excel使用技巧总结

本文介绍了一种利用Oracle数据库及PowerDesigner工具高效生成数据库表字段说明的方法,通过执行特定SQL脚本和PowerDesigner命令实现数据库字段注释的批量提取,并提供Excel技巧提升工作效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

情景:

    经理让我总结一份文档,需要用到数据库的字段说明,我瞬间感觉日了狗了。

    当我为可以一张表一张表粘(不用一个字段一个字段)而窃喜时,同事告诉我利用oracle 数据库, 和 powerdisner 自带工具生成的注释可以整个库一起复制粘贴过去,瞬间我真的感觉日了狗了, 因为此时我已经粘了80多张表700多行花了3个小时,正在我为浪费的时间而心痛之际, 也在为我能够自己忍受这种无聊的耐心而惊奇, 同时在想一定是负面情绪影响了我的想象力与智商。。。。

1、解决powerdisighner 生成的sql 不带中文注释的问题 (Oracle 11g)

摘自:https://www.cnblogs.com/saotao/p/4235441.html

PowerDesigner->Tools->Execute Commands->Edit/Run Scripts 

运行脚本如下:

 

Option   Explicit     

ValidationMode   =   True     

InteractiveMode   =   im_Batch    

   

Dim   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    

   

Private   sub   ProcessFolder(folder)     

On Error Resume Next    

      Dim   Tab   'running     table     

       for   each   Tab   in   folder.tables      

             if   not   tab.isShortcut   then      

                  tab.name   =   tab.comment    

                  Dim   col   '   running   column     

                   for   each   col   in   tab.columns      

                   if col.comment="" then     

                   else    

                        col.name=   col.comment     

                   end if    

                  next     

             end   if      

      next    

   

      Dim   view   'running   view     

       for   each   view   in   folder.Views      

             if   not   view.isShortcut   then      

                  view.name   =   view.comment     

             end   if      

      next    

   

      '   go   into   the   sub-packages     

      Dim   f   '   running   folder     

      For   Each   f   In   folder.Packages     

             if   not   f.IsShortcut   then      

                 ProcessFolder   f     

             end   if      

      Next     

end   sub  



2、利用oracle 数据库生成表名、字段说明、字段长度、与字段经度的 sql

select a.table_name,u.comments,a.comments,case when b.data_type = 'CHAR' then '字符串类型C'  when b.data_type = 'VARCHAR2' then '字符串类型C' when b.data_type = 'NVARCHAR2' then '字符串类型C' when  data_type ='DATE' THEN '日期类型D' when data_type = 'NUMBER' THEN '整型I' when b.data_type = 'TIMESTAMP(6)' then '日期时间型T' ELSE data_type end dsds,case when b.char_col_decl_length is null then case when data_precision is null then data_length else data_precision end else b.char_col_decl_length end lm,b.data_scale from user_col_comments a left join 
      all_tab_columns b on a.table_name = b.table_name and b.column_name = a.column_name 
      left join user_tab_comments u on a.table_name = u.table_name

3、批量的进行excel的合并单元格

    https://jingyan.baidu.com/article/15622f24783e18fdfcbea59a.html

    数据分组合并

4、在excel 中使用筛选的功能

    数据-> 筛选

总结:

    1、工作中要多想我做的这种方式是不是最好的方式,有没有更好的方式可以更快的完成任务, 然后可以不用加班回家该干啥干啥

    2、工作中对于业务上的东西要多留心学习,记忆, 不懂时要虚心请教。

    3、对许盟盟要好一点, 无论她怎么对我,我都得像对待初恋一样对她。




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值