create function problem

Поиск
Список
Период
Сортировка
От Kancha .
Тема create function problem
Дата
Msg-id 20020319082533.35506.qmail@web14909.mail.yahoo.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: hashtext function disappears in 7.2?
Следующее
От: "Matteo Beccati"
Дата:
Сообщение: Re: create function problem