[GENERAL] Cursor declaration

2005-08-30 Thread Nigel Horne
How do I declare a cursor in a stored procedure if that cursor contains a WHERE which depends on the argument given to that stored procedure? I can't get passed this message: 'Cannot mix placeholder styles "$1" and ":foo"' The message doesn't give a useful line number, so I don't even know which

Re: [GENERAL]

2005-08-22 Thread Nigel Horne
On Fri, 2005-08-19 at 16:34, A. Kretschmer wrote: > am 19.08.2005, um 15:58:20 +0100 mailte Nigel Horne folgendes: > > I can't work out from that how to return more than one value. > > 17:35 < rtfm_please> For information about srf > 17:35 < rtfm_please> se

Re: [GENERAL]

2005-08-22 Thread Nigel Horne
On Mon, 2005-08-22 at 14:49, Tino Wildenhain wrote: > Nigel Horne schrieb: > > On Fri, 2005-08-19 at 16:34, A. Kretschmer wrote: > > > >>am 19.08.2005, um 15:58:20 +0100 mailte Nigel Horne folgendes: > >> > >>>I can't work out from that

Re: [GENERAL]

2005-08-22 Thread Nigel Horne
On Mon, 2005-08-22 at 10:29, Adam Witney wrote: > On 22/8/05 10:19 am, "Nigel Horne" <[EMAIL PROTECTED]> wrote: > > > On Fri, 2005-08-19 at 17:29, Tom Lane wrote: > >> Adam Witney <[EMAIL PROTECTED]> writes: > >>> Ah you want to return a

Re: [GENERAL]

2005-08-22 Thread Nigel Horne
On Fri, 2005-08-19 at 17:29, Tom Lane wrote: > Adam Witney <[EMAIL PROTECTED]> writes: > > Ah you want to return a record I suppose? > > > CREATE TABLE test (id int, name text); > > INSERT INTO test VALUES(1, 'me'); > > INSERT INTO test VALUES(2, 'you'); > > > CREATE FUNCTION test_func() RETURNS

Re: [GENERAL]

2005-08-19 Thread Nigel Horne
On Fri, 2005-08-19 at 16:30, Adam Witney wrote: > > I can't work out from that how to return more than one value. > > Hi Nigel, > > Add SETOF to your function like so: > > CREATE TABLE test (id int); > INSERT INTO test VALUES(1); > INSERT INTO test VALUES(2); > > CREATE FUNCTION test_func() RET

Re: [GENERAL]

2005-08-19 Thread Nigel Horne
On Fri, 2005-08-19 at 16:30, Adam Witney wrote: > > I can't work out from that how to return more than one value. > > Hi Nigel, > > Add SETOF to your function like so: Hmm. Ta. Sorry for all the newbie questions, but SQL isn't something I know anything about, but any work's work at the moment!

[GENERAL] http://www.postgresql.org/docs/8.0/static/xfunc-sql.html

2005-08-19 Thread Nigel Horne
I can't work out from that how to return more than one value. -Nigel ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Stored functions

2005-08-19 Thread Nigel Horne
Thanks for all the pointers. I'll have a look. I did reply earlier, but the "reply to" is broken: it sent to the OP rather than the list... Perhaps there is a lesson in newbie navigation for the website here. -Nigel ---(end of broadcast)--- TIP 1:

[GENERAL] Stored functions

2005-08-19 Thread Nigel Horne
The on-line manual, http://www.postgresql.org/docs/8.0/interactive/index.html, doesn't describe how to call stored functions, or if it does it's well hidden. Are there some examples anywhere? After googling I can find much duplication of non-data (people love to mirror sites don't they?) but no re

[GENERAL] NULL value without indicator in line 250.

2005-08-10 Thread Nigel Horne
Has anyone got any pointers to how to define an null indicator variable to get over the above cryptic message? -Nigel ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Updating timestamps

2005-08-08 Thread Nigel Horne
Is it possible to update a timestamp with Postgresql? I've looked around with google and it looks as though this should work: exec sql begin declare section; char api[18]; charexpiration_time[80]; exec sql end declare section; memcpy(api, ap->api, sizeof(api)); sprintf(expiration_