This is the automatically generated code after setting the configuration options in the "New Function" popup
CREATE OR REPLACE FUNCTION "getID"(tname character varying, tarname character varying) RETURNS integer AS $BODY$BEGIN SELECT id FROM tname WHERE name=tarname; END$BODY$ LANGUAGE plpgsql VOLATILE COST 100; ALTER FUNCTION "getID"(character varying, character varying) OWNER TO postgres;
Error Generated
ERROR: function getid(unknown, unknown) does not exist
LINE 1: SELECT getID('test','lliok');
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
********** Error **********
ERROR: function getid(unknown, unknown) does not exist
SQL state: 42883
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Character: 8
attempt to call function from query window within pgadminIII, that generated error
SELECT getID('test','Biggie');
Tried this too
SELECT "getID"('test','Biggie');
but got this error
ERROR: relation "tname" does not exist
LINE 1: SELECT id FROM tname WHERE name=tarname
^
QUERY: SELECT id FROM tname WHERE name=tarname
CONTEXT: PL/pgSQL function "getID" line 2 at SQL statement
********** Error **********
ERROR: relation "tname" does not exist
SQL state: 42P01
Context: PL/pgSQL function "getID" line 2 at SQL statement
any suggestions? thanks
This post has been edited by Atli: 27 August 2012 - 09:34 PM
Reason for edit:: Moved to the Database forum.

New Topic/Question
Reply




MultiQuote




|