PowerDesign9.5+中的GTL解决大问题

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

在开发模型时,通常会有这样的需求
输入一个表或字段的中文名称自动生成它的中文拼音首字母简写功能
如:
设备_变压器 自动形成数据库表名 SB_BYQ

在POWERDesigner9.5以上版本中可以这样设置
打开1。Tools>ModelOptions..对话框 
          2。点击左边NameConvension树形结点
         3。在右边面板中选择Name/CodeConvensions选择框
         4。在Name/Code页中ConvensionScript输入框中输入下面的代码
 .foreach_part(%Name%,".")
.vbscript(%CurrentPart%)
ScriptResult=getpy(ScriptInputArray(0))
functiongetpychar(char)
tmp=65536+asc(char)
if(tmp>=45217andtmp<=45252)then
getpychar="A"
elseif(tmp>=45253andtmp<=45760)then
getpychar="B"
elseif(tmp>=45761andtmp<=46317)then
getpychar="C"
elseif(tmp>=46318andtmp<=46825)then
getpychar="D"
elseif(tmp>=46826andtmp<=47009)then
getpychar="E"
elseif(tmp>=47010andtmp<=47296)then
getpychar="F"
elseif(tmp>=47297andtmp<=47613)then
getpychar="G"
elseif(tmp>=47614andtmp<=48118)then
getpychar="H"
elseif(tmp>=48119andtmp<=49061)then
getpychar="J"
elseif(tmp>=49062andtmp<=49323)then
getpychar="K"
elseif(tmp>=49324andtmp<=49895)then
getpychar="L"
elseif(tmp>=49896andtmp<=50370)then
getpychar="M"
elseif(tmp>=50371andtmp<=50613)then
getpychar="N"
elseif(tmp>=50614andtmp<=50621)then
getpychar="O"
elseif(tmp>=50622andtmp<=50905)then
getpychar="P"
elseif(tmp>=50906andtmp<=51386)then
getpychar="Q"
elseif(tmp>=51387andtmp<=51445)then
getpychar="R"
elseif(tmp>=51446andtmp<=52217)then
getpychar="S"
elseif(tmp>=52218andtmp<=52697)then
getpychar="T"
elseif(tmp>=52698andtmp<=52979)then
getpychar="W"
elseif(tmp>=52980andtmp<=53640)then
getpychar="X"
elseif(tmp>=53689andtmp<=54480)then
getpychar="Y"
elseif(tmp>=54481andtmp<=62289)then
getpychar="Z"
else'如果不是中文,则不处理
getpychar=char
endif
endfunction


functiongetpy(str)
fori=1tolen(str)
getpy=getpy&getpychar(mid(str,i,1))
next
endfunction

.endvbscript





<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
文章标签: 数据库 c
个人分类: 数据库
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