cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

cannot use duplicate table name ct_fact_data

Former Member
3,879

Hi team,


I'm trying to run

'CALL "MY_FC10_PROD"."FC_CREATE_FACT_DATA"('ACTUAL', '2017.01', 'MYCORP', '%', 'EUR', 0)' and got this issue :

Could not execute 'CALL "MY_FC10_PROD"."FC_CREATE_FACT_DATA"('ACTUAL', '2017.01', 'MYCORP', '%', 'EUR', 0)' in 6.302 seconds .
[129]: transaction rolled back by an internal error: [129] "MY_FC10_PROD"."FC_CREATE_FACT_DATA": line 185 col 3 (at pos 5846): [129] (range 3): transaction rolled back by an internal error: cannot use duplicate table name: CT_FACT_DATA: line 1 col 56 (at pos 55)

Could you help ?
Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi Marc, hi all

You right, in fact is even if I write CALL "MY_FC10_PROD"."FC_CREATE_FACT_DATA"('ACTUAL', '2017.01', 'MYCORP', '%', 'EUR', 0)

the schema used wasn't MY_FC10_PROD, but SYSTEM. As there was no table in SYSTEM schema, the condition go to the "else" way and crash.

Solution is to set system before launching proc :

SET SCHEMA MY_FC10_PROD;

CALL "MY_FC10_PROD"."FC_CREATE_FACT_DATA"('ACTUAL', '2017.01', 'MYCORP', '%', 'EUR', 0);

Thanks you very much for your help Marc !

e_malan
Explorer
0 Likes

Hi Vivian

Your'e right.

The "FC_CREATE_FACT_DATA" was designed to be called form an SQL rule within the the SAP FC Schema / DB user.

You can also customize the FC_CREATE_FACT_DATA to use a particular schema, or reloslv ethe correct schema form the launching command, or use a differtent table name for the fact table.

Etienne

Answers (1)

Answers (1)

Marc_Kuipers
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Vivian

Strange..

The sTBL is set to 'CT_FACT_DATA'

DECLARE sTBL NVARCHAR(128) := 'CT_FACT_DATA';

Then, this statement is issued

SELECT COUNT(table_name) INTO nCount FROM tables WHERE table_name = UPPER(:sTBL) AND schema_name = CURRENT_SCHEMA;

Because the code executes the "else" clause, it means nCount has a value of 0

But that implies CT_FACT_DATA does not exist (and therefore the rename can be done), but the error shows that CT_FACT_DATA does exists, as you cannot create a duplicate

Can you check in CURRENT_SCHEMA if the table is indeed present?

Marc

Former Member
0 Likes

Yes, the CT_FACT_DATA table exists in MY_FC10_PROD schema.

But in the documentation https://help.sap.com/doc/ee41e3f574631014a7da368fb0e91070/10.1.5/en-US/fc_101_admin_en.pdf tell that when we use 0 as last parameter, the procedure should do an update. So quite weird if error message ask for CT_FACT_DATA not exist...