|
Home > Archive > PostgreSQL Discussion > August 2005 > Cursor declaration
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Cursor declaration
|
|
| Nigel Horne 2005-08-30, 7:24 am |
| 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
line it's complaining about.
-Nigel
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
| |
| Richard Huxton 2005-08-30, 9:25 am |
| Nigel Horne wrote:
> 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
> line it's complaining about.
Difficult to say - perhaps the source of the function would help. You
don't actually mention what language you're using even.
However, I'd look for anywhere you're using ":varname" since that isn't
valid plpgsql.
Then, I'd look at the OPEN ... CURSOR ... EXECUTE form of cursor opening
(see manuals for details).
--
Richard Huxton
Archonet Ltd
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
| |
| Tom Lane 2005-08-30, 11:25 am |
| Nigel Horne <njh@bandsman.co.uk> writes:
> I can't get passed this message:
> 'Cannot mix placeholder styles "$1" and ":foo"'
There's no such message anywhere in the Postgres sources. I suppose it
must be coming from whatever client-side library you are using (which
you didn't say).
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
|
|
|
|
|