From dw_remote@hotmail.com Fri Sep 13 16:26:27 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EA503476D1E for ; Fri, 13 Sep 2002 12:26:27 -0400 (EDT) Received: from hotmail.com (dav57.law15.hotmail.com [64.4.22.192]) by postgresql.org (Postfix) with ESMTP id 54B65476D0D for ; Fri, 13 Sep 2002 12:26:27 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 13 Sep 2002 09:26:32 -0700 X-Originating-IP: [204.244.28.188] From: "david williams" To: Subject: Problem returning a cursor through ODBC to ASP layer from postgres Date: Fri, 13 Sep 2002 12:28:47 -0400 MIME-Version: 1.0 X-Mailer: MSN Explorer 7.00.0021.1900 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0004_01C25B21.1B8080D0" Message-ID: X-OriginalArrivalTime: 13 Sep 2002 16:26:32.0816 (UTC) FILETIME=[5265AF00:01C25B42] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/51 X-Sequence-Number: 2022 ------=_NextPart_001_0004_01C25B21.1B8080D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have created a function in postgres called getallusers(var) that returns = a cursor. This works fine at the psql level but when I try to return it thr= ough ODBC I get errors. The function is as follows: CREATE OR REPLACE FUNCTION getallusers(refcursor) RETURN refcursor AS' begin open $1 for select * from users; return $1; end; ' language 'plpgsql'; I call it like this: <%=20=20 strconn=3D"DSN=3Dp_test;uid=3Dpostgres;pwd=3D" mySQL =3D "begin "&vbcrlf mySQL =3D mySQL & "select getallusers('rs'); " mySQL =3D mySQL & "fetch all in rs; " mySQL =3D mySQL & "commit; " call query2table(mySQL,strconn) %> This does not seem to return anything. Thanks !-------------------------------------! David WilliamsGet more from the Web. FREE MSN Explorer download : http://e= xplorer.msn.com ------=_NextPart_001_0004_01C25B21.1B8080D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I have created a= function in postgres called getallusers(var) that returns a cursor. This w= orks fine at the psql level but when I try to return it through ODBC I get = errors.
 
The function is as follows:
 
CREATE OR REPLACE FUNCTION getallusers(refcursor) RETURN= refcursor AS'
 
begin
open $1 for se= lect * from users;
return $1;
end;
' langu= age 'plpgsql';
 
 
I call it lik= e this:
 
<%
strconn=3D"DSN=3Dp_test;uid= =3Dpostgres;pwd=3D"
mySQL =3D "begin "&vbcrlf
mySQL =3D mySQL &am= p; "select getallusers('rs'); "
mySQL =3D mySQL & "fetch all in rs; = "
mySQL =3D mySQL & "commit; "
call query2table(mySQL,str= conn)
%>
 

This does not seem to return anyt= hing.

Thanks


!-------------------------------------!
D= avid Williams



Get more from the Web. = FREE MSN Explorer download : http://exp= lorer.msn.com

