HI,
Could someone tell me what I am doing wrong please (Postgresql 7.2).
Thanks
The functions I am creating is:
CREATE OR REPLACE FUNCTION getthemedescription (text) RETURNS text AS
'
DECLARE
themeid ALIAS FOR $1;
metaid metadata.meta_id%TYPE;
generalid general.general_id%TYPE;
descriptionidcursor CURSOR FOR SELECT description_id FROM
general_description WHERE general_id = generalid;
BEGIN
SELECT INTO metaid meta_id FROM themehasmetadata WHERE theme_id =
themeid;
SELECT INTO generalid general_id FROM meta_general WHERE meta_id =
metaid;
OPEN descriptionidcursor;
RETURN "descriptionidcursor"
END;
' LANGUAGE 'plpgsql';
I call this function in the following way:
String themeID = "mathematics";
String queryString = "SELECT getthemedescription(" + themeID +
")");
Statement stmt = conn.createStatement();
ResultSet l_cursorRSet = stmt.executeQuery(queryString);
.......
If I send the themeID as above I get: ERROR: Attribute 'mathematics' not
found.
If I send the themeID = "'mathematics'" I get: fmgr_info: function
24907: cache lookup failed.
I think it has something to do with the quotes, but what?
Best regards
Jose Luis