I've got a similar issue, I'm trying to send the data from a text file to an SQL database.
Our current set up is using MS Access to import the text file and then "append" the new transaction data into our SQL database, we want to automate this via a TM1 process.
I seem to be able to generate the exact same SQL statement from Tm1 that I use in my Visual Studio but I get this error:
12004 ERROR 2012-09-10 00:59:16.543 TM1.Process Process "123 JC Trans Daily 3": : Could not initialize process
This is my code:
Code: Select all
#========= P R O L O G =========
# Open the ODBC Connection
ODBCOpen('TM1DBP_UAT', '', '');
#Define Variables
MyCube = 'z_ctrl_measures';
Period = CellGetS (MyCube , 'Current Trans Daily Date', 'String 1');
#=============== D A T A ===============
# Use ODBC link to Insert Trans_Temp table to the Transactions_Details table.
#Syntax:
# ODBCOutPut( 'ODBC Connection Name', Expand( 'INSERT INTO TableName ( Coulmn1,Coulmn2,Coulmn3,Coulmn4,Coulmn5, Coulmn6 )' | '
# VALUES (''%v1%'',''%v2%'',''%v3%'',''%v4%'',''%v5%'',''%v6%'',%v7%)'));
sqlStmt = Expand( 'INSERT INTO TRANSACTION_DETAIL (COY_NO , GL_ACCOUNT , RC, TRANS_DATE ,
TRANS_CODE , DESCRIPTION , TRANS_SOURCE , TRANS_REF , AMOUNT , LV , TRANS_DATE_EFF , SEQUENCE_NO ,
BATCH_NO , TM1_MONTH , FDL_B , TM1_Daily , TYPE , MAPA , MAPB , MAPC , MAPD , PRODPROC ,
AMOUNT_AVG ) ' | ' VALUES (''%COY_NO%'' , ''%GL_ACCOUNT%'' , ''%RC%'', ''%TRANS_DATE%'' , ''%TRANS_CODE%'' , ''%DESCRIPTION%'' ,
''%TRANS_SOURCE%'' , ''%TRANS_REF%'' , %AMOUNT% , ''%LV%'' , ''%TRANS_DATE_EFF%'' , ''%SEQUENCE_NO%'' , ''%BATCH_NO%'' ,
''%TM1_MONTH%'' , ''%FDL_B%'' , ''%TM1_Daily%'' , ''%TYPE%'' , ''%MAPA%'' , ''%MAPB%'' , ''%MAPC%'' , ''%MAPD%'' , ''%PRODPROC%'' ,
%AMOUNT_AVG% )') ;
# Remove the Quote Characters from the SQL
DatasourceASCIIQuoteCharacter='';
Asciioutput ( '\\aussydtm002\tm1\temp\sql Daily 3.txt', sqlStmt );
ODBCOutput('TM1DBP_UAT', sqlStmt ) ;
#========= E P I L O G =========
# Execute process for check to see if Balances send in the SQL query match to the balances in z_ctrl_measures cube
ExecuteProcess('123 JC Trans Daily 3a', 'cubename', 'z_ctrl_measures',
'z_ctrl_measures' , 'Current Trans Daily Date', 'z_string' , 'TM1_Daily' );
# Close the ODBC link to the SQL DB
ODBCClose('TM1DBP_UAT') ;
The result of the asciioutput is:
INSERT INTO TRANSACTION_DETAIL (COY_NO , GL_ACCOUNT , RC, TRANS_DATE ,TRANS_CODE , DESCRIPTION , TRANS_SOURCE , TRANS_REF , AMOUNT , LV , TRANS_DATE_EFF , SEQUENCE_NO ,BATCH_NO , TM1_MONTH , FDL_B , TM1_Daily , TYPE , MAPA , MAPB , MAPC , MAPD , PRODPROC ,AMOUNT_AVG ) VALUES ('2400' , '0222513000' , '1180', '120906' , '61' , 'TAX' ,'PT' , '00426664' , 116.180 , '52' , '120906' , '00001' , '9743' ,'Sep 2012' , '' , '06 Sep 2012' , 'FMS' , '' , '' , '' , '' , '' , 0.000 )
I have requested our Tech team to confirm that our TM1 Admin account has access to TM1DBP_UAT and they say it does (though not exactly sure on how to prove this).
Anyone have any suggestions?