Ang
Ang

Reputation: 153

POSTGRES Joining a function in a View

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.

Upvotes: 0

Views: 214

Answers (1)

klin
klin

Reputation: 121534

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() 
...

Upvotes: 1

Related Questions