Re: How to use parameters in stored procedures?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Cyphos <mweichert(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to use parameters in stored procedures?
Date: 2006-01-15 01:25:00
Message-ID: 20060115012500.GA8428@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jan 13, 2006 at 09:53:29AM -0800, Cyphos wrote:
> I get an error that the column myLocationID doesn't exist. I'm sure
> it's something simple, but I can't figure it out.

Not all procedural languages support named arguments. Apparently
SQL functions don't, so use $1, $2, etc.

http://www.postgresql.org/docs/8.1/interactive/xfunc-sql.html

> Also too, why do I have to quote columns and tables?

You don't have to...unless you created them that way. See the
discussion of quoted identifiers in the documentation and in the
FAQ:

http://www.postgresql.org/docs/8.1/interactive/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS
http://www.postgresql.org/docs/faqs.FAQ.html#item4.21

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ottó Havasvölgyi 2006-01-15 01:45:51 Re: Moving PostgreSQL data directory on Windows
Previous Message John DeSoi 2006-01-15 00:54:57 Re: Drupal and postgreSQL