Received: from web14909.mail.yahoo.com (web14909.mail.yahoo.com [216.136.225.61]) by postgresql.org (Postfix) with SMTP id B268F475937 for ; Tue, 19 Mar 2002 03:25:42 -0500 (EST) Message-ID: <20020319082533.35506.qmail@web14909.mail.yahoo.com> Received: from [202.161.138.9] by web14909.mail.yahoo.com via HTTP; Tue, 19 Mar 2002 00:25:33 PST Date: Tue, 19 Mar 2002 00:25:33 -0800 (PST) From: "Kancha ." Subject: create function problem To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200203/227 X-Sequence-Number: 7106 I've used the following sql to create the function and function creation is also successful. 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'; executing this function as select usage('kancha'); returns no records. while executing the query directly replacke $1 with kancha returns result. Where did i go wrong ?? __________________________________________________ Do You Yahoo!? Yahoo! Sports - live college hoops coverage http://sports.yahoo.com/