------=_NextPart_001_0004_01C25B21.1B8080D0-- From dw_remote@hotmail.com Mon Sep 16 17:12:29 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C6223476583 for ; Mon, 16 Sep 2002 13:12:29 -0400 (EDT) Received: from hotmail.com (dav23.law15.hotmail.com [64.4.22.80]) by postgresql.org (Postfix) with ESMTP id 8753A4764BE for ; Mon, 16 Sep 2002 13:12:24 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 16 Sep 2002 10:12:24 -0700 X-Originating-IP: [204.244.28.188] From: "david williams" To: Subject: Re: Problem returning a cursor through ODBC to ASP layer from postgres Date: Mon, 16 Sep 2002 13:14:57 -0400 MIME-Version: 1.0 X-Mailer: MSN Explorer 7.00.0021.1900 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0000_01C25D83.0DBB1AA0" Message-ID: X-OriginalArrivalTime: 16 Sep 2002 17:12:24.0263 (UTC) FILETIME=[39A06D70:01C25DA4] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/66 X-Sequence-Number: 2037 ------=_NextPart_001_0000_01C25D83.0DBB1AA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The entire ASP page (read.asp) is here: read.asp <%=20=20 strconn=3D"DSN=3Dp_cars4u;uid=3Dpostgres;pwd=3D" 'mySQL=3D"select * from users" mySQL =3D "begin; "&vbcrlf mySQL =3D mySQL & "select getallusers('rs'); " mySQL =3D mySQL & "fetch all in rs; " 'mySQL =3D mySQL & "commit; " 'call query2table(mySQL,strconn)' %> <%=20=20 sub query2table(inputquery, inputDSN) dim conntemp, rstemp set conntemp=3Dserver.createobject("adodb.connection") conntemp.open inputDSN set rstemp=3Dconntemp.execute(inputquery) howmanyfields=3Drstemp.fields.count -1%> <% 'Put Headings On The Table of Field Names for i=3D0 to howmanyfields %> <% next %> <% ' Now lets grab all the records do while not rstemp.eof %> <------------------ LINE= 35 <% for i =3D 0 to howmanyfields thisvalue=3Drstemp(i) If isnull(thisvalue) then thisvalue=3D" " end if%> <% next %> <%rstemp.movenext loop%>
<%=3Drstemp(i).name%>
<%=3Dthisvalue%>
<% rstemp.close set rstemp=3Dnothing conntemp.close set conntemp=3Dnothing end sub%> I get this error: Error Type: ADODB.Recordset (0x800A0E78) Operation is not allowed when the object is closed. /read.asp, line 35 It seems that the object is closed already because it returns nothing. Thanks=20=20 Dave ----- Original Message ----- From: Janet Borschowa Sent: Monday, September 16, 2002 1:05 PM To: 'david williams'; pgsql-odbc@postgresql.org Subject: RE: [ODBC] Problem returning a cursor through ODBC to ASP layer fr= om postgres I believe that when you call commit the refcursor is closed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20= =20 Janet Borschowa=20=20 Software Engineer, Database Products=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 Rogue Wave Software=20=20 (541) 753-1931 FAX: (541) 757-4630=20=20 mailto:borschow@roguewave.com http://www.roguewave.com =20=20=20 -----Original Message----- From: david williams [mailto:dw_remote@hotmail.com] Sent: Friday, September 13, 2002 9:29 AM To: pgsql-odbc@postgresql.org Subject: [ODBC] Problem returning a cursor through ODBC to ASP layer from postgres I have created a function in postgres called getallusers(var) that returns a cursor. This works fine at the psql level but when I try to return it through ODBC I get errors. The function is as follows: CREATE OR REPLACE FUNCTION getallusers(refcursor) RETURN refcursor AS' begin open $1 for select * from users; return $1; end; ' language 'plpgsql'; I call it like this: <%=20=20 strconn=3D"DSN=3Dp_test;uid=3Dpostgres;pwd=3D" mySQL =3D "begin "&vbcrlf mySQL =3D mySQL & "select getallusers('rs'); " mySQL =3D mySQL & "fetch all in rs; " mySQL =3D mySQL & "commit; " call query2table(mySQL,strconn) %> This does not seem to return anything. Thanks !-------------------------------------! David Williams _____=20=20=20 Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com Get more from the Web. FREE MSN Explorer downloa= d : http://explorer.msn.com ------=_NextPart_001_0000_01C25D83.0DBB1AA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
The entire ASP p= age (read.asp) is here:
 

<HTML><HEA= D>
<TITLE>read.asp</TITLE>
<body bgcolor=3D"#FFFFFF= "></HEAD>
<%
strconn=3D"DSN=3Dp_cars4u;uid=3Dpostgres;pw= d=3D"
'mySQL=3D"select * from users"
mySQL =3D "begin; "&vbcrlfmySQL =3D mySQL & "select getallusers('rs'); "
mySQL =3D mySQL &am= p; "fetch all in rs; "
'mySQL =3D mySQL & "commit; "

'call qu= ery2table(mySQL,strconn)'
%>

</BODY>
</HTML>

<%
sub query2table(inputquery, inputDSN)
   dim co= nntemp, rstemp
   set conntemp=3Dserver.createobject("adodb.co= nnection")
   conntemp.open inputDSN
   set rstem= p=3Dconntemp.execute(inputquery)
   howmanyfields=3Drstemp.fie= lds.count -1%>
   <table border=3D1><tr>
