postgresql7.1
select content_keyword__new (:heading,
:description,
:parent_id,
:keyword_id,
now(),
:creation_user,
:creation_ip,
'content_keyword')
select content_keyword__delete (:keyword_id)
select content_keyword__get_heading (:keyword_id)
select content_keyword__set_heading (:keyword_id,
:heading)
select content_keyword__get_description (:keyword_id)
select content_keyword__set_description (:keyword_id,
:description)
select content_keyword__get_path (:keyword_id)
select content_keyword__item_assign (:item_id,
:keyword_id,
null,
null,
null)
select content_keyword__item_unassign (:item_id,
:keyword_id)
SELECT
attribute_name, pretty_name
FROM
acs_attributes att,
ca_attributes ca,
(
select
subtree.keyword_id
from cr_keywords parent, cr_keywords subtree
where parent.keyword_id = :keyword_id
and parent.tree_sortkey between
subtree.tree_sortkey
and
tree_right(subtree.tree_sortkey)
) keywords
WHERE
att.attribute_id = ca.attribute_id
AND
ca.keyword_id = keywords.keyword_id
SELECT
attribute_name, datatype
FROM
acs_attributes att,
ca_attributes ca,
(
select
subtree.keyword_id
from cr_keywords parent, cr_keywords subtree
where parent.keyword_id = :keyword_id
and parent.tree_sortkey between
subtree.tree_sortkey
and
tree_right(subtree.tree_sortkey)
) keywords
WHERE
att.attribute_id = ca.attribute_id
AND
ca.keyword_id = keywords.keyword_id
select
repeat(:indent_pattern, (tree_level(subtree.tree_sortkey) - 2) * :indent_factor::integer) || subtree.heading AS heading,
subtree.keyword_id
from
cr_keywords parent, cr_keywords subtree
where
parent.keyword_id = :keyword_id
and
subtree.tree_sortkey between parent.tree_sortkey and tree_right(parent.tree_sortkey)