本文介绍了C#OracleParameter - >使用包结构参数PL / SQL插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 如何在SP中使用struct packages参数插入。How to insert using struct packages parameter in SP.包含参数的proc OraHelper .ExecuteNonQuery(conn, CommandType .StoredProcedure, " TESTEPAC" ,参数); OraHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, "TESTEPAC", parameters); - 表创建 表 TABELABASE ( IDENTIFICADOR INTEGER , DESCRICAO VARCHAR2 ( 30 ), DATAINCLUSAO DATE ) create table TABELABASE(IDENTIFICADOR INTEGER,DESCRICAO VARCHAR2(30),DATAINCLUSAO DATE) - Pack 创建 或 替换 包 pacTeste_emn IS TYPE teste_cursor 表 varchar2 ( 50 )索引 by binary_integer ; - TYPE teste_cursor是引用光标; 类型 TabelaBase 是 记录 (Identificador int , Descricao varchar2 ( 30 ), DataInclusao 日期 ); 类型 Tabela 是 表 TabelaBase 索引 by binary_integer ; 结束; create or replace package pacTeste_emn ISTYPE teste_cursor is table of varchar2(50) index by binary_integer;-- TYPE teste_cursor is ref cursor;type TabelaBase is record(Identificador int ,Descricao varchar2(30) ,DataInclusao Date);type Tabela is table of TabelaBase index by binary_integer;End; - SP CREATE OR REPLACE 程序 TestePac( pacTeste_Emn.Tabela中的标签, in out varchar2 )是 开始 if tab。 count = 0 然后 erro:= 'OCORREU UM ERRO!'; 返回; 结束 如果; FOR i in 0 .. NVL(tab。最后, - 1 ) LOOP 插入 进入 TabelaBase(Identificador,Descricao,Datainclusao) 值(tab(i).Identificador,tab(i).Descricao,tab(i).Datainclusao); 结束 循环; erro:= erro || '' || ' - Teste'; 结束; CREATE OR REPLACE Procedure TestePac ( tab in pacTeste_Emn.Tabela,erro in out varchar2) isBeginif tab.count = 0 thenerro := 'OCORREU UM ERRO!';return;end if;FOR i in 0..NVL(tab.LAST, -1) LOOPInsert into TabelaBase(Identificador, Descricao, Datainclusao)Values(tab(i).Identificador, tab(i).Descricao, tab(i).Datainclusao);end loop;erro := erro || ' ' || ' - Teste';end;  推荐答案 Dáumaolhada nos links: http://www.dotnetforce.com/Content.aspx? t = a& n = 243 http://support.microsoft.com/kb/310101/pt-br []的 选择útil,não的帖子esqueçadeMarcá-lo !!! 这篇关于C#OracleParameter - >使用包结构参数PL / SQL插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-25 09:19