&nb= sp;  <% 'Put Headings On The Table of Field Names
   f= or i=3D0 to howmanyfields %>
      &nbs= p;      <td><b><%=3Drstemp(i).name%= ></B></TD>
   <% next %>
   = </tr>
   <% ' Now lets grab all the records
 =   do while not rstemp.eof %>      &nb= sp;            =    <------------------ LINE 35
    &nbs= p; <tr>
      <% for i =3D 0 to howman= yfields
         thisvalue=3Drst= emp(i)
         If isnull(thisva= lue) then
          &n= bsp; thisvalue=3D"&nbsp;"
       =   end if%>
         = ;    <td valign=3Dtop><%=3Dthisvalue%></td>= ;
      <% next %>
   &= nbsp;  </tr>
      <%rstemp.moven= ext
   loop%>
   </table>
  = ; <%
   rstemp.close
   set rstemp=3Dnothing   conntemp.close
   set conntemp=3Dnothing
end= sub%>

I get this error:
 
Error Typ= e:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the obj= ect is closed.
/read.asp, line 35
It seems that the objec= t is closed already because it returns nothing.
 
Thanks
 
Dave
----- Origina= l Message -----
From: Janet Borschowa
Sent: Monday, September 16, 2002 1:05 PM
To: 'david williams'; pgsql-odbc@postgresql.org
Subject: RE: [ODBC] Problem retur= ning a cursor through ODBC to ASP layer from postgres
 I believe that when you call commit the refcursor is closed.

=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
J= anet Borschowa
Software Engineer, Database Products   &n= bsp;            = ;       
Rogue Wave Software
(54= 1) 753-1931   FAX: (541) 757-4630
mailto:borschow@roguewave.c= om <mailto:borschow@roguewave.com>
http://www.roguewave.com <ht= tp://www.roguewave.com/> 



-----Original Message----= -
From: david williams [mailto:dw_remote@hotmail.com]
Sent: Friday, S= eptember 13, 2002 9:29 AM
To: pgsql-odbc@postgresql.org
Subject: [ODB= C] Problem returning a cursor through ODBC to ASP layer from
postgres

I have created a function in postgres called getallusers(var) that= returns a
cursor. This works fine at the psql level but when I try to r= eturn it
through ODBC I get errors.

The function is as follows:
CREATE OR REPLACE FUNCTION getallusers(refcursor) RETURN refcursor AS= '

begin
open $1 for select * from users;
return $1;
end;' language 'plpgsql';


I call it like this:

<%
str= conn=3D"DSN=3Dp_test;uid=3Dpostgres;pwd=3D"
mySQL =3D "begin "&vbcrl= f
mySQL =3D mySQL & "select getallusers('rs'); "
mySQL =3D mySQL = & "fetch all in rs; "
mySQL =3D mySQL & "commit; "
call query= 2table(mySQL,strconn)
%>


This does not seem to return anyt= hing.

Thanks


!-------------------------------------!
D= avid Williams


  _____ 

Get more from the Web. = FREE MSN Explorer download : http://explorer.msn.com
<http://explorer= .msn.com>


Get more fr= om the Web. FREE MSN Explorer download : http://explorer.msn.com

