当前位置:编程学习 > C#/ASP.NET >>

C#如何 调用带有二维数组(动态表)参数的ORACLE存储过程。多谢

CREATE OR REPLACE TYPE TYPE_ORDERDTL AS OBJECT
(
  order_no     VARCHAR2(20),
  order_num    NUMBER(3),
  goods_typeid VARCHAR2(10),
  goods_type   VARCHAR2(100),
  goods_name   VARCHAR2(60),
  goods_packid VARCHAR2(10),
  goods_pack   VARCHAR2(100),
  goods_qty    NUMBER(10, 2),
  goods_weight NUMBER(10, 2),
  goods_length NUMBER(10, 2),
  goods_width  NUMBER(10, 2),
  goods_height NUMBER(10, 2),
  goods_volume NUMBER(10, 2),
  goods_fee    NUMBER(10, 2),
  goods_remark VARCHAR2(200),
  ins_user     VARCHAR2(10),
  upd_user     VARCHAR2(10)
)

CREATE OR REPLACE TYPE TYPE_ORDERDTL_ARR AS TABLE OF TYPE_ORDERDTL


CREATE OR REPLACE PROCEDURE SP_T_ORDER_TEST(i_ARR_ORDERFEE TYPE_ORDERFEE_ARR) AS
 
  V_DATE VARCHAR2(20);

  E_ORDER_DTL_UNEXISTS EXCEPTION;
  E_ORDER_FEE_UNEXISTS EXCEPTION;
  E_ORDER_NO_EXISTS    EXCEPTION;
  E_ROUTE_ERROR        EXCEPTION;
BEGIN
  --取系统时间
  SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD hh24:mi:ss') INTO V_DATE FROM DUAL;

  IF i_ARR_ORDERDTL.COUNT = 0 THEN
      RAISE E_ORDER_DTL_UNEXISTS;
    END IF;
    FOR i IN 1 .. i_ARR_ORDERDTL.COUNT LOOP
      INSERT INTO T_DTL
        (ORDER_NO,
         ORDER_NUM,
         GOODS_TYPEID,
         GOODS_TYPE,
         GOODS_NAME,
         GOODS_PACKID,
         GOODS_PACK,
         GOODS_QTY,
         GOODS_WEIGHT,
         GOODS_LENGTH,
         GOODS_WIDTH,
         GOODS_HEIGHT,
         GOODS_VOLUME,
         GOODS_FEE,
         GOODS_REMARK,
         INS_USER,
         INS_DATE)
      VALUES
        (i_ARR_ORDERDTL(i).ORDER_NO,
         i_ARR_ORDERDTL(i).ORDER_NUM,
         i_ARR_ORDERDTL(i).GOODS_TYPEID,
         i_ARR_ORDERDTL(i).GOODS_TYPE,
         i_ARR_ORDERDTL(i).GOODS_NAME,
         i_ARR_ORDERDTL(i).GOODS_PACKID,
         i_ARR_ORDERDTL(i).GOODS_PACK,
         i_ARR_ORDERDTL(i).GOODS_QTY,
         i_ARR_ORDERDTL(i).GOODS_WEIGHT,
         i_ARR_ORDERDTL(i).GOODS_LENGTH,
         i_ARR_ORDERDTL(i).GOODS_WIDTH,
         i_ARR_ORDERDTL(i).GOODS_HEIGHT,
         i_ARR_ORDERDTL(i).GOODS_VOLUME,
         i_ARR_ORDERDTL(i).GOODS_FEE,
         i_ARR_ORDERDTL(i).GOODS_REMARK,
         i_ARR_ORDERDTL(i).INS_USER,
         TO_DATE(V_DATE, 'YYYY-MM-DD hh24:mi:ss'));
    END LOOP;

END SP_T_ORDER_TEST;


C#如何 调用带有二维数组(动态表)参数的ORACLE存储过程。多谢。 --------------------编程问答-------------------- 说明:通过ODP.NET访问 --------------------编程问答-------------------- 怎么没人回答啊? --------------------编程问答-------------------- --------------------编程问答-------------------- 无法直接实现,你只能使用临时表存放数据后,再通过临时表调用该存储过程。 --------------------编程问答-------------------- --------------------编程问答-------------------- 继续等待有高手 --------------------编程问答-------------------- 已经有高手给你回答了,你竟然无视并且再等待。。。 --------------------编程问答-------------------- 那只有另寻它法了。
补充:.NET技术 ,  C#
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,