Pushing Data from Cube View to ODBC SQL - with custom SQL Statement (Convert,Cast?)
Posted: Mon Jul 11, 2016 7:10 am
Hey there,
I'm struggling with following TI Process:
We want to push data from an cube view to an SQL Table - everything works fine except the "Timestamp" from Tm1 to SQL datetime field.
Code - Im generating an Timestamp (String):
So as far is I know I would have to convert that string into SQL datetime format with an convert statement like:
but I dont know how to do it?
Here's my code in the Data Tab - pushing several Variables to the SQL Table except my timestamp:
Could someone give me a hint which SQL Statement in which format I would have to use instead of inserting the string Variable "vTimestamp" on the End?
THANKS!
I'm struggling with following TI Process:
We want to push data from an cube view to an SQL Table - everything works fine except the "Timestamp" from Tm1 to SQL datetime field.
Code - Im generating an Timestamp (String):
Code: Select all
vNow=NOW();
vTimeStamp=TimSt (vNow, '\Y\m\d\h\i\s\');
Code: Select all
Syntax for CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
but I dont know how to do it?
Here's my code in the Data Tab - pushing several Variables to the SQL Table except my timestamp:
Code: Select all
odbcoutput('sample_go_DWH', 'INSERT INTO cognos10_gosalesdw.dbo.TM1_FACT_PLAN
(ACCOUNT_ID,
COST_CENTER_RP_ID,
AMOUNT_PLAN,
AMOUNT_ESTIM,
YEAR_EFFECTIVE,
TARGET_QUALIFICATION,
POPULATION_DATE)
VALUES ( '''|vAccID|''',
'''|vCostcRP|''',
'''|NumberToStringEx(vPlan,'0.#######','.','') |''',
'''|NumberToStringEx(vHore,'0.#######','.','') |''',
'''|vYear|''',
'''|vTarget_Qual|''',
'''|vTimestamp|''')');
THANKS!