------=_NextPart_001_0000_01C25D83.0DBB1AA0-- From dw_remote@hotmail.com Mon Sep 16 17:48:01 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7E718475E7B for ; Mon, 16 Sep 2002 13:48:01 -0400 (EDT) Received: from hotmail.com (dav17.law15.hotmail.com [64.4.22.121]) by postgresql.org (Postfix) with ESMTP id 5E588476384 for ; Mon, 16 Sep 2002 13:47:59 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 16 Sep 2002 10:47:59 -0700 X-Originating-IP: [204.244.28.188] From: "david williams" To: Subject: Re: Problem returning a cursor through ODBC to ASP layer from postgres Date: Mon, 16 Sep 2002 13:50:32 -0400 MIME-Version: 1.0 X-Mailer: MSN Explorer 7.00.0021.1900 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0001_01C25D88.06429F00" Message-ID: X-OriginalArrivalTime: 16 Sep 2002 17:47:59.0254 (UTC) FILETIME=[322E3360:01C25DA9] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/67 X-Sequence-Number: 2038 ------=_NextPart_001_0001_01C25D88.06429F00 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable If I make the following change so that only the select getallusers('rs'); e= xecutes then all I get is: 1|select getallusers('rs'); <------------ Debug code - 1 field and co= mmand executedgetallusers rs <%=20=20 strconn=3D"DSN=3Dp_cars4u;uid=3Dpostgres;pwd=3D" 'mySQL=3D"select * from users" 'mySQL =3D "begin; "&vbcrlf mySQL =3D mySQL & "select getallusers('rs'); " 'mySQL =3D mySQL & "fetch all in rs; " 'mySQL =3D mySQL & "commit; " 'call query2table(mySQL,strconn)' %> So text is being returned rather than a pointer/cursor/whatever. Thanks Dave ----- Original Message ----- From: david williams Sent: Monday, September 16, 2002 1:17 PM To: pgsql-odbc@postgresql.org Subject: Re: [ODBC] Problem returning a cursor through ODBC to ASP layer fr= om postgres The entire ASP page (read.asp) is here: read.asp <%=20=20 strconn=3D"DSN=3Dp_cars4u;uid=3Dpostgres;pwd=3D" 'mySQL=3D"select * from users" mySQL =3D "begin; "&vbcrlf mySQL =3D mySQL & "select getallusers('rs'); " mySQL =3D mySQL & "fetch all in rs; " 'mySQL =3D mySQL & "commit; " 'call query2table(mySQL,strconn)' %> <%=20=20 sub query2table(inputquery, inputDSN) dim conntemp, rstemp set conntemp=3Dserver.createobject("adodb.connection") conntemp.open inputDSN set rstemp=3Dconntemp.execute(inputquery) howmanyfields=3Drstemp.fields.count -1%> <% 'Put Headings On The Table of Field Names for i=3D0 to howmanyfields %> <% next %> <% ' Now lets grab all the records do while not rstemp.eof %> <------------------ LINE= 35 <% for i =3D 0 to howmanyfields thisvalue=3Drstemp(i) If isnull(thisvalue) then thisvalue=3D" " end if%> <% next %> <%rstemp.movenext loop%>
<%=3Drstemp(i).name%>
<%=3Dthisvalue%>
<% rstemp.close set rstemp=3Dnothing conntemp.close set conntemp=3Dnothing end sub%> I get this error: Error Type: ADODB.Recordset (0x800A0E78) Operation is not allowed when the object is closed. /read.asp, line 35 It seems that the object is closed already because it returns nothing. Thanks=20=20 Dave ----- Original Message ----- From: Janet Borschowa Sent: Monday, September 16, 2002 1:05 PM To: 'david williams'; pgsql-odbc@postgresql.org Subject: RE: [ODBC] Problem returning a cursor through ODBC to ASP layer fr= om postgres I believe that when you call commit the refcursor is closed. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20= =20 Janet Borschowa=20=20 Software Engineer, Database Products=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 Rogue Wave Software=20=20 (541) 753-1931 FAX: (541) 757-4630=20=20 mailto:borschow@roguewave.com http://www.roguewave.com =20=20=20 -----Original Message----- From: david williams [mailto:dw_remote@hotmail.com] Sent: Friday, September 13, 2002 9:29 AM To: pgsql-odbc@postgresql.org Subject: [ODBC] Problem returning a cursor through ODBC to ASP layer from postgres I have created a function in postgres called getallusers(var) that returns a cursor. This works fine at the psql level but when I try to return it through ODBC I get errors. The function is as follows: CREATE OR REPLACE FUNCTION getallusers(refcursor) RETURN refcursor AS' begin open $1 for select * from users; return $1; end; ' language 'plpgsql'; I call it like this: <%=20=20 strconn=3D"DSN=3Dp_test;uid=3Dpostgres;pwd=3D" mySQL =3D "begin "&vbcrlf mySQL =3D mySQL & "select getallusers('rs'); " mySQL =3D mySQL & "fetch all in rs; " mySQL =3D mySQL & "commit; " call query2table(mySQL,strconn) %> This does not seem to return anything. Thanks !-------------------------------------! David Williams _____=20=20=20 Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com =20=20 Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com= Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com ------=_NextPart_001_0001_01C25D88.06429F00 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
If I make the fo= llowing change so that only the select getallusers('rs'); executes then all= I get is:
 
1|select getallusers('rs'); &n= bsp;     <------------ Debug code - 1 field and comm= and executed
getallusers
rs
 
