Forum OpenACS Development: db function

Collapse
Posted by Iuri Sampaio on
Is there such a db_ function that returns the columns of the records as TCL variables within a TCL page ?

Then i don't need to use palliatives such as

db_1row select_project_type_id "select * from im_projects where project_id = project_id" -column_array row

set project_type_id $row(project_type_id)
set project_nr $row(project_nr)
set project_name $row(project_name)
set parent_id $row(parent_id)
...

Collapse
2: Re: db function (response to 1)
Posted by Dave Bauer on
You might try the documentation

https://openacs.org/api-doc/proc-view?proc=db_1row

db_1row does what you need. There are thousands of exampels in the toolkit. If you do not specify column_array the columns popular tcl variables named for the columns as you want.

Collapse
3: Re: db function (response to 2)
Posted by Iuri Sampaio on
nice and easy.

Thanks Dave