开发者

Pass a string array to PL/SQL from Pro*C

I have a procedure in a package

create or replace package MyPack
  type MyArr is table of varchar2(30) index by pls_integer;

  prodecure开发者_开发技巧 MyProc(p in MyArr);
end MyPack;

and I want to call it from Pro*C. So I have (all the rest of the function left out)

char my_arr[50][30] = {0};

EXEC SQL EXECUTE
  BEGIN
    MyPack.MyProc(:my_arr);
  END;
END-EXEC;

When I try to compile this I get the error

"PLS-S-00418, array bind type must match PL/SQL table row type"

Any ideas on what I am doing wrong?


see Sample Program 9: Calling a stored procedure I think this fits your description.


I had a similar problem. I was trying to pass an c++ array,

char names[10][10] = { "Tom", "Dick", "Harry", ... };

to a stored procedure. The solution was to declare the procedure parameter as

TYPE NameTab IS TABLE OF CHAR(10) INDEX BY BINARY_INTEGER;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