Using TI to kick off a SQL Store Procedure

Post Reply
LanceTylor
Posts: 66
Joined: Mon Feb 27, 2012 12:37 am
OLAP Product: TM1
Version: 10.2.2 Fix Pack 4
Excel Version: 2010

Using TI to kick off a SQL Store Procedure

Post by LanceTylor »

Hi All,

I am currently trying to build a TI process that is can be used to trigger a SQL Store procedure followed by a standard TI cube data load process? An alternative process is that the store procedure that is triggered can kick off a TI process? I guess its a pull of the data from TI (most likely an action button) or push from SQL DB

The requirement I am trying to fulfil is giving the user the ability to update their transactional database (last minute monthly journal entry) and use a process to refresh the cube and subsequentially the income statement BI report. The dataflow is as follows: Transactional DB -> DB Staging Table(Store Procedure)-> TI Cube Load Process. This process is set to run nightly too.

Has anyone done this? Any ideas or guidance would be really helpful. Maybe using a CMD function?

As Always, thanks for any input

Regards
Lance
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Using TI to kick off a SQL Store Procedure

Post by Steve Rowe »

I think kicking off a stored proc is pretty straight forward from TI. Don't you just open up an ODBC connection in your TI and then issue whatever the SQL is that starts the stored proc?

A while since I've done it so I could be misremembering it...
Technical Director
www.infocat.co.uk
asutcliffe
Regular Participant
Posts: 164
Joined: Tue May 04, 2010 10:49 am
OLAP Product: Cognos TM1
Version: 9.4.1 - 10.1
Excel Version: 2003 and 2007

Re: Using TI to kick off a SQL Store Procedure

Post by asutcliffe »

I've not tried execute a stored procedure via ODBCOutput but I guess it should work. We've done something similar recently by using ExecuteCommand to trigger the process via the RDBMS's command line tool and then proceeding with the TI load. Setting ExecuteCommand's wait argument to 1 ensures the procedure finishes before progressing though behaviour might differ depending on the RDBMS you're using. We're using SQL Server's sqlcmd command.
mvaspal
Community Contributor
Posts: 341
Joined: Wed Nov 03, 2010 9:16 pm
OLAP Product: tm1
Version: 10 2 2 - 2.0.5
Excel Version: From 2007 to 2013
Location: Earth

Re: Using TI to kick off a SQL Store Procedure

Post by mvaspal »

We also go the exact same way as asutcliffe but from an oracle database.
LanceTylor
Posts: 66
Joined: Mon Feb 27, 2012 12:37 am
OLAP Product: TM1
Version: 10.2.2 Fix Pack 4
Excel Version: 2010

Re: Using TI to kick off a SQL Store Procedure

Post by LanceTylor »

Thanks for your quick responses. I am going to be looking at this next week so if all goes well you shouldn't hear from me.

Regards
Lance
iansdigby
Community Contributor
Posts: 109
Joined: Thu Feb 26, 2009 8:44 am
OLAP Product: TM1
Version: 9 + 10 + Plan An
Excel Version: All
Location: Isle of Wight, UK

Re: Using TI to kick off a SQL Store Procedure

Post by iansdigby »

Quite simply EXEC [stored procedure name]
within the Data Source tab of TI will run a SQL Server stored procedure as long as you have the ODBC set up correctly. It will return records too if needed.

And how much better than trying to write a complicated SQL string within the punishingly tiny window you get in TI. All the SQL code can be written in SQL server, with its lovely colour coded and debug-friendly interface.
"the earth is but one country, and mankind its citizens" - Baha'u'llah
Post Reply