Hello every one
i have created this function to test cursors , but when i execute this funtion
it give me this error , how can i fix this error
CREATE OR REPLACE FUNCTION foo(custid int) returns table(userid int) as
$BODY$
DECLARE rs cursor for Select customer_name from customer;
BEGIN
fetch f
Pavel Stehule writes:
> you can use a refcursor type
> http://developer.postgresql.org/pgdocs/postgres/plpgsql-cursors.html
It would suffice to explicitly set mycursor to null before doing the
OPEN, thus instructing the system to assign a unique cursor name.
CREATE FUNCTION test(id integer) RE
Hello
you can use a refcursor type
http://developer.postgresql.org/pgdocs/postgres/plpgsql-cursors.html
Regards
Pavel Stehule
2011/8/18 Kidd, David M :
> Hi,
>
> I am trying to write a function that contains a cursor and iteratively calls
> itself.
>
> It is along the lines of,
>
> CREATE FUN
Hi,
I am trying to write a function that contains a cursor and iteratively calls
itself.
It is along the lines of,
CREATE FUNCTON test(id integer) RETURNS TEXT AS
$BODY$
DECLARE
mycursor CURSOR FOR SELECT * FROM myfunction(id);
newid INTEGER;
out = TEXT;
BEGIN
out := '';
OPEN mycursor
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>] En nombre de Xavier Bermeo
> Enviado el: Sábado, 16 de Agosto de 2008 14:54
> Para: pgsql-sql@postgresql.org
> Asunto: [SQL] Cursor
>
> Hi, guys...
> I have problems with cursosr
Xavier Bermeo wrote:
Hi, guys...
I have problems with cursosrs.
Anyone have an example complete the how load and read each position
of a cursor?
I wait your answer
Thanks...guys
Assuming you're using ECPG, there are a couple of examples in the
documentation, e.g.,
hi guys...
This my cursor
DECLARE
var varchar(15);
cursor1 CURSOR FOR select codigo_uni as codigo
from recorrido
where estado='V';
BEGIN
open cursor1;
var=cursor1.codigo;
END;
It's almost 200 records,
but, I not unknow how read record for record, I need foun
Hi, guys...
I have problems with cursosrs.
Anyone have an example complete the how load and read each position of a
cursor?
I wait your answer
Thanks...guys
On 03/28/06 11:13, Maciej Piekielniak wrote:
>create or replace function uporzadkuj_reguly(text,text) RETURNS VOID AS
>'
>DECLARE
> licznik integer:=1;
>
> reguly CURSOR FOR SELECT * from firewall ORDER BY id_firewall WHERE
> tabela=$1 and lancuch=$2 for UPDATE;
>BEGIN
> for i in reguly LOOP
> U
Hello Wiebe,
Tuesday, March 28, 2006, 2:42:20 AM, you wrote:
>>
WC> Fist, what's the error you get?
ERROR: missing ".." at end of SQL expression
CONTEXT: compile of PL/pgSQL function "uporzadkuj_reguly" near line 7
WC> Second, what does "rekord" do? You don't seem to use it.
Yes, i don't nee
On 03/28/06 01:35, Maciej Piekielniak wrote:
>Hello ,
>
>I try to translate my old functions from oracle but don't understand what is
>wrong.
>
>create or replace function uporzadkuj_reguly(text,text) RETURNS integer AS
>'
>DECLARE
> tabela ALIAS FOR $1;
> lancuch ALIAS FOR $2;
> ret integer:=0;
Hello ,
I try to translate my old functions from oracle but don't understand what is
wrong.
create or replace function uporzadkuj_reguly(text,text) RETURNS integer AS
'
DECLARE
tabela ALIAS FOR $1;
lancuch ALIAS FOR $2;
ret integer:=0;
licznik integer:=1;
rekord firewall%ROWTYPE;
reguly C
On Fri, Sep 02, 2005 at 02:17:52PM +0300, Stathis Stergou wrote:
> ERROR: cursor "" already in use
> CONTEXT: PL/pgSQL function "bufferfeatures" line 19 at open
You're trying to open a cursor that's already open. Close the
cursor at the end of the loop in which you opened it, so that it
gets cl
Hi, list.
I've created a stored function in plpgsql which uses some functions from
postgis.
CREATE OR REPLACE FUNCTION "public"."bufferfeatures" (integer [], text,
text, double precision) RETURNS SETOF "public"."shapedummy" AS
$body$
DECLARE
source_layer_features ALIAS FOR $1;
source_la
On Wed, Jun 15, 2005 at 06:45:56PM -0400, Vsevolod (Simon) Ilyushchenko wrote:
> While those that fail look like this:
>
> Request select * from material_pkg.ListCautions_fcn($1,$2) as result B
> Response result C SELECT
>
> Note that the successful ones contain strings "S_1" and "BEGIN", and th
Hi,
I'm querying a Postgres 8.0.3 database from Java via the 8.0-311 JDBC
driver. It mostly works. I ran into the "cursor does not exist" problem,
but was able to fix it with
connection.setAutoCommit(false);
Or so I thought.
There are several JSP pages which still throw the 'cursor "portal 1
|
|I am a new postgres user
|
|I want to get a list of tables from pg_tables where tables are like
|‘%wo%’ (for example).. and then query that list ….
|
|Select count(*) from tableVARIABLENAMEFROMFIRSTQUERY
|
|In SQL SERVER I can do that using cursor but in postgresql I don’t
|understand how to
I am a new postgres user
I want to get a list of tables from pg_tables where tables are like
‘%wo%’ (for example).. and then query that list ….
Select count(*) from tableVARIABLENAMEFROMFIRSTQUERY
In SQL SERVER I can do that using cursor but in postgresql I don’t
understand how to use cursor
Title: CURSOR EXAMPLE - ORACLE TO POSTGRES CONVERSION
CURSOR EXAMPLE - ORACLE TO POSTGRES CONVERSION
--Oracle
CREA
Hello all -
I need to return large result sets and therefore need a cursor with a small
fetch size (to avoid caching the entire query at once). However, it appears
that when a cursor is returned from a callable statement setFetchSize is
ignored.
I set up a query that crashes with outofMemoryErro
20 matches
Mail list logo