Forum OpenACS Q&A: Error when trying to view the details

Collapse
Posted by Fitri Sinan on
hello..
i'm trying to create a package using OAK tutorial.i have successful install the package.all the function that i create is successful except 1 function(to view the details).an error is like below....please anyone tell me where is the error and what should i do?(i'm using openacs v5.2.2)

Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: syntax error at or near "." at character 16

SQL:

select Not.note_title,Not.note_body,
case when acs_permission__permission_p(note_id,'496','write')='t' then 1 else 0 end as write_p,
case when acs_permission__permission_p(note_id,'496','admin')='t' then 1 else 0 end as admin_p,
case when acs_permission__permission_p(note_id,'496','delete')='t' then 1 else 0 end as delete_p

from Notes Not, acs_objects ao
where Not.note_id = '649'
and Not.note_id = ao.object_id


while executing
"ns_pg_bind 0or1row nsdb0 {

select Not.note_title,Not.note_body,
case when acs_permission__permission_p(note_id,:user_id,'write')='t' then 1 e..."
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
"switch $driverkey {
oracle {
return [uplevel $ulevel [list ns_ora $type $db $sql] $args]
}
..."
invoked from within
"db_exec 0or1row $db $full_statement_name $sql"
invoked from within
"set selection [db_exec 0or1row $db $full_statement_name $sql]"
("uplevel" body line 2)
invoked from within
"uplevel 1 $code_block "
invoked from within
"db_with_handle -dbn $dbn db {
set selection [db_exec 0or1row $db $full_statement_name $sql]
}"
(procedure "db_0or1row" line 23)
invoked from within
"db_0or1row note_select {}"
("uplevel" body line 1)
invoked from within
"uplevel db_0or1row $args"
(procedure "db_1row" line 2)
invoked from within
"db_1row note_select {} "
("uplevel" body line 20)
invoked from within
"uplevel {
ad_page_contract {

(.........many lines omitted)