开发者

Get attribute from Oracle object

开发者 https://www.devze.com 2023-02-15 14:31 出处:网络
I want to get the value of an attribute of an Oracle object. This is my object: create type demo_obj as object( val1 number, val2 number, val3 number );

I want to get the value of an attribute of an Oracle object. This is my object:

create type demo_obj as object( val1 number, val2 number, val3 number );

And here is the array:

create type demo_array as table of demo_obj;

I create a procedure like this:

create or replace procedure proc_obj_demo ( obj_array DEMO_ARRAY )
as begin

FOR i IN 1..obj_array.COUNT
 LOOP
     INSERT INTO test_strings (s) VALUES (obj_array(i).demo_obj.val1);  //here's the     error

 END LOOP;
end;
开发者_C百科

But how can I get the value of an attribute of an Oracle object?


Change the line to:

 INSERT INTO test_strings (s) VALUES (obj_array(i).val1);
0

精彩评论

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