OracleCommand (Mobile) causes tables structure request

OracleCommand (Mobile) causes tables structure request

Postby tsv » Wed 10 Feb 2010 15:19

Hello.
Have next CommandText in OracleCommand component:
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) < 8))
and f.id_firm = s.id_firm
And p.Id_Value = s.Edi_Status
And p.Id_Property_Block = 1036


when executed it causes next query to DB:
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')


what I'm doing wrong?
tsv
 
Posts: 13
Joined: Fri 16 Jan 2009 06:11
Location: Kiev, Ukraine

Postby StanislavK » Thu 11 Feb 2010 11:31

Probably, you are filling an OracleDataTable object, which has the schema set, and this schema does not coincide with the one of the table retrieved by the first query. In this case, an auxiliary query is executed to determine the schema of used database objects. To switch this auxiliary query off, you may set the MissingSchemaAction property of your OracleDataTable to System.Data.MissingSchemaAction.Add. For more information, please see the following:
http://www.devart.com//dotconnect/oracle/docs/Devart.Data~Devart.Common.DbDataTable~MissingSchemaAction.html
http://msdn.microsoft.com/en-us/library/system.data.missingschemaaction.aspx
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for Oracle