I am new to postgres from sql server. I have written a function getSkill that takes an integer and returns a type "Skills" from the "Skills" table. Now I want to feed it "SkillIDs" of type integer from the "Jobs" table. If I do this, then postres says there is a syntax error and puts a little caret at ^getSkill.
select * from getSkill(select "SkillID" from "Jobs" where "JobID"="posID") //syntax error at ^getSkill
I am pretty sure the statement in the () is a valid postgres statement--but if I replace it with an integer the sytnax error goes away.
select * from getSkill("0") //returns an error saying there is no row at position 0 in the DB, because it is still unfilled2
This is confusing for me. The syntax error seems to go away if I replace a valid postres statement returning an integer with a simple integer.
Can somebody explain what's up?