X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 58F3BD952C for ; Sun, 25 Sep 2005 04:47:38 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 09170-09 for ; Sun, 25 Sep 2005 07:47:33 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by svr1.postgresql.org (Postfix) with ESMTP id 1A7D9D94F8 for ; Sun, 25 Sep 2005 04:47:33 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de with ESMTP (Nemesis), id 0ML21M-1EJRET28zy-0000jd; Sun, 25 Sep 2005 09:47:33 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1EJREj-0002sW-00 for pgsql-sql@postgresql.org; Sun, 25 Sep 2005 09:47:49 +0200 Date: Sun, 25 Sep 2005 09:47:49 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: stored procs in postgresql Message-ID: <20050925074749.GA11017@webserv.wug-glas.de> Mail-Followup-To: "A. Kretschmer" , pgsql-sql@postgresql.org References: <60vf0qma14.fsf@dba2.int.libertyrms.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-DEST: 208 X-MSMail-Priority: High X-Message-Flag: Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) X-OS: Linux - weil ich es mir Wert bin! X-Info: registrierter Linux-User 97922 http://counter.li.org User-Agent: mutt-ng 1.5.9i (Linux) X-Provags-ID: kundenserver.de abuse@kundenserver.de login:51ea9561fc3f6d9539a2acd743e4748c X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.292 required=5 tests=[AWL=0.025, MISSING_MIMEOLE=0, X_MSMAIL_PRIORITY_HIGH=0.267] X-Spam-Level: X-Archive-Number: 200509/249 X-Sequence-Number: 22796 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 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 ===