Unanswered: AHH - invalid input syntax for type boolean
Has anyone come accross the 'invalid input syntax for type boolean' error - its driving me crazy trying to figure out what is wrong with my function/java code!!!
The postgres (using 8.1) function is:
CREATE OR REPLACE FUNCTION selectstaffroles("varchar")
RETURNS refcursor AS
whereClause ALIAS FOR $1;
OPEN ResultSet FOR
EXECUTE 'SELECT role.* FROM role left join staffrole on staffrole.roleid=role.roleid WHERE ' || whereClause;
LANGUAGE 'plpgsql' VOLATILE;
WhereClause sent via java code =
c.colStaffRoleStaffID+"="+staff.getUserStaffID() -which basically is staffid=2
Once this query is executed via the java code i get the 'invalid input syntax for type boolean: "staffid=2" ' error. However if I type select selectstaffroles('staffid=2') using pgAdmin SQL window - no problems!
ANY HELP or suggestions will be greatly appreciated! - Thanks in advance!
No worries! Have sorted it - just needed some sleep!
The code above is correct - no problems with it at all!
Just incase anyone else encounters this problem - the error was in fact lurking elsewhere in my code! Within another method which was used in my java code I had enclosed the whereClause within quotes! - Removed them and problemo solved!