Forum OpenACS Q&A: Response to How to create a group?

Collapse
Posted by C. R. Oldham on
<p>I think I found the problem.
</p>
<p>
In packages/acs-subsite/www/admin/groups/one.tcl there is a call to attribute::multirow, which calls package_object_view to get the list of attributes associated with the object.  That function calls a helper function, which executes this query on Oracle:

<pre>
select a.attribute_id,
      nvl(t.table_name, a.table_name) as table_name,
      nvl(a.column_name, a.attribute_name) as attribute_name,
      a.pretty_name,
      a.datatype,
      case when a.min_n_values = 0 then 'f' else 't' end as required_p,
              a.default_value,
              t.table_name as object_type_table_name,
              t.id_column as object_type_id_column
          from acs_object_type_attributes a,
              (select t.object_type, t.table_name, t.id_column, level as type_level
                  from acs_object_types t
                start with t.object_type='acs_object'
              connect by prior t.object_type = t.supertype) t
        where a.object_type = 'group'
          and t.object_type = a.object_type
        order by type_level
</pre>
<p>
(I inserted the values for the bind variables that should be there when someone is querying for a group)
</p>
This returns
<pre>
ATTRIBUTE_ID    TABLE_NAME    ATTRIBUTE_NAME    PRETTY_NAME    DATATYPE    REQUIRED_P    DEFAULT_VALUE    OBJECT_TYPE_TABLE_NAME    OBJECT_TYPE_ID_COLUMN
1    groups    object_type    Object Type    string    t        groups    group_id
2    groups    creation_date    Created Date    date    t        groups    group_id
3    groups    creation_ip    Creation IP Address    string    t        groups    group_id
4    groups    last_modified    Last Modified On    date    t        groups    group_id
5    groups    modifying_ip    Modifying IP Address    string    t        groups    group_id
6    groups    creation_user    Creation user    integer    f        groups    group_id
7    groups    context_id    Context ID    integer    f        groups    group_id
8    groups    email    Email Address    string    f        groups    group_id
9    groups    url    URL    string    f        groups    group_id
12    groups    group_name    Group name    string    t        groups    group_id
</pre>
<p>
on my Oracle 8.1.7.2 installation.  Obviously this is wrong, and it's the reason for the request error above, but I've been staring at the query for an hour and I can't see why this is the result.  This is with a fresh load of the data model.
</p>
<p>
The subselect returns the correct data (e.g. the OBJECT_TYPE goes with the TABLE_NAME)
</p>
<p>On my Pg 7.1.3 installation, the result is correct (e.g. the TABLE_NAME column contains the column that actually holds the attribute in question).
</p>
<p>
Can someone run this query against an Oracle instance of the data model and tell me if they get the same result?  If Oracle users get the correct result, does that mean my Oracle installation is corrupt somehow?
</p>
<p>We are on Oracle 8.1.7.2 (Linux)</p>