Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]How to capture MS SQL Server Stored Procedure output
Go
New
Search
Notify
Tools
Reply
  
[CLOSED]How to capture MS SQL Server Stored Procedure output
 Login/Join
 
Member
posted
I have a stored procedure that returns a '1' using "SELECT '1'" to signify that it completed successfully. I use this stored proc to update a table in WebFOCUS as follows:

ENGINE SQLMSS SET DEFAULT_CONNECTION BI
SQL SQLMSS EX dbo.usp_FSG_ScoreCard_Exception_Group '&METRIC', &SOURCE ,&METRIC_GK, '&REQUESTOR' , &REASON, '&TYPE' , NULL ;
END

In addition, I have another stored proc that I call after the "usp_FSG_ScoreCard_Exception_Group" stored proc as follows:

ENGINE SQLMSS SET DEFAULT_CONNECTION BI
SQL SQLMSS EXEC dbo.usp_LoadFSG_ScoreCardMissingTimeCard
END

My issue is that the second stored proc "usp_LoadFSG_ScoreCardMissingTimeCard" takes around a minute to run since it's updating a huge table. So, since WebFOCUS waits for the second stored proc to complete, a simple update using the first stored proc seems like it takes a minute to run.

How do I make WebFOCUS aware that the first stored proc is complete, start the second stored proc and exit out of my fex without having to wait for the response from the second stored proc?

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8.x, Windows, HTML/PDF
 
Posts: 23 | Registered: April 29, 2016Reply With QuoteReport This Post
Guru
posted Hide Post
Can you use 2 fex, each one to each SP.


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Can you run your fex's in deferred mode?

Alternatively, you could schedule them to run using CMRUN from the OS command line or in a batch executable.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Member
posted Hide Post
quote:
Originally posted by Ricardo Augusto:
Can you use 2 fex, each one to each SP.


I will try to create a second fex for the second stored proc? I am new to WebFOCUS, so how would I call the second fex from the first one? Do I just include it using "-INCLUDE"?


WebFOCUS 8.x, Windows, HTML/PDF
 
Posts: 23 | Registered: April 29, 2016Reply With QuoteReport This Post
Member
posted Hide Post
quote:
Originally posted by BabakNYC:
Can you run your fex's in deferred mode?

Alternatively, you could schedule them to run using CMRUN from the OS command line or in a batch executable.


The fex is in a html file. So I am not sure how I would run it in a deferred mode? I need to execute the second procedure only after the first one is done executing.


WebFOCUS 8.x, Windows, HTML/PDF
 
Posts: 23 | Registered: April 29, 2016Reply With QuoteReport This Post
Guru
posted Hide Post
quote:
I will try to create a second fex for the second stored proc? I am new to WebFOCUS, so how would I call the second fex from the first one? Do I just include it using "-INCLUDE"?



Yes. Use like this -INCLUDE IBFS:/WFC/Repository/app_name/full_path/fex2.fex


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Reply With QuoteReport This Post
Expert
posted Hide Post
Have you considered the SQL Trace commands?
 
Posts: 3135 | Location: Tennessee, Nashville area | Registered: February 23, 2005Reply With QuoteReport This Post
Member
posted Hide Post
quote:
Originally posted by Doug:
Have you considered the SQL Trace commands?


I haven't. Could you give me some pointers on how to get started and what I should look for in the trace?


WebFOCUS 8.x, Windows, HTML/PDF
 
Posts: 23 | Registered: April 29, 2016Reply With QuoteReport This Post
Expert
posted Hide Post
Sure, I feel generous today. Add the following to / before your TABLE FILE request
SET XRETRIEVAL = OFF
SET TRACEUSER  = CLIENT
SET TRACEON    = STMTRACE//CLIENT
SET TRACEON    = SQLAGGR//CLIENT
SET TRACESTAMP = OFF
SET TRACEWRAP  = 132
SET EMGSRV     = ON

The results of this can be pasted directly into TOAD, or you SQL tool, for analysis (explain plan).
 
Posts: 3135 | Location: Tennessee, Nashville area | Registered: February 23, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
You can create a fex with that code and -INCLUDE it where ever you want it...
 
Posts: 3135 | Location: Tennessee, Nashville area | Registered: February 23, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
OK, So I forgot those lines and searched "sql trace commands and found this...

It's true what they say: What goes around ... Comes Around Smiler




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3135 | Location: Tennessee, Nashville area | Registered: February 23, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]How to capture MS SQL Server Stored Procedure output

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.