create function problem

From: "Kancha (dot)" <kancha2np(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: create function problem
Date: 2002-03-19 08:25:33
Message-ID: 20020319082533.35506.qmail@web14909.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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/

Browse pgsql-sql by date

  From Date Subject
Next Message Matteo Beccati 2002-03-19 08:36:28 Re: create function problem
Previous Message Bruce Momjian 2002-03-18 23:20:37 Re: hashtext function disappears in 7.2?