Forum OpenACS Q&A: Query returns no rows

Collapse
Posted by Adam Klaff on
While trying to browse the administration groups, i get the following
error.  I have tried using the pull down menu fix, but my parameters
file is exactly as the message says it should be, and i still get
this error.  Strangely, i get while browsing all admin groups except
Activities.  I also get a similar error while looking at the ad
server configuration.

I am clueless here, please help!

[10/Jan/2001:23:28:08][6688.14340][-conn4-] Notice: Querying 'select
ad_group_member_p(1, system_administrator_group_id()) from dual;'
[10/Jan/2001:23:28:08][6688.14340][-conn4-] Notice: dbinit: sql
(localhost::indieflow): 'select ad_group_member_p(1,
system_administrator_group_id()) from dual'
[10/Jan/2001:23:28:08][6688.14340][-conn4-] Error: Ns_PgExec: result
status: 7 message: ERROR:  Attribute 'group_name' not found

[10/Jan/2001:23:28:08][6688.14340][-conn4-] Error: dbinit: error
(localhost::indieflow,ERROR:  Attribute 'group_name' not found
): 'select ug.group_id as subgroup_id, group_name as subgroup_name,
ug.registration_date,
                        ug.approved_p, count(user_id) as n_members,
                        upper(group_name)
                  from user_groups ug, user_group_map ugm
                  where parent_group_id=1
                    and ug.group_id=ugm.group_id
              group by ug.group_id, group_name,
ug.registration_date, ug.approved_p
          union
                  select ug.group_id as subgroup_id, group_name as
subgroup_name, ug.registration_date,
                        ug.approved_p, 0 as n_members,
                        upper(group_name)
                  from user_groups ug
                  where parent_group_id=1 and
                    not exists (select 1 from user_group_map ugm
                      where ug.group_id=ugm.group_id)
          group by ug.group_id, group_name, ug.registration_date,
ug.approved_p
          order by upper(group_name)'
[10/Jan/2001:23:28:08][6688.14340][-conn4-] Error: Database
operation "select" failed (exception NSDB, "Query was not a statement
returning rows.")
Database operation "select" failed (exception NSDB, "Query was not a
statement returning rows.")
    while executing
"ns_db select $db  "select ug.group_id as subgroup_id, group_name as
subgroup_name, ug.registration_date,
                        ug.approved_p, count ..."
    invoked from within
"set selection [ns_db select $db  "select ug.group_id as subgroup_id,
group_name as subgroup_name, ug.registration_date,
                        ug.ap ..."
    invoked from within
"if { [empty_string_p $parent_group_id] } {
        set subgroup_html "
<h3>Subgroups</h3>
<ul>
"

        set selection [ns_db select $db  "select ug.group_i ..."
    invoked from within
"if { ![empty_string_p $parent_group_id] } {
    append properties_html "  <li> Parent group: <a href=group.tcl?
group_id=$parent_group_id>$parent_group ..."
    (file "/home/aolserver/web/server1/www/admin/ug/group.tcl" line
57)
    invoked from within
"source $script"
    invoked from within
"if ![file exists $script] {
                ns_returnnotfound $conn
        } else {
                source $script
        }"
    (procedure "ns_sourceproc" line 3)
    invoked from within
"ns_sourceproc cns78 {}"
[10/Jan/2001:23:28:08][6688.14340][-conn4-] Notice: Querying 'select
* from referer_log_glob_patterns;'
[10/Jan/2001:23:28:08][6688.14340][-conn4-] Notice: dbinit: sql
(localhost::indieflow): 'select * from referer_log_glob_patterns'
[10/Jan/2001:23:28:08][6688.14340][-conn4-] Notice: Querying 'update
referer_log set click_count = click_count + 1
where local_url = '/admin/ug/group.tcl'
and foreign_url = 'http://www.indieflow.com/admin/ug/group-type.tcl?
group_type=administration'
and trunc(entry_date) = trunc(sysdate());'
[10/Jan/2001:23:28:08][6688.14340][-conn4-] Notice: dbinit: sql
(localhost::indieflow): 'update referer_log set click_count =
click_count + 1
where local_url = '/admin/ug/group.tcl'
and foreign_url = 'http://www.indieflow.com/admin/ug/group-type.tcl?
group_type=administration'
and trunc(entry_date) = trunc(sysdate())'

Collapse
Posted by Lachlan Myers on
Looks a little like a load problem. Can you query the table directly?

Try

>psql mydb 
(or whatever your db is called)
[ ... few lines of postgres stuff ]

mydb # d user_groups

[you should get a table structure showing "group_name" varchar(100)]
[ if you get a "no relation", then the table hasn't loaded]
Collapse
Posted by Adam Klaff on
The table has loaded.  I isolated the problem.  At first I had to add the "ug" prefix to all the group_name references.  However, the code always broke at "order by upper(group_name)".  I removed that line, and it works fine.  I know i probably need it, but if it works now, i guess i'll probably just have to wait and see what suprises it gives me!