Hi,
I've added a Scalar-Valued function
FUNCTION [dbo].[upd_state_name]
(@satae_id int)
RETURNS VARCHAR(50)
AS
BEGIN
DECLARE @chkTable int
SET @chkTable = (select COUNT(ItemID) from customtable_CityTest1)
IF @chkTable>0
BEGIN
DECLARE @state_name VARCHAR(50)
SELECT @state_name = st.State
FROM Cagan_States st JOIN customtable_CityTest1 ctest
ON st.ItemID = ctest.[State]
WHERE ctest.[State] = st.ItemID
RETURN @state_name
END
RETURN NULL
END
function works when i try it in sql management studio.
In cms sitemanager -> development-> customTables -> tabelName -> Queries -> SelectAll
I put this code:
SELECT ItemID, ItemCreatedBy, upd_state_name(State), StateResult , City
FROM customtable_CityTest1
And i get this error when trying to view customTable in cmsdesk:
[DataConnection.ExecuteQuery]: Query: SELECT ItemID, ItemCreatedBy, upd_state_name(State), StateResult , City
FROM customtable_CityTest1: caused exception: 'upd_state_name' is not a recognized built-in function name.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: [DataConnection.ExecuteQuery]: Query: SELECT ItemID, ItemCreatedBy, upd_state_name(State), StateResult , City
FROM customtable_CityTest1: caused exception: 'upd_state_name' is not a recognized built-in function name.
THANKS :)