Grant Masan wrote:
>
> select '000100' as length, sum(ship1) as ship1 ,sum(ship2) as
> ship2,sum(ship3) as ship3,sum(ship4) as ship4,sum(ship5) as ship5 FROM
> (select
> count(CASE WHEN (type between 40 and 49) THEN 1 ELSE NULL END) as ship1,
> count(CASE WHEN (type between 60 and 69) THEN 1 ELSE
I am trying to create a function that will grind through a cdr table and
populate another table. I am trying to load the function and am getting the
following error:
ERROR: function result type must be specified
CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp)
2009/10/30 Plugge, Joe R.
> I am trying to create a function that will grind through a cdr table and
> populate another table. I am trying to load the function and am getting the
> following error:
>
>
>
> ERROR: function result type must be specified
>
>
>
>
>
> CREATE FUNCTION gen_simultaneo
Thanks Brian, I changed it to this:
CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp)
RETURNS VOID AS $$
DECLARE
mycount integer;
BEGIN
WHILE mystart < mystop + INTERVAL '1 day' LOOP
SELECT INTO mycount count(*) FROM log_calls WHERE startdate < mystart and
2009/10/30 Plugge, Joe R.
> Thanks Brian, I changed it to this:
>
>
>
> CREATE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop timestamp)
> RETURNS VOID AS $$
>
> DECLARE
>
> mycount integer;
>
> BEGIN
>
> WHILE mystart < mystop + INTERVAL '1 day' LOOP
>
> SELECT INTO mycou
Thanks, I changed my code to this, it compiled, and it seems to be running now:
CREATE OR REPLACE FUNCTION gen_simultaneous_calls(mystart timestamp, mystop
timestamp) RETURNS VOID AS $$
DECLARE
mycount integer;
newstart timestamp := mystart;
newstop timestamp := mystop;
BEGIN
WHIL
"Plugge, Joe R." writes:
> Thanks, I changed my code to this, it compiled, and it seems to be running
> now:
It looks like you are expecting assignment to the input parameters to do
something useful ... it will not. Maybe you need some output
parameters?
regards, tom la
Tom Lane wrote on 30.10.2009 05:44:
select pg_get_functiondef('foo(int)'::regproc)
select pg_get_functiondef('foo(int4)'::regproc)
select pg_get_functiondef('foo(integer)'::regproc)
but each time I get the error: function "foo(integer)" does not exist
What am I missing?
You need to use regpro