PPAs is the Enterprisedb company's PostgreSQL database product Postgres Plus advised Server.
Here's a look at the example:
1
--Create a table
CREATE TABLE TABLE2
(COLUMN1 number (10,0),
COLUMN2 VARCHAR2 (20),
COLUMN3 VARCHAR2 (20),
PRIMARY KEY (COLUMN1)
);
2
--Create Type
Create or replace type T_type is Object (Column2 varchar2 (), Column3 varchar2 (20));
3
--Create a stored procedure
Create or Replace procedure P_table_test (example T_type ARRAY)
As
V_count int:=0;
Begin
Select Array_length (example,1) into V_count;
ForAll I in 1..v_count
Insert into table2 (COLUMN1,COLUMN2,COLUMN3)
VALUES (i, example[i].column2, example[i].column3);
End
4
--Calling a stored procedure
DECLARE
V_example T_type ARRAY;
BEGIN
V_example: = Array[t_type (' Meeting ', ' Lunch '), T_type (' Training ', ' presentation ')];
EXEC p_table_test (v_example);
End;
5
--Check the results
dbtest=# select * from Table2;
Column1 | Column2 | Column3
---------+----------+--------------
1 | Meeting | Lunch
2 | Training | Presentation
(2 Line Records)