X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 26BF3D1E7F5 for ; Tue, 20 Jan 2004 19:17:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 10056-04 for ; Tue, 20 Jan 2004 15:17:19 -0400 (AST) Received: from anchor-post-37.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by svr1.postgresql.org (Postfix) with ESMTP id F3442D1E820 for ; Tue, 20 Jan 2004 15:17:17 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1Aj1NG-0009is-0b; Tue, 20 Jan 2004 19:17:18 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id E960018299; Tue, 20 Jan 2004 19:17:16 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 8FA1816B9C; Tue, 20 Jan 2004 19:17:14 +0000 (GMT) From: Richard Huxton To: anthony@childers.com, pgsql-odbc@postgresql.org Subject: Re: Crystal Reports 8, psqlODBC driver and stored procedures Date: Tue, 20 Jan 2004 19:17:13 +0000 User-Agent: KMail/1.5 References: <20040120100047.25182.h012.c000.wm@mail.childers.com.criticalpath.net> In-Reply-To: <20040120100047.25182.h012.c000.wm@mail.childers.com.criticalpath.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200401201917.13971.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/62 X-Sequence-Number: 3691 On Tuesday 20 January 2004 18:00, anthony@childers.com wrote: [query getting function details] > > Notice the result of "[ fetched 0 rows ]". This is because > "get_visible_subtree" returns SETOF integer. Any DBfunction which returns > SETOF anything causes proretset to be set to TRUE. So the function will not > be returned by this query. > The description for proretset says it is TRUE when "Function returns a set > (i.e., multiple values of the specified data type". > > This is the question... Does using a return type of SETOF in a DBfunction > ALWAYS result in multiple result sets? Yes - it might return a set containing only one integer, but that is still a set. > The documentation seems to indicate > that the result is not returned from the DBfunction until the final RETURN > statement in the function, just before it exits. If this is the case should > proretset ALWAYS be set to TRUE for any function that returns SETOF? What > about a function that returns a table? Is this a bug? I'm not sure what you mean by a function that returns a table. If you mean a function that returns a set of complex type (e.g. a int4, b text, c date) then there's no difference between that and a set of integers - it's just a matter of complexity (after all, you can have a table with just one column, it just doesn't happen often). I'm guessing the issue is that either Crystal or the ODBC driver doesn't know / isn't equipped to deal with set returning functions, and expects them all to be like sin(),substr() etc. Someone else has suggested an SQL mode in Crystal Reports, I'm afraid I don't know enough to comment. If that doesn't work, the only thing I can think of is to wrap the function in a view, but that stops you passing variables to it (which presumably you want to do). -- Richard Huxton Archonet Ltd