Forum OpenACS Q&A: "select failed"(exception NSDB,....

Collapse
Posted by Pol Vilarmau on
Hi!

i've got the next error:

"select" failed (exception NSDB, "Query was not a statement returning rows.)
ERROR: parser: parse error at or near "("

the query is:

db_multirow domains domains_select {
  select *
    from cads_domains
    where cads_id = :package_id
    and acs_permission.permission_p(domain_id,:user_id,'cads_read_domain') = 't'
order by short_name
}

the error is in the "acs_permission....." line, but i don't know why!

I'm working on OpenACS 4.5 and postgres 7.1
Anybody could take me a hand?

Thanks, Pol Vilarmau

Collapse
Posted by Don Baccus on
It looks like you've got a query with Oracle rather than Postgres syntax.

"acs_permission.permission_p" in Oracle sez "the permission_p package which is part of the acs_permission package".

Postgres doesn't have packages.  What we've done is to map such functions into a form using double underbars, as in "acs_permission__permission_p"

(if the HTML rendering doesn't make it clear, the double underbar separates "acs_permission" and "permission_p")

Collapse
Posted by Pol Vilarmau on
Thanks Don! That's the solution!!! :)