pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: A. Kretschmer <akretschmer@despammed.com>
To: pgsql-sql@postgresql.org
Subject: Re: stored procs in postgresql
Date: Sun, 25 Sep 2005 09:47:49 +0200
Message-ID: <20050925074749.GA11017@webserv.wug-glas.de> (raw)
In-Reply-To: <c666e3db05092421106c6bab2b@mail.gmail.com>
References: <op.sxmghwnc1qrx7c@localhost>
	<60vf0qma14.fsf@dba2.int.libertyrms.com>
	<c666e3db05092421106c6bab2b@mail.gmail.com>

am  24.09.2005, um 21:10:48 -0700 mailte Cere Davis folgendes:
> thanks,
> 
> I didn't even know about the string concatination function for this. 
> Unfortunately, it was of no help.  Specificly I am trying this, with
> the following error:
> 
> SQL error:
> 
> 
> ERROR:  syntax error at or near "' || $2 || '" at character 110
> 
> In statement:
> 
> 
> CREATE FUNCTION "getcensusbound" (geometry, character) RETURNS
> character AS 'SELECT bound_table.name

1. you should better use dollar-quoting
Read:
http://www.postgresql.org/docs/8.0/static/plpgsql-development-tips.html


>    FROM '' || $2 || '' bound_table
>   WHERE bound_table.the_geom::bytea != ''null''::bytea AND
> contains(geometryn(bound_table.the_geom, 1), $1) = true;' LANGUAGE
> "sql"

2. you must build a string with your query and execute the string.
Read:
http://www.postgresql.org/docs/8.0/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-EXECUTING-DYN


> On 9/24/05, Chris Browne <cbbrowne@acm.org> wrote:
> > ceremona@gmail.com writes:

3. please learn to quote.
Read: http://learn.to/quote
http://www.netmeister.org/news/learn2quote.html


Regards, Andreas
-- 
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    === 



view thread (4+ messages)

Message-ID: <20050925074749.GA11017@webserv.wug-glas.de>
Permalink:  ../20050925074749.GA11017@webserv.wug-glas.de/
Also on:    postgresql.org/message-id/20050925074749.GA11017@webserv.wug-glas.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: akretschmer@despammed.com
  Subject: Re: stored procs in postgresql
  In-Reply-To: <20050925074749.GA11017@webserv.wug-glas.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox