Received: from alfaqnet.qnet.com.pe ([200.24.174.251]) by postgresql.org (8.11.3/8.11.4) with SMTP id fA7HbQm14752 for ; Wed, 7 Nov 2001 12:37:32 -0500 (EST) (envelope-from qradius@qnet.com.pe) Message-Id: <200111071737.fA7HbQm14752@postgresql.org> Received: (qmail 32408 invoked from network); 7 Nov 2001 17:37:16 -0000 Received: from unknown (HELO Debug) (200.24.174.251) by 200.24.174.251 with SMTP; 7 Nov 2001 17:37:16 -0000 To: "pgsql-sql@postgresql.org" From: qradius@qnet.com.pe Subject: help with function and quotes Date: Wed, 7 Nov 2001 17:37:16 GMT X-Mailer: Endymion MailMan Standard Edition v3.0.20 X-Archive-Number: 200111/127 X-Sequence-Number: 5511 Dear Sirs: Please I am attempting implement a function that update a column to current time + X seconds So the query involved looks like: update mytable set mytime=now+'X seconds'; Here X is a integer value, Now I need implement this on my function, But I have problems at implement this at quotes, e.g. my function could looks like: CREATE FUNCTION addtime(integer) RETURNS INTEGER AS ' DECLARE additional ALIAS FOR $1; BEGIN update mytable set mytime=now()+''additional seconds''; END; ' return 1; LANGUAGE 'plpgsql'; I know probably this doesn't works, justly I have doubts about how to implement this since I want the funtion takes the variable additional , not the string 'additional', What I should to consider? I read the documentation on pqsql language aboute using quotes but none case is resemblance to my case. Can someone tell me an orientation about this? Thank you in advance. Ernesto --------------------------------------------- Este mensaje fue enviado a través de Qnet http://www.qnet.com.pe