Search Postgresql Archives

Re: SPAM-LOW: cursors and ASP page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




1)  Make sure that your browser is set to display full errors, and not
"Friendly HTTP Error Messages" - that should allow you to see where and what
is breaking.

2)  Your ASP code is referencing rcursor, but that construct is strictly
within the SQL and not visible to scripting language.  Try using your
recordset (rs) instead and see if that changes anything.

3)  I am not sure how ODBC handles the conversion of cursor into a
recordset.  I personally think it will make choking sounds and collapse,
but...

Bill Penberthy
Scarpa Technology, Inc.

-----Original Message-----
From: pgsql-general-owner@xxxxxxxxxxxxxx
[mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of ANJANE
Sent: Thursday, October 12, 2006 7:31 AM
To: pgsql-general@xxxxxxxxxxxxxx
Subject: SPAM-LOW: [GENERAL] cursors and ASP page


I have a postgresql function defined as follows ... 

DECLARE int_userid ALIAS FOR $1; 
BEGIN OPEN $2 FOR 
SELECT DISTINCT 
  "users"."userloginid", 
  "roles"."rolelike" 
FROM 
  "roles" 
  INNER JOIN "userpreferences" ON "roles"."roleid" =
"userpreferences"."roleid" 
  INNER JOIN "users" ON "userpreferences"."userid" = "users"."userid" 
WHERE 
  "users"."userid" = int_userid AND "userpreferences"."userrolestatus"='a'; 
RETURN $2; 
close $2; 
END; 

This function takes two parameters - cursor and a valid integer, returns a
cursor in parameter 1 

In ASP page, I have the following code to reference this cursor and display
information obtained. 

This code does not work ... I get page cannot be displayed error - HTTP 500
- Internal server error 
Internet Explorer 


what am I doing wrong? I am using 7.3.200 version of postgresql ODBC driver
on an IIS server 


<html> 
<body> 


<% 
Dim STRCONN 
Dim sql 
Dim rs 

STRCONN = "Driver=PostgreSQL;Server=207.7.254.71;Port=5432;User
Id=postgres;Password=postgres;Database=transpandit;" 
sql = "begin; select tp_get_userroles('rcursor', 5052); fetch all in
rcursor; commit;" 
set rs = server.createobject("adodb.recordset") 
rs.open sql, STRCONN 

response.write(".." + sql + "<br>") 

FETCH rcursor INTO userloginid, rolelike 
reponse.write(userloginid + " - " + rolelike + "<br>") 
WHILE FETCH_STATUS = 0 
        FETCH rcursor INTO userloginid, rolelike 
        reponse.write(userloginid + " - " + rolelike + "<br>") 
WEND 

CLOSE rcursor 


//While Not rs.EOF 
// response.write("<br>"&rs(0)) 
// response.write("<br>"&rs(1)) 
// 
// rs.MoveNext 
//Wend 
//rs.Close 

%> 

</body> 
</html> 

-- 
View this message in context:
http://www.nabble.com/cursors-and-ASP-page-tf2430350.html#a6776250
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux