Skip to content

Commit

Permalink
Fix postgres function
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaksn committed Nov 16, 2023
1 parent 47ca28e commit fa89cdd
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.

CREATE OR REPLACE FUNCTION dbo.getodsinstancecontextvalues (apikey character varying)
RETURNS TABLE(key VARCHAR(50)
)
CREATE OR REPLACE FUNCTION dbo.getodsinstancecontextvalues (contextkey VARCHAR(50))
RETURNS TABLE(contextvalue VARCHAR(50))
AS
$$
#variable_conflict use_variable
BEGIN
RETURN QUERY
SELECT DISTINCT
ctx.contextvalue
FROM dbo.odsoinstances ods
INNER JOIN dbo.odsinstanceContexts ctx
ON ods.OdsInstanceId = ctx.OdsInstance_OdsInstanceId
WHERE ctx.ContextKey = @ContextKey;
FROM dbo.odsinstances ods
INNER JOIN dbo.odsinstancecontexts ctx
ON ods.odsinstanceid = ctx.odsinstance_odsinstanceid
WHERE ctx.contextkey = contextkey;
END
$$
LANGUAGE plpgsql;

0 comments on commit fa89cdd

Please sign in to comment.