Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 727091337B82 for ; Thu, 4 Nov 2010 17:07:13 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 59374-05 for ; Thu, 4 Nov 2010 20:07:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw05.intertain.com (gw05.intertain.com [209.101.231.5]) by mail.postgresql.org (Postfix) with ESMTP id 537EA1337B6D for ; Thu, 4 Nov 2010 17:07:04 -0300 (ADT) Received: from [192.168.1.184] (softdnserr [::ffff:192.168.1.184]) (AUTH: LOGIN rsmith, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by gw05.intertain.com with esmtp; Thu, 04 Nov 2010 13:07:02 -0700 id 0088C003.4CD31267.00000172 Message-ID: <4CD31266.2000506@10kinfo.com> Date: Thu, 04 Nov 2010 13:07:02 -0700 From: Ralph Smith User-Agent: Thunderbird 2.0.0.24 (X11/20101027) MIME-Version: 1.0 CC: pgsql-sql@postgresql.org Subject: Re: I'm stuck - I just can't get this small FUNCT to run! References: <4CD1F792.6040907@10kinfo.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------040407080705040409040606" Received-SPF: pass (Address passes the Sender Policy Framework) SPF=FROM; sender=rsmith@10kinfo.com; remoteip=::ffff:192.168.1.184; remotehost=softdnserr; helo=[192.168.1.184]; receiver=gw05.intertain.com; X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.878 tagged_above=-5 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, MISSING_HEADERS=1.021 X-Spam-Level: X-Archive-Number: 201011/11 X-Sequence-Number: 34749 This is a multi-part message in MIME format. --------------040407080705040409040606 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thank you both. I stared and stared and stared, and apparently I needed to take a walk around the building I have repeatedly asked about an upgrade, but as you mentioned Tom, it's a compatibility issue and concern that remote programmers might end out making more work for themselves. <> If I did a local install of PG 8.X (which is what I hear we'll be going to), not connected to the real DB, would it be functional enough to give me the better messages? Again, thank you both, Ralph --------------------------------------------------------------- bricklen wrote: > You appear to be missing a trailing semi-colons. > Here: > vFieldName= ''offer_'' || ''$1'' > and here: vBusID=daRec.bus_id ------------------------------------------------------- Ralph Smith writes: > > I'm also stuck on 7.4 for at least a few more months, but that's not > > part of the problem. > ... well, actually, it is; because newer versions give considerably more helpful syntax error messages. I tried plugging this function into a current version, and got syntax error at or near "daRec" LINE 34: FOR daRec IN SELECT * FROM temp_salesimport WHERE offer_... ^ which was at least close enough to the problem (the missing semi on the previous line) to be of some use, unlike the error pointing at line 92. Similarly, after fixing the first missing semi I got ERROR: syntax error at or near "select" LINE 38: select into vBusOwnerID businessownerid from business ... ^ which is just after the other one. If you aren't in a position to move your production DB yet, you might at least consider using a newer version for development. That has its own hazards of course, like accidentally using features that don't exist in 7.4, but it could save you a lot of time in cases like this. regards, tom lane -- Ralph _________________________ --------------040407080705040409040606 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you both.  I stared and stared and stared, and apparently I needed to take a walk around the building
I have repeatedly asked about an upgrade, but as you mentioned Tom, it's a compatibility issue and concern that remote programmers might end out making more work for themselves.  <<shrug>>

If I did a local install of PG 8.X (which is what I hear we'll be going to), not connected to the real DB, would it be functional enough to give me the better messages?

Again, thank you both,
Ralph

---------------------------------------------------------------

bricklen wrote:
You appear to be missing a trailing semi-colons.
 Here:
    vFieldName= ''offer_'' || ''$1''
and here:     vBusID=daRec.bus_id
-------------------------------------------------------
Ralph Smith <rsmith@10kinfo.com> writes:
> I'm also stuck on 7.4 for at least a few more months, but that's not 
> part of the problem.
  

... well, actually, it is; because newer versions give considerably more
helpful syntax error messages.  I tried plugging this function into
a current version, and got

syntax error at or near "daRec"
LINE 34:     FOR daRec IN SELECT * FROM temp_salesimport WHERE offer_...
                 ^

which was at least close enough to the problem (the missing semi on the
previous line) to be of some use, unlike the error pointing at line 92.
Similarly, after fixing the first missing semi I got

ERROR:  syntax error at or near "select"
LINE 38:       select into vBusOwnerID businessownerid from business ...
               ^

which is just after the other one.

If you aren't in a position to move your production DB yet, you might
at least consider using a newer version for development.  That has its
own hazards of course, like accidentally using features that don't exist
in 7.4, but it could save you a lot of time in cases like this.

			regards, tom lane
-- 

Ralph
_________________________
--------------040407080705040409040606--