Hi, i have the following pl/sql Oracle function:
FUNCTION fun_vir_anti_detail (
av_id_codct IN cl_strutture.id_codct%type,
an_id IN cl_anagrafiche.id_anag%type
) RETURN wa_typ_epn_talk_vir_ant_tab;
END;
the return type 'wa_typ_epn_talk_vir_ant_tab' is define as:
CREATE OR REPLACE TYPE EMOINT.wa_typ_epn_talk_vir_ant_tab AS TABLE OF wa_typ_epn_talk_vir_ant_row
and 'wa_typ_epn_talk_vir_ant_row' is:
CREATE OR REPLACE TYPE EMOINT.wa_typ_epn_talk_vir_ant_row AS object (
vir_pazs_list wa_typ_epn_talk_vir_pazs_tab,
rich_ant_list wa_typ_epn_talk_rich_ant_tab,
test_coombs_list wa_typ_epn_talk_coombs_tab,
cod_errore VARCHAR2(50),
descr_errore VARCHAR2(200)
)
I need to get data using PB datawindow from the 'wa_typ_epn_talk_vir_ant_row' field, for example 'rich_ant_list' define as this type:
CREATE OR REPLACE TYPE EMOINT.wa_typ_epn_talk_rich_ant_tab AS TABLE OF wa_typ_epn_talk_rich_ant_row
where 'wa_typ_epn_talk_rich_ant_row' is:
CREATE OR REPLACE TYPE EMOINT.wa_typ_epn_talk_rich_ant_row AS object (
id_ric_abdy NUMBER(9),
id_anag NUMBER(7),
id_typc VARCHAR2(4),
rc_typc VARCHAR2(3),
id_unita NUMBER(9),
dtesecuz DATE,
esito_ric_abdy VARCHAR2(3),
operat VARCHAR2(8),
dtoperat DATE,
dtmedico DATE,
proven VARCHAR2(30 BYTE),
dtprel DATE,
dtstoriciz DATE,
tipo_storicz VARCHAR2(1),
note VARCHAR2(500),
.
.
.
.
.
)
i would like to retrieve data from the 'rich_ant_list' field of the 'wa_typ_epn_talk_rich_ant_row' type
but i don't know if it's possibile.
I could write this DW SQL :
SELECT
rich_ant_list
FROM TABLE ( CAST (emoint.wa_pkg_epn_int_talk.fun_vir_anti_detail (
'0201',
1)
AS EMOINT.wa_typ_epn_talk_vir_ant_tab))
but when i try to retrieve data the error is:
" Select Error: ORA-00932: inconsistent datatypes: expected %s got %s"
and the reason is clear, it's beacuse it tried to retrieve data from the field "rich_ant_list"
that is a table-field with different type.
I don't know if it's possible to write a subquery and cast the result type as 'wa_typ_epn_talk_rich_ant_tab'.
I tried many times and different ways but it doesn't works.
Any suggestions?
I'm using PB12.5
Thanks a lot
Luca