Forum OpenACS CMS: Re: Figuring out CMS

Collapse
6: Re: Figuring out CMS (response to 5)
Posted by Robert Gaszewski on

I repeated your steps and in my case everything works OK but I tested it with PostgreSQL version of OACS. I don't have any Oracle installation so I can't test it with Oracle.

But it looks that you have problems (ORA-00904: invalid column name) with following sql code:
select
 coalesce(max(order_n) + 1, 1)
from
 cr_item_rels
where
 item_id = :item_id


My results from psql (PostgreSQL interactive terminal) session:


openacs-4-6-2=# select * from cr_item_rels;
rel_id | item_id | related_object_id | relation_tag | order_n
--------+-----------+---------------------+----------------+-----------
429 | 417 | 344 | child_topic | 0
453 | 417 | 432 | child_topic | 1
(2 rows)

openacs-4-6-2=# select coalesce(max(order_n)+1,1) from cr_item_rels where item_id = 417;
case
------
2
(1 row)


IMO You should type following sql code in sqlplus terminal:
select * from cr_item_rels
and
select coalesce(max(order_n)+1,1) from cr_item_rels where item_id = your_item_id and look what you get.

Unfortunately I can't help you more with this problem because I have only little experience with Oracle.