Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Pass Variable to SQL in Editor

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Pass Variable to SQL in Editor
 Login/Join
 
Member
posted
Hi, I'm trying to create a chart that can run base on a couple of parameters. I am having issues creating a variable and sending it via SQL.

My code is below. The message I receive is that no rows are returned, yet, if I run this same code in SQL Management Studio, I receive records.

 

SQL SQLMSS PREPARE SQLOUT FOR

SELECT
	 SummaryScorecard.AsOfDate
	,Sites.SiteName
	,Metrics.MetricID
	,Metrics.MetricName
	,Benchmarks.BenchmarkValueNumber
	,MetricTarget = CONVERT(DECIMAL(18,4),Benchmarks.BenchmarkValueNumber) * 100
	,SummaryScorecard.Numerator
	,SummaryScorecard.Denominator

FROM
	dbo.Scorecard SummaryScorecard
	INNER JOIN dbo.Metrics Metrics
		ON SummaryScorecard.MetricID = Metrics.MetricID
			AND Metrics.StatusCode = 1
	INNER JOIN dbo.ProviderList Provider
		ON SummaryScorecard.NPI = Provider.NPI
	INNER JOIN dbo.Sites Sites
		ON Provider.REV_LOC_ID = Sites.REV_LOC_ID
	INNER JOIN dbo.Markets Markets
		ON Sites.MarketID = Markets.MarketID
	INNER JOIN dbo.Benchmarks Benchmarks
		ON Metrics.MetricID = Benchmarks.MetricID
WHERE
	Metrics.MetricID = &Metric
END

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


WebFOCUS 8
Windows, All Outputs
 
Posts: 4 | Registered: April 06, 2016Report This Post
Guru
posted Hide Post
Reallly?


Does your SQL Management Studio understand the "WHERE
Metrics.MetricID = &Metric "

When you run it from WebFOCUS, it is supposed to prompt the value for &Metric.

I would suggest use this:


SQL MSS PREPARE SQLOUT FOR

SELECT
...
FROM
...
WHERE
;
END


TABLE FILE SQLOUT
PRINT *
END

  


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
"&Metric" is ALPHA, surround it with single-quotes and add .EVAL to it: WHERE Metrics.MetricID = '&Metric.EVAL'.

Also, 1) set &ECHO to ALL, 2) Add some TYPE statement before the "SQL SQLMSS PREPARE SQLOUT FOR" for each of the variables.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Member
posted Hide Post
Try placing -SET &ECHO='ALL'; at the top and then exit out after the sql. You will get the code that is being sent to the database. It might be that the variable isn't being set the way you thought.


WebFOCUS 8.008
 
Posts: 1 | Location: United States | Registered: April 01, 2015Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Pass Variable to SQL in Editor

Copyright © 1996-2020 Information Builders