Skip site navigation (1) Skip section navigation (2)

Re: Brio returning data through stored procedures.

From: David Gardner <david(dot)gardner(at)yucaipaco(dot)com>
To: Doug Thom <dthom(at)iagr(dot)net>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: Brio returning data through stored procedures.
Date: 2007-04-06 16:16:01
Message-ID: 46167241.7020103@yucaipaco.com (view raw or flat)
Thread:
Lists: pgsql-odbc
Hmm are you doing something like:
IF something THEN
	SELECT * FROM tblOne;
ELSE
	SELECT * FROM tblTwo;

Not sure what a refcursor is, but it is mentioned in the docs:
http://www.postgresql.org/docs/8.1/interactive/plpgsql-cursors.html


Doug Thom wrote:
> Hello, David, Andreas,
> 
> Thank you for the suggestions. The challenge is that I need a ref cursor
> because it is some arbitrary amount of data coming back from the server
> in a cursor. Your suggestion shows a defined row but I do not know what
> the row looks like so I cannot define a type beforehand.
> 
> However, your comments have me wondering if there is a different route I
> can take. Is there anything that is a 'generic row of data'? I see the
> type "record" and I'm going to give that a try.
> 
> Thanks again for the prompt response and ideas!
> 
> -Doug
> 
> -----Original Message-----
> From: Andreas [mailto:maps(dot)on(at)gmx(dot)net] 
> Sent: Friday, April 06, 2007 9:50 AM
> To: pgsql-odbc(at)postgresql(dot)org
> Cc: Doug Thom
> Subject: Re: [ODBC] Brio returning data through stored procedures.
> 
> Hi Doug
> 
> I dont know Brio either but keep in mind that tables and views are 
> allready defined types which you could use here.
> 
> So if your procedure just selects a few rows from a view or table but 
> should return all collumns from the source you don't have to define a 
> return type.
> 
> 
> David Gardner schrieb:
>> Never worked with Brio, but have you defined a data-type in pgsql that
> 
>> your function would be returning? Something like:
>>
>> CREATE TYPE "myType" AS
>> ("name" text,
>> "start" timestamp without time zone,
>> "end" timestamp without time zone,
>> error text);
>> ALTER TYPE "myType" OWNER TO "me";
>>
>> then the function definition would start off like:
>> CREATE OR REPLACE FUNCTION "getData"()
>> RETURNS SETOF "myType" AS
>> ..... 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 7: You can help support the PostgreSQL project by donating at
> 
>                 http://www.postgresql.org/about/donate
> 


In response to

Responses

pgsql-odbc by date

Next:From: Doug ThomDate: 2007-04-06 16:31:40
Subject: Re: Brio returning data through stored procedures.
Previous:From: noreplyDate: 2007-04-06 15:40:53
Subject: [ psqlodbc-Bugs-1000630 ] Related to bug GenerateBDDirectMethod fails in VS studio 2005 with ODBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group