Hello,
I am trying to create my first function, however I seem
to be stumbling into a problem I do not know the solution
to.
I keep getting the following error message:
ERROR: relation "activity" does not exist
KONTEXT: SQL function "test_get_activity"
The function I am trying to create looks like
this...
Code:
CREATE FUNCTION test_get_activity("fromDate" date, "toDate" date, "employeeSignature" "varchar") RETURNS SETOF record AS
$BODY$SELECT
Activity.EmployeeSignature,
Activity.Date,
Activity.End,
Activity.Start,
Activity.Note,
Activity.TypeID,
Activity.StatusCode,
ActivityType.FunctionCode,
ActivityType.Name
FROM
Activity, ActivityType
WHERE
($1 >= Activity.Date) and ($2 <= Activity.Date)
and
(Activity.EmployeeSignature == $3)$BODY$
LANGUAGE 'sql' VOLATILE;
ALTER FUNCTION test_get_activity(date, date, "varchar") OWNER TO postgres;
Any help to solve this problem is highly appreciated.
Kind Regards,
Diod