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     can I call a user defined function in an open SQL statemnent?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
can I call a user defined function in an open SQL statemnent?
 Login/Join
 
Gold member
posted
Hi everybody!

I've been doing regular SQL statements and calling stored procedures for a while but I just tried to use a user defined fucntion in an SQL statement and I get an error:

(FOC1400) SQLCODE IS 208 (HEX: 000000D0) XOPEN: 42S02
: Microsoft OLE DB Provider for SQL Server: [42S02] Invalid object name 'd
: bo.fnWeekdaysDateDiff'. [42S02] Invalid object name 'dbo.fnWeekdaysDateD
: iff'. [42000] Statement(s) could not be prepared. [] Deferred prepare co
: uld not be completed.

I've searched the Inforesponse Support database and it's not in Supported nor Unsupported features for SQL

The SQL works fine outside WF:

SELECT
tbl0107_frmMedInfo_CCReports_ID AS ID,
'Investigation' AS TYPE,
CASE InvestigationStatus
WHEN 2 THEN dbo.fnWeekdaysDateDiff (InvestigationOpenDate, InvestigationClosedDate)
ELSE dbo.fnWeekdaysDateDiff (InvestigationOpenDate, GetDate())
END AS NBDAYS,
CASE InvestigationStatus
WHEN 0 THEN '(New)'
WHEN 1 THEN '(Open)'
WHEN 2 THEN '(Closed)'
WHEN 3 THEN '(Pending)'
END AS STATDESC
FROM pms_Infomanager..tbl0107_frmMedInfo_CCReports

What is wrong?

Thanks!


Web Focus Studio 5.2.5 on Win2k3
 
Posts: 87 | Location: Montreal, QC, Canada | Registered: September 03, 2004Report This Post
Master
posted Hide Post
I think this is an MS SQL Issues. If you look at the error message MS SQL Returned this error message. If you have multiple SQL Connections or multiple database make sure you set the correct one. If multiple Database try using the fully qualified name if the FROM Statement.

Hope this helps




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
My question would be; Does the user for the Data Adapter connection on the WF Reporting Server have the same priveledges in SQL server as you do when you run the query standalone?


WF 7.6.10 / WIN-AIX
 
Posts: 141 | Location: Denver, CO | Registered: December 09, 2005Report This Post
Gold member
posted Hide Post
Isn't it what I'm doing?

FROM pms_Infomanager..tbl0107_frmMedInfo_CCReports


(pms_Infomanager is the database name and tbl0107_frmMedInfo_CCReports is the table name)


Web Focus Studio 5.2.5 on Win2k3
 
Posts: 87 | Location: Montreal, QC, Canada | Registered: September 03, 2004Report This Post
Gold member
posted Hide Post
quote:
Originally posted by KevinG:
My question would be; Does the user for the Data Adapter connection on the WF Reporting Server have the same priveledges in SQL server as you do when you run the query standalone?


Yes! the IBI user has execute privileges on the function


Web Focus Studio 5.2.5 on Win2k3
 
Posts: 87 | Location: Montreal, QC, Canada | Registered: September 03, 2004Report This Post
Gold member
posted Hide Post
quote:
Originally posted by TexasStingray:
I think this is an MS SQL Issues. If you look at the error message MS SQL Returned this error message. If you have multiple SQL Connections or multiple database make sure you set the correct one. If multiple Database try using the fully qualified name if the FROM Statement.

Hope this helps


Thanks for your idea TexasStingray, I've added the databasename in front of the ownername when calling the function and it worked!

pms_Infomanager.dbo.fnWeekdaysDateDiff (InvestigationOpenDate, InvestigationClosedDate)

Thanks again for the quick reply.

Cheers.


Web Focus Studio 5.2.5 on Win2k3
 
Posts: 87 | Location: Montreal, QC, Canada | Registered: September 03, 2004Report This Post
Platinum Member
posted Hide Post
Sorry Flipper,

Let me back up a minute...Does the data adapter on your WF Reporting Server (EDASERVE) use Explicit, Password PassTHRU, or trusted security?

Kevin


WF 7.6.10 / WIN-AIX
 
Posts: 141 | Location: Denver, CO | Registered: December 09, 2005Report This Post
Gold member
posted Hide Post
quote:
Originally posted by KevinG:
Sorry Flipper,

Let me back up a minute...Does the data adapter on your WF Reporting Server (EDASERVE) use Explicit, Password PassTHRU, or trusted security?

Kevin


trusted


Web Focus Studio 5.2.5 on Win2k3
 
Posts: 87 | Location: Montreal, QC, Canada | Registered: September 03, 2004Report This Post
Platinum Member
posted Hide Post
OK... "Trusted Security" is one major difference between your configuration and the ones I have used over the years. We use explicit security. We have control that way over the priveledges the "Explicit" user has in the RDBMS. Since trusted security uses an impersonated operating system login, could it be that whatever login is used by the IWay adapter does not have permissions to the user defined function? It has been a couple of years since I have dealt directly with MSSQL Server and WebFOCUS, but we have no difficulty with our configuration against DB2...other than occasionally building a SQL statement that is too large to pass.

Anyone else have any other ideas?

Kevin


WF 7.6.10 / WIN-AIX
 
Posts: 141 | Location: Denver, CO | Registered: December 09, 2005Report This Post
Gold member
posted Hide Post
Thanks Kevin but I already have my answer... the dbname was missing in front of the ownername in my select, works fine now.


Web Focus Studio 5.2.5 on Win2k3
 
Posts: 87 | Location: Montreal, QC, Canada | Registered: September 03, 2004Report 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     can I call a user defined function in an open SQL statemnent?

Copyright © 1996-2020 Information Builders