<%
strconn=3D"DSN=3Dp_cars4u;uid=3Dpostgres;pwd=3D"
'mySQ= L=3D"select * from users"
'mySQL =3D "begin; "&vbcrlf
mySQL =3D m= ySQL & "select getallusers('rs'); "
'mySQL =3D mySQL & "fetch al= l in rs; "
'mySQL =3D mySQL & "commit; "

'call query2table(mySQL,= strconn)'
%>

So text is being returned rather than a p= ointer/cursor/whatever.
 
Thanks
&nbs= p;
Dave
----- Original Message -----
From: david williams
Sent: Monday,= September 16, 2002 1:17 PM
To: pgsql-odbc@postgresql.org
Subjec= t: Re: [ODBC] Problem returning a cursor through ODBC to ASP layer from= postgres
 
The entire ASP page (read.asp) = is here:
 

<HTML><HEAD>
<TITLE&g= t;read.asp</TITLE>
<body bgcolor=3D"#FFFFFF"></HEAD><%
strconn=3D"DSN=3Dp_cars4u;uid=3Dpostgres;pwd=3D"
'mySQL=3D"s= elect * from users"
mySQL =3D "begin; "&vbcrlf
mySQL =3D mySQL &a= mp; "select getallusers('rs'); "
mySQL =3D mySQL & "fetch all in rs;= "
'mySQL =3D mySQL & "commit; "

'call query2table(mySQL,strc= onn)'
%>

</BODY>
</HTML>

<%
sub q= uery2table(inputquery, inputDSN)
   dim conntemp, rstemp
&n= bsp;  set conntemp=3Dserver.createobject("adodb.connection")
 =   conntemp.open inputDSN
   set rstemp=3Dconntemp.execute= (inputquery)
   howmanyfields=3Drstemp.fields.count -1%>   <table border=3D1><tr>
   <% 'Put= Headings On The Table of Field Names
   for i=3D0 to howmanyf= ields %>
          =    <td><b><%=3Drstemp(i).name%></B></T= D>
   <% next %>
   </tr>
 = ;  <% ' Now lets grab all the records
   do while not = rstemp.eof %>          = ;            <---= --------------- LINE 35
      <tr>
&nb= sp;     <% for i =3D 0 to howmanyfields
 &nb= sp;       thisvalue=3Drstemp(i)
 &nbs= p;       If isnull(thisvalue) then
 &= nbsp;          thisvalue=3D"&a= mp;nbsp;"
         end if%>             = <td valign=3Dtop><%=3Dthisvalue%></td>
  &nb= sp;   <% next %>
      </tr&= gt;
      <%rstemp.movenext
   = loop%>
   </table>
   <%
 &nb= sp; rstemp.close
   set rstemp=3Dnothing
   connt= emp.close
   set conntemp=3Dnothing
end sub%>

I= get this error:
 
Error Type:
ADODB.Recordse= t (0x800A0E78)
Operation is not allowed when the object is closed.
/r= ead.asp, line 35
It seems that the object is closed already = because it returns nothing.
 
Thanks
 
Dave
----- Original Message -----
Fro= m: Janet Borschowa
Sent: M= onday, September 16, 2002 1:05 PM
= To: 'david williams'; pgsql-odbc@postgresql.org
Subject: RE: [ODBC] Problem returning a cursor throug= h ODBC to ASP layer from postgres
 
I believe that whe= n you call commit the refcursor is closed.

=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Janet Borschowa
So= ftware Engineer, Database Products       = ;            &n= bsp;   
Rogue Wave Software
(541) 753-1931 &nbs= p; FAX: (541) 757-4630
mailto:borschow@roguewave.com <mailto:borscho= w@roguewave.com>
http://www.roguewave.com <http://www.roguewave.co= m/> 



-----Original Message-----
From: david will= iams [mailto:dw_remote@hotmail.com]
Sent: Friday, September 13, 2002 9:2= 9 AM
To: pgsql-odbc@postgresql.org
Subject: [ODBC] Problem returning = a cursor through ODBC to ASP layer from
postgres


I have creat= ed a function in postgres called getallusers(var) that returns a
cursor.= This works fine at the psql level but when I try to return it
through O= DBC I get errors.

