zoukankan      html  css  js  c++  java
  • 发布Oracle存储过程包c#代码生成工具(CodeRobot)

        无可致否,代码生成器对于程序员的帮助是越来越大。网上出现了一些优秀的代码工具,比较出名的如:CodeSmith, MyGeneration。但我一直没有找到直接将oracle存储过程包转化为c#的工具或模板(有谁知道告知我啊非常感谢!:),故在工作中编写了CodeRobot这个小冬冬>,使用起来是比较方便的。以下简要说明一下使用方法:

        (1)生成的代码基于OracleBase类(用于数据库开闭及command参数预处理)。请将该类包含进工程。
        (2)数据库连接字符串默认保存在工程的config配置文件中,如
             <add key="ConnStr" value="data source=portal; user id=user; password=pass;"/>
        (3)对于字符串类型的输出参数,在生成C#代码类似
             AddCmdParamOut(cmd, "P_NAME", OracleType.VarChar, #length#);
             的代码,请将#length#改成对应字段的实际长度
        (4)对于游标类型的输出参数,在oracle中定义为:
             type genrefcur is ref cursor;
             
    procedure example(p_id int, p_cur out genrefcur);
             则生成C#代码为:
             public void EXAMPLE(long P_ID, out OracleDataReader P_CUR)
        (5)使用代码如:
             using (DbExample db = new DbExample)
             
    {
                 db.FUNC1(..);
                 db.FUNC2(..);
             }


     

    ---------------------------------------------
    What's new
    ---------------------------------------------
    Ver 1.1.* (下载)
        - 可使用Pascal格式化函数名和参数名
        - 修正无法获取 oracle 10g dsn列表的问题

    Ver 1.0.2764 (下载)
        - 使用ICSharpCode.TextEditor 展现代码

    Ver 1.0.2448
        - 添加Blob支持
        - 简化OracleBase

    Ver 1.0.2167:
        - 自动获取oracle dsn列表
        - 支持存储过程(函数)
        - 支持DataReader, DataSet, DataTable输出
        - 一些小bug

    转载请注明出处:http://surfsky.cnblogs.com 

  • 相关阅读:
    PAT (Advanced Level) 1060. Are They Equal (25)
    PAT (Advanced Level) 1059. Prime Factors (25)
    PAT (Advanced Level) 1058. A+B in Hogwarts (20)
    PAT (Advanced Level) 1057. Stack (30)
    PAT (Advanced Level) 1056. Mice and Rice (25)
    PAT (Advanced Level) 1055. The World's Richest (25)
    PAT (Advanced Level) 1054. The Dominant Color (20)
    PAT (Advanced Level) 1053. Path of Equal Weight (30)
    PAT (Advanced Level) 1052. Linked List Sorting (25)
    PAT (Advanced Level) 1051. Pop Sequence (25)
  • 原文地址:https://www.cnblogs.com/surfsky/p/301370.html
Copyright © 2011-2022 走看看