Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting Cognos applications from SQL server ? 1

Status
Not open for further replies.

Recce

Programmer
Aug 28, 2002
425
ZA
Good day

Can anyone tell me if they have ever tried to start or kick off a Cognos application like transformer or a bat file from SQL server once the SQL server job is completed. In my case, I am running SQL server and Cognos on two different servers. Any suggestions of how to do this would be greatly appreciated. Thanks :)

[pipe] "We know nothing but, that what we know is not the truth..." - Me
 
Since, two different servers are used in the application the best and easy solution that I could think of is by having one status table in the SQL Server. This table will get updated after the successful completion of the job. Create one Cognos script that will be running constantly or scheduled at some particular time on the other server to read this table value. Once the table gets updated, the script can kick off any cognos application or perform anything and have the table value reset after successful completion.

Scottsdale
Time is running... Act Fast [hourglass]
 
Hi scottsdale2k,

I like your ideas...I think it can work and I am going to try it...my only concern is that by having a script running on the Cognos server may cause the server to hang at times...what is your feeling about this...then the other thing is, I will have to go and figure out the code to read the SQL table and to then start the Cognos applications according to the table status.Do you by any chance have some code on this. Thanks for your help. :)

[pipe] "We know nothing but, that what we know is not the truth..." - Me
 
This Code will open connect to the database
CONNECTION = SQLOPEN(LOGIN_STRING,OUTPUTSTR,PROMPT:=3)

Use this statement to run query
RETCODE = SQLEXECQUERY(CONNECTION, QUERY)

Use this statment to copy the result into array
RETCODE = SQLRETRIEVE(CONNECTION:=CONNECTION,DESTINATION:=DESTINATION,COLUMNNAMES:=0,ROWNUMBERS:=0,MAXROWS:=3,MAXCOLUMNS:=4,FETCHFIRST:=0)

For eg, to create transformer object use this code
SET OBJ_TRANS = CREATEOBJECT("COGNOSTRANSFORMER.APPLICATION.CER3")

Use "DO Events" in your Loop to avoid server getting hang
DO
DOEVENTS
Get Database value
Have some condition and perform appropriate option
LOOP UNTIL FALSE Condition


Time is Running... Act Fast [hourglass]

 
Cool code...scottsdale2k. Thanks for this. I will definitely use it. [thumbsup2]

[pipe] "We know nothing but, that what we know is not the truth..." - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top