Skip site navigation (1) Skip section navigation (2)

Function problem

From: "Patrick Hatcher" <PHatcher(at)macys(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Function problem
Date: 2002-03-16 00:58:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Howdy all,

I have a function that worked as regular SQL before I tried to make it a
function.  I suspect it has something to do with the literal strings I'm
looking at, but I can't figure it out.  every time I run the function, I
get an error message on the word TEMP.  I've tried removing the word temp
but then the error jumps to crossYTD.   I've tried making the literals
single quotes, but that doesn't seem to work.  Any suggestions?  TIA.

Create Function sp_ddw_crosstab() RETURNS int4 AS '


     /* Create the cross tab of YTD data */
     Select Item_UPC, Cat_Desc,Pat_Desc,
     Sum( Case Appl_ID When "NET" Then RESERVEDUNITS1 Else 0 End) as
     Sum( Case Appl_ID When "NET" Then RESERVEDDOLLARS Else 0 End) as
     into  TEMP crossytd
     From salesYTD q
     Group by Item_UPC,Cat_Desc,Pat_Desc;
     return 1;

'LANGUAGE 'plpgsql';

Patrick Hatcher
Legacy Integration Developer
415-932-0610 office
HatcherPT - AIM

pgsql-novice by date

Next:From: Patrick HatcherDate: 2002-03-16 02:46:43
Subject: Re: Function problem
Previous:From: Tom LaneDate: 2002-03-15 23:16:33
Subject: Re: 7.2 compile problem on HP/UX

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group