Re: SPAM-LOW: cursors and ASP page

From: "William Penberthy" <bpenberthy(at)scarpatechnology(dot)com>
To: "'ANJANE'" <softwaredesigns(at)hotmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: SPAM-LOW: cursors and ASP page
Date: 2006-10-12 15:33:26
Message-ID: !&!AAAAAAAAAAAYAAAAAAAAAAGZJtg+Hf1OimjKwiCyfgjCgAAAEAAAAJL+cukztIdNn4XVycT5Q8kBAAAAAA==@scarpatechnology.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of ANJANE
Sent: Thursday, October 12, 2006 7:31 AM
To: pgsql-general(at)postgresql(dot)org
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(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

In response to

Browse pgsql-general by date

  From Date Subject
Next Message SISTEMAS 2006-10-12 16:32:23
Previous Message jatrojoomla 2006-10-12 15:30:12 Searching a tool [like XAMPP on linux] of linux/apache/pgsql/php installer