The function is as follows:

CREATE OR REPLA= CE FUNCTION getallusers(refcursor) RETURN refcursor AS'

begin
ope= n $1 for select * from users;
return $1;
end;
' language 'plpgsql'= ;


I call it like this:

<%
strconn=3D"DSN=3Dp_test;= uid=3Dpostgres;pwd=3D"
mySQL =3D "begin "&vbcrlf
mySQL =3D mySQL = & "select getallusers('rs'); "
mySQL =3D mySQL & "fetch all in r= s; "
mySQL =3D mySQL & "commit; "
call query2table(mySQL,strconn)=
%>


This does not seem to return anything.

Thanks

!-------------------------------------!
David Williams

=
  _____ 

Get more from the Web. FREE MSN Explorer dow= nload : http://explorer.msn.com
<http://explorer.msn.com>


Get more from the Web. FREE MSN Explorer dow= nload : http://explorer.msn.com



Get more from the W= eb. FREE MSN Explorer download : http:= //explorer.msn.com

------=_NextPart_001_0001_01C25D88.06429F00-- From Inoue@tpf.co.jp Tue Sep 17 09:43:13 2002 Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CBDED475D6E for ; Tue, 17 Sep 2002 05:43:13 -0400 (EDT) Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by postgresql.org (Postfix) with SMTP id 4F54F475B8C for ; Tue, 17 Sep 2002 05:43:08 -0400 (EDT) Received: (qmail 26638 invoked from network); 17 Sep 2002 09:43:09 -0000 Received: from unknown (HELO mcadnote1) (126.0.1.60) by sd2.tpf-fw-c.co.jp with SMTP; 17 Sep 2002 09:43:09 -0000 From: "Hiroshi Inoue" To: "david williams" Cc: Subject: Re: Problem returning a cursor through ODBC to ASP layer from postgres Date: Tue, 17 Sep 2002 18:43:40 +0900 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0071_01C25E7A.243A0B40" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: Importance: Normal X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/74 X-Sequence-Number: 2045 This is a multi-part message in MIME format. ------=_NextPart_000_0071_01C25E7A.243A0B40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit -----Original Message----- From: david williams Could you try the snapshot dll at http://w2422.nsk.ne.jp/~inoue/ ? regards, Hiroshi Inoue I have created a function in postgres called getallusers(var) that returns a cursor. This works fine at the psql level but when I try to return it through ODBC I get errors. The function is as follows: CREATE OR REPLACE FUNCTION getallusers(refcursor) RETURN refcursor AS' begin open $1 for select * from users; return $1; end; ' language 'plpgsql'; I call it like this: <% strconn="DSN=p_test;uid=postgres;pwd=" mySQL = "begin "&vbcrlf mySQL = mySQL & "select getallusers('rs'); " mySQL = mySQL & "fetch all in rs; " mySQL = mySQL & "commit; " call query2table(mySQL,strconn) %> This does not seem to return anything. Thanks !-------------------------------------! David Williams ---------------------------------------------------------------------------- -- Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com ------=_NextPart_000_0071_01C25E7A.243A0B40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
-----Original Message-----
From: da= vid=20 williams

 Could you try the sna= pshot dll=20 at http://w2422.nsk.ne.jp/~inoue/&= nbsp;?
 
regards,
Hiroshi Inoue 
I have created a function in postgres called getallusers(var) that= =20 returns a cursor. This works fine at the psql level but when I try to ret= urn=20 it through ODBC I get errors.  
 
The function is as follows:
 
CREATE OR REPLACE FUNCTION getallusers(refcursor) RETURN refcursor= =20 AS'
 
begin
open $1 for select * from users;
return $1;
end;
' language 'plpgsql';
 
 
I call it like this:
 
<%
strconn=3D"DSN=3Dp_test;uid=3Dpostgres;pwd=3D"
mySQL = =3D "begin=20 "&vbcrlf
mySQL =3D mySQL & "select getallusers('rs'); "
myS= QL =3D=20 mySQL & "fetch all in rs; "
mySQL =3D mySQL & "commit; "
call query2table(mySQL,strconn)
%>
 

This does not seem to return anything.

Thanks


!-------------------------------------!
David Williams


Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com

------=_NextPart_000_0071_01C25E7A.243A0B40--