Bug in sqlserver 2014 long processing time in query optimizer for complex query. With compatibility set to 2012, everything is quick.

Believe the bug to be related to the new cardinality estimator. In my case joining 7 tables it took 4 seconds to see the query execution plan, with 8 tables it took 1 minute and with 9 tables 15
minutes! the actual processing of the query plan was sub second. (each table has only two records...)
It looks as if there is a workload in the cardinality estimator that escalates as the number of tables and join columns increases.
We have a number of these queries in our application and the bug is a showstopper for our customers. They will have to set compatibility level to 110 (sqlserver 2012) to run the app. Then they should
probably not upgrade from 2012...
Is this a known bug? What is the bug number? How can I follow the bug to see when it is fixed?
  Here is my testcase: (first building tables and data, and then the query with some comments. A version spending 15 minutes in the optimizer, takes 0 seconds to complete with the hint "option (QUERYTRACEON 9481) ".  we can't use this
hint in the application because no dba will allow an application like ours to run as sysadmin...
SCRIPT:
-- Example has one table containing 25 rows. another containing 2 rows. 
-- The one with two rows is joined in several times. 
-- In the original query each of these joins were to separate tables. 
-- I use this simplification because it makes it easier to build the testcase.
------------  CREATE TEST CASE   ----------
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[oleclient](
[acc_f_agio] [varchar](25) NOT NULL DEFAULT (' '),
[acc_f_dag] [varchar](25) NOT NULL DEFAULT (' '),
[acc_notes_ap] [varchar](25) NOT NULL DEFAULT (' '),
[acc_notes_ar] [varchar](25) NOT NULL DEFAULT (' '),
[acc_per_cost] [varchar](25) NOT NULL DEFAULT (' '),
[acc_per_inc] [varchar](25) NOT NULL DEFAULT (' '),
[acc_reverse] [varchar](25) NOT NULL DEFAULT (' '),
[acc_undec_ap] [varchar](25) NOT NULL DEFAULT (' '),
[acc_undec_ar] [varchar](25) NOT NULL DEFAULT (' '),
[acc_vat_pay] [varchar](25) NOT NULL DEFAULT (' '),
[attr_id_balance] [varchar](4) NOT NULL DEFAULT (' '),
[bal_acc_v2] [varchar](25) NOT NULL DEFAULT (' '),
[bal_acc_v3] [varchar](25) NOT NULL DEFAULT (' '),
[balance_acc] [varchar](25) NOT NULL DEFAULT (' '),
[bank_fee_acc] [varchar](25) NOT NULL DEFAULT (' '),
[bflag] [int] NOT NULL DEFAULT ((0)),
[client] [varchar](25) NOT NULL DEFAULT (' '),
[client_name] [varchar](255) NOT NULL DEFAULT (' '),
[comp_reg_no] [varchar](25) NOT NULL DEFAULT (' '),
[compress_flag] [tinyint] NOT NULL DEFAULT ((0)),
[country] [varchar](255) NOT NULL DEFAULT (' '),
[country_code] [varchar](25) NOT NULL DEFAULT (' '),
[cur_client] [varchar](25) NOT NULL DEFAULT (' '),
[cur_item] [tinyint] NOT NULL DEFAULT ((0)),
[cur_type] [varchar](25) NOT NULL DEFAULT (' '),
[cur_type_tri] [varchar](25) NOT NULL DEFAULT (' '),
[curr_period] [int] NOT NULL DEFAULT ((0)),
[currency] [varchar](25) NOT NULL DEFAULT (' '),
[currency_tri] [varchar](25) NOT NULL DEFAULT (' '),
[currency_v2] [varchar](25) NOT NULL DEFAULT (' '),
[currency_v3] [varchar](25) NOT NULL DEFAULT (' '),
[diff_acc_v2] [varchar](25) NOT NULL DEFAULT (' '),
[diff_acc_v3] [varchar](25) NOT NULL DEFAULT (' '),
[diff_account] [varchar](25) NOT NULL DEFAULT (' '),
[diff_chk_v2] [tinyint] NOT NULL DEFAULT ((0)),
[diff_chk_v3] [tinyint] NOT NULL DEFAULT ((0)),
[dim_v2_type] [varchar](25) NOT NULL DEFAULT (' '),
[dim_v3_type] [varchar](25) NOT NULL DEFAULT (' '),
[employer_id] [varchar](12) NOT NULL DEFAULT (' '),
[header] [varchar](30) NOT NULL DEFAULT (' '),
[header2] [varchar](30) NOT NULL DEFAULT (' '),
[headquarter] [varchar](25) NOT NULL DEFAULT (' '),
[language] [varchar](2) NOT NULL DEFAULT (' '),
[last_update] [datetime] NOT NULL DEFAULT (CONVERT([datetime],'19000101 00:00:00:000',(9))),
[leg_act_cli] [varchar](25) NOT NULL DEFAULT (' '),
[max_inv_diff] [decimal](28, 3) NOT NULL DEFAULT ((0.0)),
[max_inv_diff_v2] [decimal](28, 3) NOT NULL DEFAULT ((0.0)),
[max_inv_diff_v3] [decimal](28, 3) NOT NULL DEFAULT ((0.0)),
[max_pay_diff] [decimal](28, 3) NOT NULL DEFAULT ((0.0)),
[max_pay_diff_v2] [decimal](28, 3) NOT NULL DEFAULT ((0.0)),
[max_pay_diff_v3] [decimal](28, 3) NOT NULL DEFAULT ((0.0)),
[municipal] [varchar](25) NOT NULL DEFAULT (' '),
[overrun_pct] [decimal](28, 8) NOT NULL DEFAULT ((0.0)),
[pay_client] [varchar](25) NOT NULL DEFAULT (' '),
[pay_diff_acc_g] [varchar](25) NOT NULL DEFAULT (' '),
[pay_diff_acc_l] [varchar](25) NOT NULL DEFAULT (' '),
[pay_ref] [varchar](25) NOT NULL DEFAULT (' '),
[period_no] [smallint] NOT NULL DEFAULT ((0)),
[remind_ref] [varchar](20) NOT NULL DEFAULT (' '),
[rev_vat_disc_ap] [tinyint] NOT NULL DEFAULT ((0)),
[rev_vat_disc_ar] [tinyint] NOT NULL DEFAULT ((0)),
[sys_setup_code] [varchar](2) NOT NULL DEFAULT (' '),
[tax_office_no] [varchar](50) NOT NULL DEFAULT (' '),
[tax_office_ref] [varchar](20) NOT NULL DEFAULT (' '),
[tax_system] [varchar](25) NOT NULL DEFAULT (' '),
[user_id] [varchar](25) NOT NULL DEFAULT (' '),
[vat_reg_no] [varchar](25) NOT NULL DEFAULT (' '),
[agrtid] [bigint] IDENTITY(1,1) NOT NULL,
UNIQUE NONCLUSTERED 
[agrtid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
  ('8081','8181',' ',' ','2442','1481','9998',' ',' ','1320',' ','9998',' ',' ','8110','0','UK','Agresso Demo UK','987654321012','0','United Kingdom','GB','UK','1','1','EU','200409','GBP','EUR','EUR','USD','9998','9998','9998','1','0','EU','$',' ','Agresso
demo','Corporate Office','NO','EN','2004-09-27 12:39:00.000','UK',0.020,0.000,0.000,0.100,0.000,0.000,'0301',0.00000000,'UK','9998','9998','Jim Smith','12','Mike Anderson','0','0','EN','Bristol Brunel','V123/123',' ','JOSUTTON','123456789101');
insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
   ('8060','8160',' ',' ','2960','1480','1490',' ',' ',' ',' ',' ',' ',' ','7770','0','N1','N1 - Énklient','971332421','0','Norway','NO','N1','0','1',' ','200701','NOK',' ','EUR',' ',' ',' ','9999','0','0','E',' ','971332421','Agresso Demo Norge (NO)','Agresso
Demo Norge (NO)','NO','NO','2007-01-26 08:31:00.000','N1',0.050,0.000,0.000,0.500,0.000,0.000,'0301',5.00000000,'N1','9999','9999',' ','12',' ','0','0','NO',' ',' ',' ','SYSNO','971332421');
insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
 ('900000','900000',' ',' ',' ',' ','900100',' ',' ',' ',' ',' ',' ',' ','470000','0','BE','DEMO Belgie',' ','0','Belgium','BE','BE','0','1',' ','200208','EUR',' ','USD','GBP',' ',' ','900100','0','0','2','3',' ',' ','Agresso Business World','BE','EN','2005-11-18
17:07:00.000','BE',0.050,0.000,0.000,0.050,0.000,0.000,'2018',0.00000000,'BE','900100','900100',' ','12',' ','0','0','BT',' ',' ',' ','SYSBE','BE461149381');
  insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('8030','8040',' ',' ','1250','2450','9998',' ',' ',' ',' ',' ',' ',' ','8060','0','A99','Seneca N.V. - Reporting / Intellagent',' ','0',' ','NL','A99','0','1',' ','201105','EUR',' ','USD',' ',' ',' ','9998','0','0','2',' ',' ','Seneca N.V. - Report / Intell','Seneca
N.V. - Report / Intell','A01','EN','2011-05-19 12:19:59.000','A99',0.010,0.000,0.000,5.000,0.000,0.000,' ',0.00000000,'A99','9998','9998',' ','12',' ','0','0','EN',' ',' ',' ','SYSTEM',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('766000','666000','445860','445870','486000','487000',' ','445806','445807','445806',' ',' ','DEVISES',' ',' ','3','FR','Agresso Demo France',' ','0','France','FR','FR','1','1','1','200509','EUR','EUR',' ','FRF',' ','DEVISES','471000','0','1',' ','1',' ','Agresso
demo France','Agresso demo France','FR','FR','2005-08-30 09:27:00.000','FR',0.100,0.000,0.500,10.000,0.000,0.000,'92',0.00000000,'FR',' ',' ',' ','12',' ','0','0','FR',' ',' ',' ','SYSFR','FR12345678');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ','9999',' ',' ',' ',' ',' ',' ',' ',' ','0','AU','Agresso Australia','123456789','0','Australia','AU','AU','0','1',' ','200708','AUD',' ',' ',' ',' ',' ','9999','0','0',' ',' ',' ','Agresso demo Australia','Corporate Office','AU','AU','2007-04-19
12:40:00.000','AU',0.000,0.000,0.000,0.000,0.000,0.000,' ',0.00000000,'AU','9999','9999',' ','12',' ','0','0','AU',' ',' ',' ','SYSAU','123456789')
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('8060','8160',' ',' ','2960','1480','1490',' ',' ',' ',' ',' ',' ',' ','7770','0','NO','Agresso Demo Norge (NO)','971332425','0','Norway','NO','NO','0','1',' ','201401','NOK',' ','EUR',' ',' ',' ','9999','0','0','E',' ','971332425','Agresso Demo Norge (NO)','Agresso
Demo Norge (NO)','NO','NO','2014-01-11 12:34:54.000','NO',0.050,0.000,0.000,0.500,0.000,0.000,'0301',5.00000000,'NO','9999','9999',' ','12',' ','0','0','NO',' ',' ',' ','SYSNO','971332425');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('9999','9999',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','9999','0','SF','Agresso Demo SF',' ','0','Finland','SF','SF','0',' ',' ','0','FIM',' ',' ',' ',' ',' ','9999','0','0',' ',' ',' ','Agresso Demo','Hovedkontoret','SF','SE','1996-01-18 03:25:00.000','SF',0.000,0.000,0.000,0.000,0.000,0.000,'
',0.00000000,'SF','9999','9999',' ','12',' ','0','0','SF',' ',' ',' ','SYSTEM',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','US','Agresso Demo Corp.',' ','0',' ','US','US','1',' ',' ','199702','USD',' ',' ',' ',' ',' ',' ','0','0',' ',' ',' ','Agresso Demo Corp.','Headquarter','US','US','1997-01-21 02:45:00.000','US',0.020,0.000,0.000,5.000,0.000,0.000,'
',0.00000000,'US',' ',' ','John Smith','12','Elsa Beskow','0','0','EN',' ',' ',' ','SYSNO',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('8081','8181',' ',' ','2442','1481','9998',' ',' ','1320',' ','9998',' ',' ','8110','0','EN','Agresso Demo','987654321012','0','United Kingdom','GB','EN','1','1','EU','201401','GBP','EUR','EUR','USD','9998','9998','9998','1','0','EU','$',' ','Agresso demo','Corporate
Office','NO','EN','2014-01-06 10:20:58.000','EN',0.020,0.010,0.000,0.100,0.000,0.000,'0301',0.00000000,'EN','9998','9998','Jim Smith','12','Mike Anderson','0','0','EN',' ',' ',' ','SYSEN','123456789101');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','10','Test company 10 (for multiclient)',' ','0',' ','GB','EN','0','1',' ','200801','GBP',' ',' ',' ',' ',' ',' ','0','0',' ',' ',' ','Test company 10 (multiclient)','Test company 10 (multiclient)','EN','EN','2008-05-07
10:57:51.000','EN',0.010,0.000,0.000,1.000,0.000,0.000,' ',0.00000000,'EN',' ',' ',' ','12',' ','0','0','EN',' ',' ',' ','SYSEN',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('4840','6880',' ',' ','1900','3900',' ','1410','3810','3810',' ','9998','9998',' ',' ','1','DE','D3 Demo Fibu/Projekt/Logistik','1277777001','0',' ','DE','DE','1','1','1','200204','EUR','EUR','USD','DEM','9998','9998','9998','1','1','2','1',' ','Agresso Demo
Fibu/Pr/Log','Agresso Demo Fibu/Pr/Log','DE','DE','2002-04-03 17:28:00.000','DE',0.050,0.000,0.000,5.000,0.000,0.000,' ',0.00000000,'DE','4720','4720',' ','12',' ','0','0','DE','Finanzamt München II',' ',' ','SYSDE','DE888999777');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','PF','Performance test company',' ','0',' ','GB','PF','0','1',' ','200910','GBP',' ',' ',' ',' ',' ',' ','0','0',' ',' ',' ',' ',' ','PF','EN','2009-10-14 15:49:10.000','PF',0.000,0.000,0.000,0.000,0.000,0.000,'
',0.00000000,'PF',' ',' ',' ','12',' ','0','0','EN',' ',' ',' ','SYSEN',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','01','RD Reporting Team - Test Client 01',' ','0',' ','NO','01','0',' ',' ','201101',' ',' ',' ',' ',' ',' ',' ','0','0',' ',' ',' ',' ',' ','01','EN','2013-10-22 13:29:46.000','01',0.000,0.000,0.000,0.000,0.000,0.000,'
',0.00000000,'01',' ',' ',' ','12','Vidar Bjørnson','0','0','EN',' ',' ',' ','REPDEV',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','02','RD Reporting Team - Test Client 02',' ','0',' ','NO','02','0',' ',' ','201101',' ',' ',' ',' ',' ',' ',' ','0','0',' ',' ',' ',' ',' ','01','EN','2013-10-22 13:30:11.000','02',0.000,0.000,0.000,0.000,0.000,0.000,'
',0.00000000,'02',' ',' ',' ','12','Vidar Bjørnson','0','0','EN',' ',' ',' ','REPDEV',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','03','RD Reporting Team - Test Client 03',' ','0',' ','NO','03','0',' ',' ','201101',' ',' ',' ',' ',' ',' ',' ','0','0',' ',' ',' ',' ',' ','01','EN','2013-10-22 13:30:47.000','03',0.000,0.000,0.000,0.000,0.000,0.000,'
',0.00000000,'01',' ',' ',' ','12','Vidar Bjørnson','0','0','EN',' ',' ',' ','REPDEV',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','9998',' ',' ',' ','0','FP','FIN PROC Test Project','321456987','0',' ','NO','FP','0','1','1','201206','EUR','EUR','USD','USD','9998','9998',' ','1','1','2','2',' ','FIN PROC Test Project','FIN PROC Test Project','FP','EN','2012-09-24
10:43:27.000','FP',0.000,0.000,0.000,0.000,0.000,0.000,' ',0.00000000,'FP',' ',' ',' ','12',' ','0','0','EN',' ',' ',' ','FRODE','321456987MVA');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
(' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','DM','Agresso Deployment Manager',' ','0',' ','NO','DM','0',' ',' ','201301',' ',' ',' ',' ',' ',' ',' ','0','0',' ',' ',' ',' ',' ','DM','EN','2013-11-06 13:55:17.000','DM',0.000,0.000,0.000,0.000,0.000,0.000,'
',0.00000000,'DM',' ',' ',' ','12',' ','0','0','EN',' ',' ',' ','SYSEN',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('3960','7960',' ',' ','1790','2990','2991',' ',' ',' ',' ',' ',' ',' ','6570','0','S1','Agresso Demo Client S1','556558-7893','0','Sweden','SE','S1','1','1',' ','200401','SEK',' ','NOK','EUR','8322','8321','3740','1','1','3','6','5565587893',' ','Utbildningsföretaget
AB','SE','SE','2005-02-10 22:04:00.000','S1',0.500,0.000,0.000,0.500,0.000,0.000,' ',0.00000000,'S1','3740','3740','Anna Kronstam','12','Thomas Jelf','0','0','SE',' ',' ',' ','SYSEN','SE556558789301');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('3960','7960',' ',' ','1790','2990','2991',' ',' ',' ',' ',' ',' ',' ','6570','0','S2','Agresso Demo Client S2','556558-7893','0','Sweden','SE','S2','1','1',' ','200202','SEK',' ','NOK','EUR','8322','8321','3740','1','1','3','6','5565587893',' ','Utbildningsföretaget
AB','SE','SE','2005-01-17 13:20:00.000','S2',0.500,0.000,0.000,0.500,0.000,0.000,' ',0.00000000,'S2','3740','3740','Anna Kronstam','12','Thomas Jelf','0','0','SE',' ',' ',' ','SYSSE','SE556558789301');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('910156','910166',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','0','NL','DEMO Nederland','KVK9937465','0','Holland','NL','NL','0','1',' ','200708','EUR',' ',' ',' ',' ',' ','999999','0','0',' ',' ',' ','Global Trada N.V.','Global Trada N.V.','NL','NL','2007-08-15
13:41:00.000','NL',50000.000,0.000,0.000,50000.000,0.000,0.000,'3994 DB',0.00000000,'NL','470720','470720',' ','12',' ','0','0','NL',' ',' ',' ','ROB','NL009404296B01');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('4664','4730',' ',' ','4755',' ',' ',' ',' ',' ',' ',' ',' ',' ','4755','0','DK','Agresso Demo Denmark',' ','0','Denmark','DK','DK','0','1',' ','0','DKK',' ',' ',' ',' ',' ',' ','0','0',' ',' ','0123456789','Agresso Denmark','Agresso Denmark','DK','DK','2005-10-14
08:40:00.000','DK',0.100,0.000,0.000,0.100,0.000,0.000,' ',0.00000000,'DK',' ',' ',' ','12',' ','0','0','DK',' ',' ',' ','SYSDK',' ');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('76800','66800',' ',' ','48000','48500','99999','47201','47701',' ',' ',' ',' ',' ','66910','1','SP','Agresso Spain',' ','0','Spain','ES','SP','0','1','1','200804','EUR','EUR','GBP',' ',' ',' ','99999','0','0','2',' ',' ','Agresso DEMO S.A','Agresso DEMO S.A','SP','ES','2008-04-07
14:01:38.000','SP',0.010,0.000,0.000,0.010,0.000,0.000,' ',0.50000000,'SP','99999','99999','Dpto.Aministración','12','Dpto.Riesgos','0','0','ES','00007307','18ru0456',' ','SYSES','B18389742');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('3960','7960',' ',' ','1790','2990','2991',' ',' ',' ',' ','8439',' ',' ','6570','0','SE','UTBILDNINGSFÖRETAGET AB','2021001235','0',' ','SE','SE','0','1',' ','200707','SEK',' ','EUR',' ','8439',' ','3740','1','0','2',' ',' ','Masterföretaget AB','Masterföretaget
AB','SE','SE','2008-06-09 12:38:43.000','SE',0.500,0.000,0.000,0.500,0.000,0.000,'STLM',0.05000000,'SE','3740','3740',' ','12',' ','0','0','SE',' ','Stockholm',' ','SYSEN','SE202100123501');
 insert into oleclient (
 acc_f_agio, acc_f_dag, acc_notes_ap, acc_notes_ar, acc_per_cost, acc_per_inc, acc_reverse, acc_undec_ap, acc_undec_ar, acc_vat_pay, attr_id_balance, bal_acc_v2, bal_acc_v3, balance_acc,
 bank_fee_acc, bflag, client, client_name, comp_reg_no, compress_flag, country, country_code,  cur_client, cur_item, cur_type, cur_type_tri, curr_period, currency, currency_tri,
 currency_v2, currency_v3, diff_acc_v2, diff_acc_v3, diff_account, diff_chk_v2, diff_chk_v3, dim_v2_type, dim_v3_type, employer_id, header, header2, headquarter, language,
 last_update, leg_act_cli, max_inv_diff, max_inv_diff_v2, max_inv_diff_v3, max_pay_diff, max_pay_diff_v2, max_pay_diff_v3, municipal, overrun_pct, pay_client, pay_diff_acc_g,
 pay_diff_acc_l, pay_ref, period_no, remind_ref, rev_vat_disc_ap, rev_vat_disc_ar, sys_setup_code, tax_office_no, tax_office_ref, tax_system, user_id, vat_reg_no )
 values
('8081','8181',' ',' ','2442','1481','9998','1301','1307','1320',' ','9998',' ',' ','8110','1','IT','IT - Client',' ','0','Italy','IT','IT','1','EU','EU','200601','EUR','EUR','EUR','USD','9998','9998','9998','1','0','EU','$','CODE SIA','Agresso demo Italia','Corporate
Office','IT','IT','2006-09-28 08:46:00.000','IT',0.020,0.000,0.000,0.100,0.000,0.000,'0301',0.00000000,'IT','9998','9998','Jim Smith','12','Mike Anderson','0','0','IT','Tax authority province','Auto-no011299',' ','SYSEN','11465420153');
go
CREATE UNIQUE NONCLUSTERED INDEX [aioleclient1] ON [dbo].[oleclient]
[client] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
GO
CREATE TABLE [dbo].[Htable1](
[amount] [decimal](28, 3) NOT NULL DEFAULT ((0)),
[cur_amount] [decimal](28, 3) NOT NULL DEFAULT ((0)),
[value_2] [decimal](28, 3) NOT NULL DEFAULT ((0)),
[value_3] [decimal](28, 3) NOT NULL DEFAULT ((0)),
[currency] [varchar](25) NOT NULL DEFAULT (' '),
[client] [varchar](25) NOT NULL DEFAULT (' '),
[asset_id] [varchar](25) NOT NULL DEFAULT (' '),
[depr_book_id] [varchar](25) NOT NULL DEFAULT (' '),
[input_id] [bigint] NOT NULL DEFAULT ((0)),
[amount_type] [char](25) NOT NULL DEFAULT (' '),
[reval_year] [int] NOT NULL DEFAULT ((0)),
[trans_seq] [int] NOT NULL DEFAULT ((0)),
[sequence_no] [int] NOT NULL DEFAULT ((0)),
[at_trans_date] [datetime] NOT NULL DEFAULT (CONVERT([datetime],'19000101',(112))),
[agrtid] [bigint] IDENTITY(1,1) NOT NULL,
UNIQUE NONCLUSTERED 
[agrtid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT INTO Htable1 (at_trans_date,amount,amount_type,asset_id,client,cur_amount,currency,depr_book_id,input_id,reval_year,sequence_no,trans_seq,value_2,value_3) 
 VALUES ('20140603' ,0.00000000,'GLN','BM','EN',0.00000000,'GBP','BUSINESS',563,0,29,0,0.00000000,0.00000000 ) 
GO
INSERT INTO Htable1 (at_trans_date,amount,amount_type,asset_id,client,cur_amount,currency,depr_book_id,input_id,reval_year,sequence_no,trans_seq,value_2,value_3) 
 VALUES ('20140603' ,0.00000000,'GLN','BM','EN',0.00000000,'GBP','BUSINESS',563,0,30,0,0.00000000,0.00000000 ) 
GO
--=================================================================================
-- The following query takes 15 minutes on my computer to give an execution plan. Fetching the data takes no additional time.
-- removing one table (CACHED88) from the query brings the time down to 59 seconds.
-- removing one more (CACHED87) brings it down to 4 seconds.
-- adding the hint "option (QUERYTRACEON 9481)" to the first case, brings it down from 15 minutes to less than one second!
SELECT 
       CACHED83.amount - ( CACHED76.amount + CACHED75.amount + CACHED85.amount + CACHED86.amount + CACHED87.amount + CACHED88.amount) AS amount, 
       CACHED83.amount - ( CACHED76.amount + CACHED75.amount + CACHED85.amount + CACHED86.amount + CACHED87.amount + CACHED88.amount) AS cur_amount, 
       c.currency    
FROM 
       Htable1   tab1 , 
       Htable1   CACHED83 , 
       Htable1   CACHED76 ,
       Htable1   CACHED75 ,
       Htable1   CACHED85 ,
       Htable1   CACHED86 ,
       Htable1   CACHED87 ,
       Htable1   CACHED88 ,
       oleclient c  
WHERE 
       tab1.client = c.client AND
       tab1.amount_type = 'GLN' AND 
       tab1.asset_id     = CACHED83.asset_id AND 
       tab1.depr_book_id = CACHED83.depr_book_id AND        
       tab1.client       = CACHED83.client AND 
       tab1.input_id     = CACHED83.input_id AND 
       tab1.reval_year   = CACHED83.reval_year AND     
       tab1.trans_seq    = CACHED83.trans_seq AND 
       tab1.sequence_no  = CACHED83.sequence_no AND 
       tab1.asset_id     = CACHED76.asset_id AND  
       tab1.depr_book_id = CACHED76.depr_book_id AND 
       tab1.client       = CACHED76.client AND 
       tab1.input_id     = CACHED76.input_id AND  
       tab1.reval_year   = CACHED76.reval_year AND 
       tab1.trans_seq    = CACHED76.trans_seq AND 
       tab1.sequence_no  = CACHED76.sequence_no AND 
       tab1.asset_id     = CACHED75.asset_id AND 
       tab1.depr_book_id = CACHED75.depr_book_id AND 
       tab1.client       = CACHED75.client AND      
       tab1.input_id     = CACHED75.input_id AND 
       tab1.reval_year   = CACHED75.reval_year AND 
       tab1.trans_seq    = CACHED75.trans_seq AND       
       tab1.sequence_no  = CACHED75.sequence_no AND 
       tab1.asset_id     = CACHED85.asset_id AND 
       tab1.depr_book_id = CACHED85.depr_book_id AND        
       tab1.client       = CACHED85.client AND 
       tab1.input_id     = CACHED85.input_id AND 
       tab1.reval_year   = CACHED85.reval_year AND     
       tab1.trans_seq    = CACHED85.trans_seq AND 
       tab1.sequence_no  = CACHED85.sequence_no AND 
       tab1.asset_id     = CACHED86.asset_id AND 
       tab1.depr_book_id = CACHED86.depr_book_id AND 
       tab1.client       = CACHED86.client AND 
       tab1.input_id     = CACHED86.input_id AND  
       tab1.reval_year   = CACHED86.reval_year AND 
       tab1.trans_seq    = CACHED86.trans_seq AND 
       tab1.sequence_no  = CACHED86.sequence_no AND  
       tab1.asset_id     = CACHED87.asset_id AND 
       tab1.depr_book_id = CACHED87.depr_book_id AND 
       tab1.client       = CACHED87.client AND      
       tab1.input_id     = CACHED87.input_id AND 
       tab1.reval_year   = CACHED87.reval_year AND 
       tab1.trans_seq    = CACHED87.trans_seq AND       
       tab1.sequence_no  = CACHED87.sequence_no  AND  
       tab1.asset_id     = CACHED88.asset_id AND 
       tab1.depr_book_id = CACHED88.depr_book_id AND 
       tab1.client       = CACHED88.client AND      
       tab1.input_id     = CACHED88.input_id AND 
       tab1.reval_year   = CACHED88.reval_year AND 
       tab1.trans_seq    = CACHED88.trans_seq AND       
       tab1.sequence_no  = CACHED88.sequence_no  
--  option (QUERYTRACEON 9481)         

Reading "What's new in Sql Server 2014" (http://msdn.microsoft.com/en-us/library/bb510411.aspx#CE). I see that  it says:
New Design for Cardinality Estimation
The cardinality estimation logic, called the cardinality estimator, is re-designed in SQL Server 2014 to improve the quality of query plans, and therefore to improve query performance. The new cardinality estimator incorporates assumptions and algorithms
that work well on modern OLTP and data warehousing workloads. It is based on in-depth cardinality estimation research on modern workloads, and our learnings over the past 15 years of improving the SQL Server cardinality estimator. Feedback from customers shows
that while most queries will benefit from the change or remain unchanged, a small number might show regressions compared to the previous cardinality estimator. For performance tuning and testing recommendations, seeCardinality
Estimation (SQL Server).
I states that a "small number of queries might show regressions". To mee the regression is a showstopper and seems to have to do with complexity. I found one query reported by Juha Salo (bug 893758) that possibly could have to do with the same thing.
It is a query with many joins. Simplifying the query by removing one of the joins, makes it work fine. The query documented in his report does not need any setup as it is a query on system tables as sys.indexes and sys.index_columns.
I quote:
There is a huge difference in performance for the following query between compatibility level 120 and the lower levels:
dbcc dropcleanbuffers
SELECT i.NAME
FROM sys.indexes i
INNER JOIN sys.index_columns k ON i.object_id = k.object_id
AND i.index_id = k.index_id
INNER JOIN sys.objects o ON i.object_id = o.object_id
AND k.object_id = o.object_id
INNER JOIN sys.index_columns k1 ON i.object_id = k1.object_id
AND i.index_id = k1.index_id
AND k1.key_ordinal = 1
INNER JOIN sys.index_columns k2 ON i.object_id = k2.object_id
AND i.index_id = k2.index_id
AND k2.key_ordinal = 2
INNER JOIN sys.index_columns k3 ON i.object_id = k3.object_id
AND i.index_id = k3.index_id
AND k3.key_ordinal = 3
INNER JOIN sys.index_columns k4 ON i.object_id = k4.object_id
AND i.index_id = k4.index_id
AND k4.key_ordinal = 4
INNER JOIN sys.index_columns k5 ON i.object_id = k5.object_id
AND i.index_id = k5.index_id
AND k5.key_ordinal = 5
INNER JOIN sys.index_columns k6 ON i.object_id = k6.object_id
AND i.index_id = k6.index_id
AND k6.key_ordinal = 6
INNER JOIN sys.index_columns k7 ON i.object_id = k7.object_id
AND i.index_id = k7.index_id
AND k7.key_ordinal = 7
INNER JOIN sys.columns c1 ON o.object_id = c1.object_id
AND k1.column_id = c1.column_id
INNER JOIN sys.columns c2 ON o.object_id = c2.object_id
AND k2.column_id = c2.column_id
INNER JOIN sys.columns c3 ON o.object_id = c3.object_id
AND k3.column_id = c3.column_id
INNER JOIN sys.columns c4 ON o.object_id = c4.object_id
AND k4.column_id = c4.column_id
INNER JOIN sys.columns c5 ON o.object_id = c5.object_id
AND k5.column_id = c5.column_id
INNER JOIN sys.columns c6 ON o.object_id = c6.object_id
AND k6.column_id = c6.column_id
INNER JOIN sys.columns c7 ON o.object_id = c7.object_id
AND k7.column_id = c7.column_id
Can be run in any database. In our case we have a legacy database with almost 10 000 (ten thousand) tables. In that kind of database the query just freezes fully utilizing a single cpu core.
If compatibility level is switched to 110 then query performs as it should.

Similar Messages

  • Dealing with ExtendScript hangs and long processing times?

    Just curious if an ExtendScript for some reason hangs (or takes really long time to run), you just have to kill it externally right? Or is there some other Adobe scripting feature I'm not aware of that deals with that scenario?
    So I'm guessing the best option to deal with hangs or long processing time is to:
    have an external monitoring tool/service to check up on the ExtendScript execution and handle appropriately as needed (kill it, log info)
    use the COM API (e.g. VBScript, though other COM compatible languages ok) or Applescript API (called directly or called by other programming languages) instead of ExtendScript for their additional programming and/or multi-threading capabilities

    Using whose in Snow Leopard is a lot slower for some reason. SInce you are already using a shell script, you might try using find. Various shell scripts to copy, find, move, etc, can also use wildcard characters.

  • Long processing time but why?

    Hi all .......
    in TCode STAD "SAP WorkLoad: Single Statistical Records - Details".
    some time or many times I found that, processing time is 10 time of cpu time.
    and there no bottleneck in CPU its always free and also Roll wait time.
    So can some one tell me where the long waiting time come from?
    Thank you

    Hi,
    SAP note 8963 eplains the definition of the processing time. And SAP note 99584 explains why a very large processing time might appear in STAD.
    If a long running dialog step performs many DB operations then an overflow in the DB statistic may occur. Reason: a 4-byte counter for microseconds will wrap around after approx. 71 minutes. Then the measured DB time is very small compared to the response time. This is the reason why a very large processing time is shown.
    Maybe this explains your situation. It has been solved with SAP_BASIS 700 where larger counters have been implemented.
    I hope this information helps.
    Kind Regards,
    Andreas

  • Getting "Windows could not parse or process the unattend answer file for pass [specialize]" with IE10 integration? Read this...

    Hey guys,
    I just discovered an issue with using MDT to integrate Internet Explorer 10 into Windows 7 & 2008 R2 image files. Building the images was no problem at all, but when I tried to deploy them it would bomb with this error every time:
    "Windows could not parse or process the unattend answer file for pass [specialize]."
    So a very annoying and cryptic error to say the least. Obviously the issue was with the unattend.xml file that gets auto-generated by MDT, but all the items under "specialize" had worked just fine when I built the image and the IE version
    was the only item that had changed. After comparing the Windows 7 & Server 2008 R2 unattend.xml files to my Windows 8 & Server 2012 unattend.xml files (because they have IE 10 native) I discovered that the following flag was missing
    from the Windows 8 & Server 2012 unattend.xml files:
    <IEWelcomeMsg>false</IEWelcomeMsg>
    So I simply commented it out like so:
    Re-ran my test deployment and viola, 100% successful with zero errors. I was a little embarrassed/annoyed that this took me so long to track down, then I realized others might be struggling with this too so thought I'd share.
    Hope my time spent saves someone else some grief!

    I know the last reply was from a couple weeks ago, but honestly, I haven't been able to find anything else in the last week of searching Google. I'm new to the MDT process but I'm having the same issue with what you posted. I can shift-F10 during the "Applying
    system settings" and open my unattend.xml file and remove the IEWelcomeMsg line and the image deploys perfectly, so I know that's my problem. I can't figure out where that line is coming from. I have edited every unattend.xml file in the Templates folder under
    MDT and also the one in my deployment task sequence, but somewhere during that deployment, that one setting gets added back to the unattend file and nukes the whole image. I'm about to pull my hair out. I'm implementing MDT to save time but I feel like the
    last couple of weeks trying to get it to work have been a waste. I have thought about backing my reference image back to IE9, but having to deploy IE10 post image seems like it's an unnecessary burden. Any help would be appreciated.
    ~Adam

  • Unable to process downpayment request (F-47) for the vendor with the PO

    Hi All,
    We are not able to process the advance payment request for the vendor 450004398 with the PO 3000086605 due to below mentioned error
    " You cannot use this transaction type to post this asset.u201D After getting error we double click that error we got these full information.
    The traanction type entered type entered belongs to transaction type group 15, According to the specifications for this transactipn type group,posting with trasnction types belonging to this group are only allowed in specifi asset classes ( for asset classes for asset under construction)
    The asset to which you are posting belongs to class group
    Above error we are facing, we checked "OAYB" also that asset class in maintained in that transaction code.
    Awaiting for your reply
    Thanks
    Ram
    09769004602

    Hi Ram,
    Please check AO90 and OAYB
    In AO90 you should assign one Asset GL Account.
    for this: go to AO90 select you chart of accounts and double click on acocunt Determination select your asset determination against which asset you are paying down payment and double click on Balance sheet accounts there you need to assign under acquisition account assginment  * Acquisition:Down Payment* and Down Payment clearing Account. This is  only  for AUC.
    In OAYB select 15 Down payment and double click on specification of asset class there you need assign your asset class.
    Hope this will help you.
    Regards,
    Schilukuri

  • New iTunes upgrade, causes Long process time, re: itunes updating library

    I just updated iTunes and I let it Update(the iTunes Library) but it keeps getting stuck around 25% and takes all of the processor time around %94, I let it go about 2 hours and I get frustrated and quit.
    what is going on? Ho wdo I prevent it from updating so I Can LISTEN to some Music?????? I have around 60gb of music and podcasts/videos/books ect., how long does it take to update?? It has been over 5 hours dealing with this already, so Please tell me how to stop it from updating!!! I want MUSIC!!! nOW!

    Nevermind, I just erased the Library File and Reimported everything, I got Tired of waitng for it to finish.

  • Slow responding to commands. Longer processing time between commands. How do I shorten it back to usual timing?

    Computer slows down when loading firefox, sending email, etc.

    Computer slows down when loading firefox, sending email, etc.

  • Facing long retrieval time to execute HFR for 11.1.2 system

    Hi,
    I am executing one HFR from ASO cube, retrieval time for report was around 8 min when MAXFORMULACACHESIZE XXX XXX 4098KB
    And now i am facing retrieval time for more than 55 min. with no output.
    My report structure is like till 12 rows report is extracting data from the cube and then for other set of around 40 rows report is caclulating on the basis of first 12 rows.
    Initial 12 rows also have formula operated account members from ASO cube.
    Beside this columnar calculation are also executing for simple calculation of addidtion and variance calculations.
    Pls suggest me is there any specific CFG setting is required for report execution or suggest me any performance optimization techninque for HFR.
    Thanks

    Thanks.  I'll give that some thought as a workaround.
    What I'm trying to determine is whether running an HFM report is supposed to take longer on the first opening of the report and subsequent reports open faster due to caching.  Other reports can be any report in the HFM application.  The subsequent report doesn't have to be the one just opened.
    The first HFM report takes about 15 seconds to reach the prompt which seems long to me since a Planning report consistenly takes 3 seconds to reach the prompt.  In our 9.3.3 system, HFM takes consistently takes about 3-5 seconds to reach a prompt.  Same for Planning.
    I'm suspicious of the CPU clock speed of our HFM server in the ver 11 environment.  The clock speed in is 2GHz and the clock speed in our prior environment is 3GHz.
    I am unsure if the CPU's GHz on our HFM server is a contributing factor in this or if this is just how it works in 11.1.2.2.

  • Process ADD(increment) using SSIS for a dimension with two Key columns

    Hi,
    I'm trying to add data to the existing dimension using Process ADD increment (SSIS data flow). The dimension has 2 key columns (ID and Timestamp) and when I do a full process for a particular day the dimension run's fine, but when I try
    to add data for the next day using Process Add(increment) from SSIS I'm getting error like   
    And Yes, I will have same ID's of the first day for the next day as well but with a different Timestamp, so for that I have set the
    Key not found  to "Ignore errors". But still I see the above error. Below is my DSV
    Can anyone help me on how to approach on this. 

    Hi K.Kalyan,
    According to your description, you get the above error when executing the ProcessAdd data flow task. Right?
    In this scenario, since you have same ID for one which is differed on Timestamp, it can cause duplicated key issue so that it will throw this error. Please change the "Duplicate Key" error action to "Report and continue"
    (recommended) or "Ignore error" to resolve this issue. 
    Reference:
    Dimension processing failing (Incremental)
    FIX: "Internal error: An unexpected error occurred" when you run a "Process" command against the TFS SSAS cube
    Best Regards, 
    Simon Hou
    TechNet Community Support

  • Again..What elapse time you are expecting for this query..

    Hi Again want to confirm with you Oracle gurus ...
    Does following plsql code really takes time in mins
    I do not used to deal with clob data so can not say why there is so delay..
    -> TableA has 3000 rows with text_data clob column holding large clob data...
    -> TableB has some thing which i wnat to append in text_data column..
    -> Trying to minimize elapse time..
    declare
    cursor c1 is select object_id from TableA where object_type = 'STDTEXT' and rownum < 1000;
    TYPE v_object_id_t is table of TableA.object_id%type index by binary_integer;
    v_object_id v_object_id_t;
    cursor c2(p_object_id TableA.object_id%type) is
    select to_clob('<IMG "MFI_7579(@CONTROL=' || ref_id || ',REF_ID=' || ref_id || ').@UDV">' || substr('abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx',1, round(to_char(systimestamp,'FF2')/2)-1)) temp_data
    from TableB where object_id = p_object_id;
    TYPE v_text_data_t is table of TableA.text_data%type index by binary_integer;
    v_text_data v_text_data_t;
    v_temp clob ;
    r2 c2%rowtype;
    begin
    open c1;
    loop
    FETCH c1 BULK COLLECT INTO v_object_id ;
    for i in 1..v_object_id.count loop
    dbms_lob.createtemporary(v_temp,TRUE);
    open c2(v_object_id(i));
    loop
    fetch c2 into r2;
    exit when c2%NOTFOUND;
    dbms_lob.append(v_temp,r2.temp_data);
    end loop;
    close c2;
    v_text_data(i) := '';
    v_text_data(i) := v_temp;
    -- DBMS_OUTPUT.PUT_LINE (length(v_text_data(i)));
    dbms_lob.freetemporary(v_temp);
    end loop;
    forall counter in 1..v_text_data.count
    update TableA
    set text_data = concat(text_data,v_text_data(counter))
    where object_id = v_object_id(counter);
    DBMS_OUTPUT.PUT_LINE ('Update performed!');
    commit;
    EXIT WHEN c1%NOTFOUND;
    end loop;
    close c1;
    exception
    when others then
    DBMS_OUTPUT.PUT_LINE ('Update not performed!');
    end;
    -- Last elapse time 333 sec for 8k text_data data if i use 16k block size
    -- Last elapse time 1503 sec for 2k text_data data if i use 8k block size
    ->> Am I going rigth way???
    Please Help...
    Cheers :)
    Rushang Kansara
    Message was edited by:
    Rushang Kansara
    Message was edited by:
    Rushang Kansara

    Here is an example that shows SQL and PL/SQL methods. Note that the DBMS_LOB.WriteAppend() call is the wrong call to use (as I did above. The correct call to use (for appending CLOB to a CLOB) is DBMS_LOB.Append() (as shown below).
    SQL> create table my_docs
    2 (
    3 doc_id number,
    4 doc CLOB
    5 )
    6 /
    Table created.
    SQL>
    SQL> create sequence id
    2 start with 1
    3 increment by 1
    4 nomaxvalue
    5 /
    Sequence created.
    SQL>
    SQL>
    SQL> create or replace procedure AddXML( rowCount number DEFAULT 1000 ) is
    2 cursor curXML is
    3 select
    4 XMLElement( "ORA_OBJECT",
    5 XMLForest(
    6 object_id as "ID",
    7 owner as "OWNER",
    8 object_type as "TYPE",
    9 object_name as "NAME"
    10 )
    11 ) as "XML_DATA"
    12 from all_objects
    13 where rownum <= rowCount;
    14
    15 tmpClob CLOB;
    16 xml XMLType;
    17 lineCount number := 0;
    18 docID number;
    19 begin
    20 DBMS_LOB.CreateTemporary( tmpClob, TRUE );
    21
    22 open curXML;
    23 loop
    24 fetch curXML into xml;
    25 exit when curXML%NOTFOUND;
    26
    27 lineCount := lineCount + 1;
    28
    29 DBMS_LOB.Append(
    30 tmpClob,
    31 xml.GetCLOBVal() -- add the XML CLOB to our temp CLOB
    32 );
    33 end loop;
    34 close curXML;
    35
    36 insert
    37 into my_docs
    38 ( doc_id, doc )
    39 values
    40 ( id.NextVal, tmpClob )
    41 returning doc_id into docID;
    42
    43 commit;
    44
    45 DBMS_LOB.FreeTemporary( tmpClob );
    46 DBMS_OUTPUT.put_line( lineCount||' XML object(s) were appended to document '||docID );
    47 end;
    48 /
    Procedure created.
    SQL> show errors
    No errors.
    SQL>
    SQL> -- add 3 CLOBs of varying sizes
    SQL> exec AddXML
    1000 XML object(s) were appended to document 1
    PL/SQL procedure successfully completed.
    SQL> exec AddXML(100)
    100 XML object(s) were appended to document 2
    PL/SQL procedure successfully completed.
    SQL> exec AddXML(500)
    500 XML object(s) were appended to document 3
    PL/SQL procedure successfully completed.
    SQL>
    SQL> -- what are the sizes of the CLOBs and the total size?
    SQL> select
    2 doc_id,
    3 SUM( ROUND( LENGTH(doc)/1024 ) ) as "KB_SIZE"
    4 from my_docs
    5 group by
    6 ROLLUP(doc_id)
    7 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    154
    SQL>
    SQL> -- add an empty CLOB
    SQL> insert into my_docs values( 0, NULL );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL> -- note that the new CLOB is zero KB in size
    SQL> select
    2 doc_id,
    3 ROUND( LENGTH(doc)/1024 ) as "KB_SIZE"
    4 from my_docs
    5 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    0
    SQL>
    SQL> -- we add document 1 to 3 to document 0 using SQL
    SQL> update my_docs
    2 set doc = doc || (select t.doc from my_docs t where t.doc_id = 1 )
    3 where doc_id = 0;
    1 row updated.
    SQL>
    SQL> update my_docs
    2 set doc = doc || (select t.doc from my_docs t where t.doc_id = 2 )
    3 where doc_id = 0;
    1 row updated.
    SQL>
    SQL>
    SQL> update my_docs
    2 set doc = doc || (select t.doc from my_docs t where t.doc_id = 3 )
    3 where doc_id = 0;
    1 row updated.
    SQL>
    SQL> commit;
    Commit complete.
    SQL>
    SQL> -- what are the sizes now?
    SQL> select
    2 doc_id,
    3 ROUND( LENGTH(doc)/1024 ) as "KB_SIZE"
    4 from my_docs
    5 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    0 154
    SQL>
    SQL>
    SQL> -- we do the adds again, but time time using a PL/SQL procedure to do it
    SQL> declare
    2 cursor c is
    3 select doc from my_docs where doc_id in (1,2,3);
    4
    5 updateClob CLOB;
    6 appendClob CLOB;
    7 begin
    8 -- we must lock the row for update and then we can write directly
    9 -- to that row's CLOB locator (without using the UPDATE SQL statement)
    10 select
    11 doc into updateClob
    12 from my_docs
    13 where doc_id = 0
    14 for update;
    15
    16
    17 open c;
    18 loop
    19 fetch c into appendClob;
    20 exit when c%NOTFOUND;
    21
    22 -- we append the CLOBs to document 0
    23 DBMS_LOB.Append( updateClob, appendClob );
    24 end loop;
    25
    26 -- .. and commit the changes to document 0's CLOB locator
    27 commit;
    28 end;
    29 /
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    SQL> -- what are the sizes now?
    SQL> select
    2 doc_id,
    3 ROUND( LENGTH(doc)/1024 ) as "KB_SIZE"
    4 from my_docs
    5 /
    DOC_ID KB_SIZE
    1 98
    2 9
    3 47
    0 308
    SQL>

  • How come Apple Pay only shows time date city state for my transactions with it? It doesn't even show the name of the store or the amount-

    Using two separate Chase Visas, Apple Oay is working fine but the transaction list is very generic. It lists time, date, city, state and two dashes where amount should be. Shouldn't it at least show the name of the store and the amount?

    Hi.  I don't know if this will help, but I had this problem too.  Mine quit working after I used earbuds.  I was told that there is a switch inside the earbud port that tells the device to divert sound to earbuds.  This can get "stuck" and the device keeps thinking the earbuds are plugged in.  After reinserting the earbuds a few times, the switch was released and my speakers started working again.
    I'm not a techie.... this is just what I found to work after my iPhone 4S speakers quit.

  • LONG lag time switching from other programs to Flash

    (Intec-Mac - OSX - 1.5 GB RAM)
    Has anyone heard of this before? Any time I switch from any
    other open program to a project in Flash, I get a super long wait
    time before I'm able to work with Flash again. The lag time
    only happens when switching to Flash (I get the spinning
    ball of death while the Flash menus load again -EVERY time!)
    This happens no matter if I have just Flash open and I'm
    switching from the finder back to it or if I have 15 programs open
    at once...
    It is super frustrating and slowing down my workflow between
    Flash and any other programs! I just uninstalled and reinstalled
    hoping it would help but got same result - Any help?

    Your best bet at this point in time is more RAM, since the
    Flash IDE on
    mac is only PPC at this time it runs emulated in Rosetta on
    Intel macs,
    and I've noticed swap times can be quite slow, this is not
    unique to
    Flash in my experience, it happens whenever I swap in a
    resource
    intensive app. Parallels is another prime example - and it is
    intel
    native.
    Adobe engineers appear to have a new found love of the Mac,
    so we can
    only hope the intel native version ships it will be super
    zippy.
    John Pattenden
    Screentime Media - Flash Tools since 1997
    http://www.screentime.com

  • How is Processing time calculated in Simulation

    Hi,
    How is processing time calculated for every simulation-relevant object?
    say for example,
    i have 2 objects of person type (p1 and p1)
    4 human tasks (T1, T2, T3, T4)
    T1 assigned to p1, processing time 2hrs
    T2 assigned to p1, processing time 2hrs
    T3 assigned to p2, processing time 2hrs
    T4 assigned to p2, processing time 2hrs
    start --&gt; T1(p1) --&gt; T2(p1) --&gt; T3(p2) --&gt; T4(p2) --&gt; end
    Have not set any other simualtion parameters. now,
    * Duration for simulation is set to 6hrs,
    T1, T2, and T3 are getting processes once, but start event is getting processed twice
    # Why is start event getting processed second time?
    # Will this take any processing time..
    * Duration for simulation set to 7hrs,
    start event and T1 gets processed 2 times, T2 and T3 once..
    and the total processing time becomes *8hrs*..
    # At wht point of time does the second processing of T1 start.
    # If it is not after after the completion of one full process cycle, in this case, why not the second processing start at the end # of 2nd hour, or 4th hour.
    Thanks,
    Vishnupriya

    Hi Vishnupriya,
    "Why is start event getting processed second time?"Can you check the "Frequency" attribute of your start event? There you can specify how often the process will be triggered.
    "At wht point of time does the second processing of T1 start."You should be able to check it in the Processes (det.). It provides an overview regarding the process instances started during the simulation run. Furthermore you can check the Events (det.) category.
    Best regards,
    Danilo

  • ATP Check doesn't consider GR processing time for strategy 50

    Dear All,
    MRP strategy: 50
    Create PIR
    Create Sales order
    Run ATP and I find SAP doesn't  take GR processing time in MRP2 into account. Is there any setting for this?
    Thanks!
    B.R. Dazhi

    Hello Jageet,
    Please refer this discussion,
    ATP check. Problem with GR processing time
    Best Regards,
    R.Brahmankar

  • Query running for too long

    Hi All,
    Can someone pls help me in finding how long will it take to execute the below query.
    I have a query that is taking too long to execute.
    SELECT   CPU_TIME/1000000/60 CPUTIME, ELAPSED_TIME/1000000/60 ELAPSEDTIME, PROGRAM_LINE#, OPTIMIZER_COST,
    USER_IO_WAIT_TIME/1000000/60 IOWAITTIME,  DISK_READS, DIRECT_WRITES, BUFFER_GETS, to_char(Q.SQL_FULLTEXT), OPTIMIZER_MODE,  SHARABLE_MEM, PERSISTENT_MEM, RUNTIME_MEM, SORTS, FETCHES, EXECUTIONS, END_OF_FETCH_COUNT, USERS_EXECUTING, LOADS,
    FIRST_LOAD_TIME,  INVALIDATIONS, PARSE_CALLS, APPLICATION_WAIT_TIME, CONCURRENCY_WAIT_TIME, CLUSTER_WAIT_TIME,
    PLSQL_EXEC_TIME, JAVA_EXEC_TIME, ROWS_PROCESSED, COMMAND_TYPE, PARSING_USER_ID, PARSING_SCHEMA_ID, PARSING_SCHEMA_NAME, OBJECT_STATUS
         FROM     v$session S, v$sqlarea Q
         WHERE    S.SQL_ADDRESS = Q.ADDRESS
         AND      s.username = 'SCHEMA_NAME'
         AND       s.osuser = 'OSUSER_NAME';I can see CPU_TIME increasing. Is there any way that I can find how lmuch more time will it take for the query to execute.
    The query creates a table that has a sub query and inner query.
    rgds
    saaz

    http://www.gplivna.eu/papers/v$session_longops.htm
    There is a dynamic performance view v$session_longops that is populated for many long running operations in Oracle. The primary criterion for any operation to appear in v$session_longops is to run more than 6 seconds. Although this isn’t the only criterion as well as not all operations that take more than 6 seconds are shown in this view. For example one can find hash joins in v$session_longops, but you won’t find there nested loop joins even if they are longer than 6 seconds and are joining very big data sets.

Maybe you are looking for