隨筆-204  評論-90  文章-8  trackbacks-0
          存儲過程出下:(注:我使用的是oracle 10g)
           
          procedure aaaa(i_vc2mob      in varchar2--用戶號碼
                                   i_NUMSVCID    in PLS_INTEGER default null--SERVICECODEID
                                   i_prodid      in PLS_INTEGER default null--產品ID
                                   i_disordsrc   in PLS_INTEGER, --退定來源
                                   i_disordsrcid in NUMBER--退定來源ID
                                   i_datdisorder in date default sysdate, --退定時間
                                   o_prodid      out PLS_INTEGER, --返回產品ID 
                                   o_level       out PLS_INTEGER, --返回用戶級別
                                   o_flag        out PLS_INTEGER --返回狀態
                                   ) is



          在java中調用正確調用方法:
          {call aaaa('13472622059',1,1,21,4712032059528901,'',?,?,?)}

          如果這樣寫
          {call aaaa('13472622059',1,1,21,4712032059528901,,?,?,?)}
          就報如下異常:
          java.sql.SQLException: ORA-06550: 第 1 行, 第 67 列:
          PLS-00103: 出現符號 ","在需要下列之一時:
           ( - + case mod new not null
             others <an identifier> <a double-quoted delimited-identifier>
             <a bind variable> avg count current exists max min prior sql
             stddev sum variance execute forall merge time timestamp
             interval date
             <a string literal with character set specification>
             <a number> <a single-quoted SQL string> pipe
             <一個帶有字符集說明的可帶引號的字符串文字>
             <一個可帶引號的 SQL 字符串>
          符號 "null" 被替換為 "," 后繼續。

              at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
              at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
              at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
              at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)
              at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)
              at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)
              at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
              at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
              at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)
              at com.pub.comm.db.DBDeal.callProcedures2(DBDeal.java:36)
              at com.pub.comm.db.Test.<init>(Test.java:15)
              at com.pub.comm.db.Test.main(Test.java:29)

          posted on 2007-12-03 21:07 一凡 閱讀(21959) 評論(0)  編輯  收藏 所屬分類: DATABASE
          主站蜘蛛池模板: 长葛市| 平凉市| 白沙| 英超| 丰县| 吉安县| 灌阳县| 肃宁县| 佛山市| 略阳县| 四子王旗| 五峰| 凌海市| 海丰县| 泽州县| 浦城县| 泸西县| 巴马| 朔州市| 阿克陶县| 高淳县| 青阳县| 望江县| 蒙城县| 南投市| 格尔木市| 通州区| 彰武县| 剑阁县| 南雄市| 上虞市| 永年县| 观塘区| 班戈县| 南木林县| 仙游县| 黄陵县| 慈溪市| 北碚区| 阜平县| 平定县|