Have next CommandText in OracleCommand component:
when executed it causes next query to DB:select
s.id_order,
s.number_order,
f.code_zip,
s.date_income,
f.name_firm,
s.sum_order,
s.edi_status,
f.is_edi,
erp.pkg_utils.F_get_property_doc(f.prop_str, 3) is_edi_delivery,
nvl(c.return_auto,0) return_auto,
p.name_value edi_status_name
from
erp.order_sap s,
erp.wares_order_sap ws,
erp.firms f,
erp.contract c,
erp.properties p
where
s.id_shop = sys_context('context','reval_id_shop')
and s.status in (3,4)
and ws.date_order = s.date_order
and ws.id_shop = s.id_shop
and ws.id_order = s.id_order
and c.id_contract = s.id_contract
and s.date_income >= trunc(sysdate)-2
and (ws.id_wares = decode(:P_BAR_CODE, Null, 0, erp.f_get_id_wares_bar_code(:P_BAR_CODE))
or (ws.id_wares = :P_BAR_CODE and length(:P_BAR_CODE) < )
and f.id_firm = s.id_firm
And p.Id_Value = s.Edi_Status
And p.Id_Property_Block = 1036
what I'm doing wrong?select 0 as typ,0 as table_id,column_name,column_id,' ' as constraint_type, owner
from all_tab_columns
where owner = 'ERP' and table_name = 'ORDER_SAP'
union all
select 0 as typ,0 as table_id,cc.column_name,0 as column_id,cs.constraint_type || ':' || cs.constraint_name, cc.owner as owner
from all_constraints cs,all_cons_columns cc
where cc.owner = 'ERP' and cc.table_name = 'ORDER_SAP' and
cs.owner = cc.owner and cs.table_name = cc.table_name and cs.constraint_name = cc.constraint_name and cs.constraint_type in ('P','U')
union all
select 0 as typ,1 as table_id,column_name,column_id,' ' as constraint_type, owner
from all_tab_columns
where owner = 'ERP' and table_name = 'WARES_ORDER_SAP'
union all
select 0 as typ,1 as table_id,cc.column_name,0 as column_id,cs.constraint_type || ':' || cs.constraint_name, cc.owner as owner
from all_constraints cs,all_cons_columns cc
where cc.owner = 'ERP' and cc.table_name = 'WARES_ORDER_SAP' and
cs.owner = cc.owner and cs.table_name = cc.table_name and cs.constraint_name = cc.constraint_name and cs.constraint_type in ('P','U')
union all
select 0 as typ,2 as table_id,column_name,column_id,' ' as constraint_type, owner
from all_tab_columns
where owner = 'ERP' and table_name = 'FIRMS'
union all
select 0 as typ,2 as table_id,cc.column_name,0 as column_id,cs.constraint_type || ':' || cs.constraint_name, cc.owner as owner
from all_constraints cs,all_cons_columns cc
where cc.owner = 'ERP' and cc.table_name = 'FIRMS' and
cs.owner = cc.owner and cs.table_name = cc.table_name and cs.constraint_name = cc.constraint_name and cs.constraint_type in ('P','U')
union all
select 0 as typ,3 as table_id,column_name,column_id,' ' as constraint_type, owner
from all_tab_columns
where owner = 'ERP' and table_name = 'CONTRACT'
union all
select 0 as typ,3 as table_id,cc.column_name,0 as column_id,cs.constraint_type || ':' || cs.constraint_name, cc.owner as owner
from all_constraints cs,all_cons_columns cc
where cc.owner = 'ERP' and cc.table_name = 'CONTRACT' and
cs.owner = cc.owner and cs.table_name = cc.table_name and cs.constraint_name = cc.constraint_name and cs.constraint_type in ('P','U')
union all
select 0 as typ,4 as table_id,column_name,column_id,' ' as constraint_type, owner
from all_tab_columns
where owner = 'ERP' and table_name = 'PROPERTIES'
union all
select 0 as typ,4 as table_id,cc.column_name,0 as column_id,cs.constraint_type || ':' || cs.constraint_name, cc.owner as owner
from all_constraints cs,all_cons_columns cc
where cc.owner = 'ERP' and cc.table_name = 'PROPERTIES' and
cs.owner = cc.owner and cs.table_name = cc.table_name and cs.constraint_name = cc.constraint_name and cs.constraint_type in ('P','U')