no tuples found at index...

From: steve (a_at_b.com)
Date: 12/30/04


Date: Thu, 30 Dec 2004 10:35:00 -0600

i have a query hitting ms sql server. it runs fine in the query analyser but
gives an error (no tuples found at... which means the resultset returned no
records from what i've read). i have a good connection that i execute the
sql on.

i'm using odbc to query the db and have tried all of the odbc_cur_use_*
cursor types on the odbc_connect() but none solve the problem.

any help is appreciated! here's the sql...it's supposed to return a
unix-type permission string "rwx-rwx----" for each page that is accessed and
is used in conjunction with user account information:

===================

DECLARE @requiresPermission INT
SET @requiresPermission =
(
  SELECT COUNT(*)
  FROM webPages
  WHERE Url = 'index.php'
  AND Restricted = 0
)
IF @requiresPermission = 0 BEGIN
  SELECT 'r' Access
  RETURN
END
SET @requiresPermission =
(
  SELECT COUNT(*)
  FROM accessList a,
             webPages w
  WHERE w.Id = a.Url
  AND w.Url = 'index.php'
  AND a.person = 0
)
IF @requiresPermission = 0 BEGIN
 SELECT '' Access
 RETURN
END
SELECT a.Access
FROM accessList a,
           webPages w
WHERE w.Id = a.Url
AND w.Url = 'index.php'
AND a.person = 0

===================