Forum OpenACS Q&A: Re: Res: Re: Res: Re: problem with index.tcl: Too many positional parameters specified while executing

code here :

ad_page_contract {
This page will display a list of to do items belonging to the current user.
} {
orderby:optional
}
set page_title "My To Do List"
set user_id [ad_conn user_id]
template::list::create -name todo_list \
-multirow todo_list_mr \
-elements {
title {
label "Task"
link_url_col item_url
link_html {title "Click to view this item details" }
}
due_date_pretty {
label "Due Date"
}
status_text {
label "Status"
}
creation_date_pretty {
label "Creation Date"
}
view {
display_template "View"
link_url_col item_url
}
delete {
display_template "Delete"
link_url_col delete_url
}
completed {
display_template "Mark Completed"
link_url_col completed_url
}
cancel {
display_template "Cancel"
link_url_col cancel_url
}
} -orderby {
title {orderby title}
due_date_pretty {orderby due_date}
status_text {orderby status}
creation_date_pretty {orderby creation_date}
} -actions {
"Add New Task" "todo-ae" "Click here to add a new item to the list"
}
if {[exists_and_not_null orderby]} {
set orderby_clause "ORDER BY [template::list::orderby_clause -name todo_list]"
} else {
set orderby_clause "ORDER BY due_date asc"
}
db_multirow -extend { item_url delete_url cancel_url completed_url status_text } todo_list_mr todo_list_mr
" select item_id,
title,
due_date,
to_char(due_date, 'Month DD YYYY ') as due_date_pretty,
creation_date,
to_char(creation_date, 'Month DD YYYY ') as creation_date_pretty,
status
from todo_item
where owner_id = :user_id"
$orderby_clause"
{
set form_mode display
set item_url "todo-ae?[export_vars -url { item_id form_mode }]"
switch $status {
p {set status_text "Pending"}
c {set status_text "Completed"}
x {set status_text "Canceled"}
default {set status_text "Unknown" }
}
set return_url [util_get_current_url]
set delete_url "todo-delete?[export_vars -url {item_id return_url}]"
if { $status != "c" } {
set new_status completed
set completed_url "todo-update-item?[export_vars -url {item_id new_status return_url}]"
}
if { $status != "x" } {
set new_status canceled
set cancel_url "todo-update-item?[export_vars -url {item_id new_status return_url}]"
}
}

Hi Juan,

You have an extra quote in your SQL query text after "owner_id = :user_id".

Using indentation and syntax highlighting may help you spotting those errors.

... and there is backslash missing at the end of the line starting with db_multirow -extend .... In your previous posting, it was there.