Re: [GENERAL] Hi there, new here and have question

2008-07-09 Thread Asche
CREATE OR REPLACE FUNCTION listofemployeebasedondepartment(_id_dept int) RETURNS SETOF record AS $BODY$ DECLARE empdata record; BEGIN RETURN QUERY SELECT e.*, d.department_name FROM employee e, dept d WHERE e.id_dept = d.id AND e.id_dept = _id_dept; RETURN; END; $BODY$ LANGUAGE 'plpg

Re: [GENERAL] Hi there, new here and have question

2008-07-08 Thread Asche
Any suggestion everyone? Sorry, i was to fast sending this email out ;-) change the first parameter in the first line to '_id_depth' CREATE OR REPLACE FUNCTION listofemployeebasedondepartment(_id_dept int) RETURNS SETOF employee AS $BODY$ BEGIN RETURN QUERY SELECT * F

Re: [GENERAL] Hi there, new here and have question

2008-07-08 Thread Asche
Hi Hendra, create function listofemployeebasedondepartment(id_dept int) $$ declare resultset ??; begin select * into resultset from employee where id_dept = id_dept; return resultset; end $$ language 'plpgsql'; I believe you get what I want But I just couldn't finish the code since I mi

Re: [GENERAL] bytea and character encoding when inserting escaped literals

2008-05-05 Thread Asche
Hi Lee, Thanks for the suggestion. I should have mentioned in my original message that as per your suggestion and the suggestion in the documentation, I have tried escaping the backslashes. When I do this, I get the error: ERROR: invalid input syntax for type bytea I tried also doing

Re: [GENERAL] bytea and character encoding when inserting escaped literals

2008-05-05 Thread Asche
Hi Lee, On 05.05.2008, at 17:07, Lee Feigenbaum wrote: INSERT INTO myTable VALUES (..., E'\x15\x1C\x2F\x00\x02...', ...) ; try escaping the backslashes: INSERT INTO myTable VALUES (..., E'\\x15\\x1C\\x2F\\x00\\x02...', ...) ; Jan -- Sent via pgsql-general mailing list (pgsql-general@postgre