cursor with dinamic string - Mailing list pgsql-general

From Luca Santaniello
Subject cursor with dinamic string
Date
Msg-id 4D8C857D.1070502@gmail.com
Whole thread Raw
Responses Re: cursor with dinamic string  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Hi all,

I need use dinamic string for my cursor... My code is:

query varchar := 'field1, field2 from ''' || tableName ||''' ........;
//has dinamic params

then I create cursor...

myCursor CURSOR FOR SELECT query;

I compile my function but when i run it I obtain error...

ERROR:  invalid input syntax for integer: ......
CONTEXT:  PL/pgSQL function "my_function" line 72 at FETCH

If I use static string, I don't have problems!!!

Can I solve it?

Thanks in advance

--
Luca Santaniello
email: luca.santaniello.81@gmail.com
skype: luca.santaniello
msn: luketto81@hotmail.com


pgsql-general by date:

Previous
From: "Marc Mamin"
Date:
Subject: ERROR: type "foo_20110307_id_seq" already exists (expected relation "foo_20110307_id_seq" already exists)
Next
From: Pavel Stehule
Date:
Subject: Re: cursor with dinamic string