create function problem - Mailing list pgsql-sql

From Kancha .
Subject create function problem
Date
Msg-id 20020319082533.35506.qmail@web14909.mail.yahoo.com
Whole thread Raw
List 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/


pgsql-sql by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: hashtext function disappears in 7.2?
Next
From: "Matteo Beccati"
Date:
Subject: Re: create function problem