Error Creating QueryView with TVF

I'm getting the error below when I attempt to load a query view Table value function in 3.0 SP13.

LOADSPEC ERROR:The specified function name does not match the name of the table-valued function being created.

This occurs because of the case of the text "CREATE FUNCTION".  This issue is addressed in 4.0, as the case of the text no longer matters.  In 3.0, this can be corrected by creating functions in lower case like:"create function" 

Steps to Duplicate

1. Run the below SQL.

exec usp_loadspec

@forcereload=1,

@specxml=

'<QueryViewSpec

xmlns="bb_appfx_queryview"

xmlns:common="bb_appfx_commontypes"

ID="551e8b8d-5da5-48f5-a2f7-64e748320631"

Name="My Function Query View"

Description="Top 50 Donors"

Author="Operation Mobilization"

IsRoot="false"

PrimaryKeyField="SITEID"

RecordType="Constituent"

common:SecurityUIFolder="FD Reports"

>

<TVFImplementation FunctionName="USR_UFN_QUERY_MYFCN">

<CreateFunctionSQL>

<![CDATA[

CREATE FUNCTION dbo.USR_UFN_QUERY_MYFCN ()

RETURNS TABLE

AS

RETURN (

SELECT SITEID FROM APPUSER WHERE ID = ''5DF0A63F-898A-48C2-85F7-27DA63807BD1''

)

]]>

</CreateFunctionSQL>

</TVFImplementation>

 

<!-- describe each field in the view output -->

<Output>

<OutputFields>

<OutputField Name="SITEID" Caption="Site ID" DataType="Guid" />

</OutputFields>

</Output>

</QueryViewSpec>'

Environment

 Blackbaud Infinity SDK
 3.0

Was this article helpful?