Received: from linux.qnet.com.pe ([200.37.231.132]) by postgresql.org (8.11.3/8.11.4) with SMTP id fA7GKjm11773 for ; Wed, 7 Nov 2001 11:20:47 -0500 (EST) (envelope-from efreyre@qnet.com.pe) Received: (qmail 5035 invoked from network); 7 Nov 2001 16:14:56 -0000 Received: from unknown (HELO mihost) (200.37.231.133) by 200.37.231.132 with SMTP; 7 Nov 2001 16:14:56 -0000 Message-ID: <000a01c167a8$3b430860$a164a8c0@mihost> From: "Ernesto Freyre" To: Subject: help with sintaxis of quotes on function Date: Wed, 7 Nov 2001 11:21:17 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0007_01C1677E.51C527A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200111/125 X-Sequence-Number: 5509 This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C1677E.51C527A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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=3Dnow+'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=3Dnow()+''additional seconds''; END; ' return 1; LANGUAGE 'plpgsql'; I know probably this doesn't works, justly I have doubts about how to impl= ement this since I want the funtion takes the variable additional , not the= string 'additional', What I should to consider? I read the documentation o= n pqsql language aboute using quotes but none case is resemblance to my cas= e. Can someone tell me an orientation about this? Thank you in advance. Ernesto ------=_NextPart_000_0007_01C1677E.51C527A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear Sirs:
 
Please I am attempting implement a functio= n that=20 update a column to current time + X seconds
 
So the query involved looks like:
 
update mytable set mytime=3Dnow+'X=20 seconds';
 
Here X is a integer value,
 
Now I need implement this on my function, = But I=20 have problems at implement this at quotes, e.g. my function could looks=20 like:
 
CREATE    FUNCTION=20 addtime(integer) RETURNS INTEGER AS '
DECLARE
   additional ALIAS FOR $1;
BEGIN
  update mytable set mytime=3Dnow()+'= 'additional=20 seconds'';
END;
'
return 1;
LANGUAGE 'plpgsql';
 
I know probably this doesn't  works, = justly I=20 have doubts about how to implement this since I want the funtion takes the= =20 variable additional , not the string 'additional', What I should to conside= r? I=20 read the documentation on pqsql language aboute using quotes but none case = is=20 resemblance to my case.
 
Can someone tell me an orientation about= =20 this?
 
Thank you  in advance.
 
Ernesto
 
 
 
------=_NextPart_000_0007_01C1677E.51C527A0--