0

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?

1 Answer 1

1

I think it should be

select getSkill(SkillID) from Jobs where JobID="posID"
Sign up to request clarification or add additional context in comments.

Comments

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.