Received: from qmail.crp.dnsalias.com (r-bo043-1-62.tin.it [213.45.32.62]) by postgresql.org (Postfix) with SMTP id 81478475937 for ; Tue, 19 Mar 2002 03:36:19 -0500 (EST) Received: (qmail 28402 invoked by uid 64014); 19 Mar 2002 08:35:58 -0000 Received: from m.beccati@crpsoftware.it by web1 with qmail-scanner-1.03 (sweep: 2.7/3.51. . Clean. Processed in 4.139376 secs); 19 Mar 2002 08:35:58 -0000 Received: from unknown (HELO smtp.crp) (10.1.3.151) by 10.1.3.1 with SMTP; 19 Mar 2002 08:35:52 -0000 Received: (qmail 29191 invoked from network); 19 Mar 2002 08:34:39 -0000 Received: from neptune.crp (HELO neptune) (10.1.1.8) by sentinel.crp with SMTP; 19 Mar 2002 08:34:39 -0000 From: "Matteo Beccati" To: "'Kancha .'" , Subject: Re: create function problem Date: Tue, 19 Mar 2002 09:36:28 +0100 Message-ID: <2780D698C269CB4EB303715BA48B6A103373@sole.CRP> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal In-Reply-To: <2780D698C269CB4EB303715BA48B6A10020CC7@sole.CRP> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200203/228 X-Sequence-Number: 7107 Hi, > create function usage(text) > returns numeric > as 'select ceil(sum(sessiontime)/60) from ath_online > where loginname=\'$1\' and startdate >= (select > startdate from cst_package where status=\'t\' and > cid=(select cid from cst_customer where > loginname=\'$1\'));' > language 'sql'; Try to replace \'$1\' with just $1 (i.e. loginname = $1). Regards -- Matteo Beccati C.R.P. Software S.r.l. http://www.crpsoftware.it/