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     [SOLVED] Calling SQL function with "User-Defined Table type" as Input parameter..

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Calling SQL function with "User-Defined Table type" as Input parameter..
 Login/Join
 
Gold member
posted
Hi,

How to pass the value(in the form of table) to User-Defined Table type parameter from webfocus while calling SQL function....?

I have created a User defined function in SQL Server which is use User-Defined Table Type as input parameter.

Example
 
CREATE FUNCTION Dept_TableValuedParameterExample(@TempTable deptMaster READONLY )
RETURNS TABLE 
AS
RETURN 
 (
	SELECT * FROM dbo.emp where dept in (select deptno from @TempTable)
)
 
 

and i have the User-Defined Table type for deptmMaster in sql server.
 
CREATE TYPE deptMaster AS TABLE
(
 deptno int,
)
GO
 

if i run the below query in SQL server,iam getting the data.
 
DECLARE @MyTable deptMaster
INSERT INTO @MyTable VALUES(2)
INSERT INTO @MyTable VALUES(3)
select ename,empno,dept from Dept_TableValuedParameterExample(@MyTable)
 


but how to achieve this from webfocus...?

This message has been edited. Last edited by: Maran,


WebFOCUS 8201m
Windows,AppStudio, DevStudio,All Outputs
 
Posts: 86 | Location: India | Registered: November 03, 2015Report This Post
Virtuoso
posted Hide Post
Hi Maran

Have you tried wrapping your SQL in a SQL Passthru?


ENGINE SQLMSS SET DEFAULT_CONNECTION connection
ENGINE SQLMSS
your SQL Code
END


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Gold member
posted Hide Post
Hi Chuck Wolff,
Thanks for your reply.

Yes, we tried SQL Passthru..but unable to pass table valued parameter to SQL passthru.
Is there any way to call below SQL function from webfocus...?

User Defined Table
CREATE TYPE deptMaster AS TABLE
(
 deptno int,
)
GO

SQL function
CREATE FUNCTION Dept_TableValuedParameterExample(@TempTable deptMaster READONLY )
RETURNS TABLE 
AS
RETURN 
 (
	SELECT * FROM dbo.emp where dept in (select deptno from @TempTable)
)
 


WebFOCUS 8201m
Windows,AppStudio, DevStudio,All Outputs
 
Posts: 86 | Location: India | Registered: November 03, 2015Report This Post
Virtuoso
posted Hide Post
Hi Maran

Can this function be saved as a SQL stored procedure. If so then you can create a synonym for the stored procedure and access it that way.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Guru
posted Hide Post
Maran,
Let us know if the previous suggestion helped you out. You can also search the Focal Point forum for "Stored Procedures". You'll find several discussions on this topic.

If you have found a solution please share so that others can benefit.

Thank you for participating in the Focal Point Forum!
Tamra Colangelo
Focal Point Moderator
Information Builders


WebFOCUS 8x - BI Portal, Developer Studio, App Studio, Excel, PDF, Active Formats and HTML5
 
Posts: 487 | Location: Toronto | Registered: June 23, 2009Report This Post
Gold member
posted Hide Post
Hi Chuck Wolff,
Thanks you so much for your valuable solutions!!!!

Instead of calling SQL function, we used all the queries in SQL Passthru from webfocus.

Thanks


WebFOCUS 8201m
Windows,AppStudio, DevStudio,All Outputs
 
Posts: 86 | Location: India | Registered: November 03, 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     [SOLVED] Calling SQL function with "User-Defined Table type" as Input parameter..

Copyright © 1996-2020 Information Builders