0

I am writing a postgres query which is a view. I have another stored function (functionsalary) in the databse. What i want to do is this:

 Create View salaries as
 Select name,
        employeeid,
        functionsalary.totalsalary
 from tblemployees
 JOIN functionsalary 
on employees.employeeid = functionsalary.employeeid

However when i try to run the same i keep getting the error saying 'functionsalary' does not exist. Even though i have checked that i can run the function independently and that it does output data. Is there a reason this is happenning. I'm Using POSTGRES(9.3). Thanks in advance.

1 Answer 1

1

Postgres has to know whether functionsalary is a table or a function. You should put the arguments list (maybe empty) of the function:

...
JOIN functionsalary() 
...
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks so much... I didn't know that. Works now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.