All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
Visual C++ 6.0教程:c++数据类型之结构
添加数据集(DataSet)、数据表(DataTable)、行、列、主键和外键等操作示例代码_[Asp.Net教程]
使用ADO.net将数据导出到Excel并提供下载_[Asp.Net教程]
visual c++中对话框类CDialog的用法
ASP.net实现无扩展名的URL重写。简单、方便、无需ISAPI_[Asp.Net教程]
如何在PHP中进行身份认证_[PHP教程]
Visual C++ 6.0教程:条件编译指令
ASP.NET中生成条形码_[Asp.Net教程]
ASP.NET页面事件:顺序与回传详解_.net资料_编程技术
AjaxPro与服务器端交互过程中如何传值_[AJAX教程]
Reading number is top 10 pictures
全身蕾丝丝质美臀
采访美女孙菲菲
Fury xp desktop theme
西方气质的东方美女2
猫眯也疯狂
西班牙山村小景4
Take you to walk into the most true north Korea rural1
性感丰满身材火爆de美女2
联通的3G无线网卡我只用了一天,看看流量......
Sell the barbecue as says father du breul4
Download software ranking
The king of fighters 97(Mobile phone games-apk)
C++教程第四版
Kung.Fu.Panda.2
asp.netWeb服务器高级编程
Tram sex maniac 2 (H) rar bag3
Unix video tutorial9
美女写真3
Macromedia Dreamweaver 8
c#程序设计案例教程
双旗镇刀客B
归海一刀 published in(发表于) 2014/2/1 0:14:20 Edit(编辑)
Sqlserver如何创建语言辅助函数_[SQL,Server教程]

Sqlserver如何创建语言辅助函数_[SQL,Server教程]

Sqlserver如何创建语言辅助函数_[SQL Server教程]

context('userenv','lang') and num = n;
      return l_word;
    exception
      when no_data_found then
        return null;
    end;
    --
    function cardinal(n number) return varchar2
    is
      p number;    -- power
      t varchar2(30); -- template
      v number;    -- lower portion
      l_word   numwords.word%type;
    begin
      if n < 0 then
        l_word := get_word(-1);
        if l_word is null then
          return null;
        end if;
        return l_word||' '||cardinal(-n);
      end if;
      l_word := get_word(n);
      if l_word is not null then
        return l_word;
      end if;
      for row in
      (
        select * from numrules
         where lang = sys_context('userenv','lang')
         order by seq
      )
      loop
        if length(n) <= row.p1 + row.p2 then
          p := power(10,row.p2);
          v := mod(n,p);
          if row.seq = 0 then
            if n < 20 then
              return replace(row.temp0,'~2',cardinal(v));
            end if;
          else
            if v = 0 then
              return replace(row.temp0,'~1',cardinal(n/p));
            else
              return replace(replace(nvl(row.temp,'~1 ~2'),
                '~1',cardinal(n-v)),
                '~2',cardinal(v));
            end if;
          end if;
        end if;
      end loop;
      return 'NUMBER TOO LARGE';
    end cardinal;
  end genword;
  /
  show errors;

最后,这里是我为英语和德语收集的一些数据。我还将数据从美国英语拷贝到英国英语中并使用术语“thousand million”和“million million”代替“billion”和“trillion”(美国用法),在美国之外这两个短语通常是混淆的来源。这些数据对生成-999,999,999,999到999,999,999,999之间所有整数(包括零)的拼写版本已经足够了。



REM -- create a table of base words and exceptions
  create or replace package genword
  as
    function get_word(n number) return varchar2;
    function cardinal(n number) return varchar2;
  end genword;
  /
  show errors;
  
  create or replace package body genword
  as
    function get_word(n number) return varchar2
    is
      l_wordnumwords.word%type;
    begin
      select word into l_word from numwords
       where lang = sys_context('userenv','lang') and num = n;
      return l_word;
    exception
      when no_data_found then
        return null;
    end;
    --
    function cardinal(n number) return varchar2
    is
      p number;    -- power
      t varchar2(30); -- template
      v number;    -- lower portion
      l_word   numwords.word%type;
    begin
      if n < 0 then
        l_word := get_word(-1);
        if l_word is null then
          return null;
        end if;
        return l_word||' '||cardinal(-n);
      end if;
      l_word := get_word(n);
      if l_word is not null then
        return l_word;
      end if;
      for row in
      (
        select * from numrules
         where lang = sys_context('userenv','lang')
         order by seq
      )
      loop
        if length(n) <= row.p1 + row.p2 then
          p := power(10,row.p2);
          v := mod(n,p);
          if row.seq = 0 then
            if n < 20 then
              return replace(row.temp0,'~2',cardinal(v));
            end if;
          else
            if v = 0 then
              return replace(row.temp0,'~1',cardinal(n/p));
            else
              return replace(replace(nvl(row.temp,'~1 ~2'),
                '~1',cardinal(n-v)),
                '~2',cardinal(v));
            end if;
          end if;
        end if;
      end loop;
      return 'NUMBER TOO LARGE';
    end cardinal;
  end genword;
  /
  show errors;


  下面是一些简单的 SQL 语句,这些语句使用了前面提供到函数和数据。你可以试一下将语言设成‘GERMAN’,或‘ENGLISH’来测试其它两组数据:

SQL> alter session set nls_language = 'AMERICAN';
  SQL> select genword.cardinal(123456789) from dual;
  
  one hundred twenty-three million four hundred fifty-six thousand seven hundred
  eighty-nine


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.