Forum OpenACS Q&A: db_string multiple pools error

Collapse
Posted by Eduardo Santos on
Hi everybody,

I have two databases working in the same instance, and I'm using the second database tutotal posted here to make it work. Everything seemed to be working fine, so I could create tables and insert data using db_dml and select data using db_list. However, when I use db_string, the system tells me that my table doesn't exist in the database. I did the following:

set v_mes [db_string -dbn "marketing" seleciona_mes {select mes from churn3_mes}]

The error message was:

Database operation "0or1row" failed (exception ERROR, "ERROR: relation "churn3_mes" does not exist
")

ERROR: relation "churn3_mes" does not exist

SQL:
select mes from churn3_mes

If I try to select some openacs table, it seems to work:

set v_mes [db_string -dbn "marketing" seleciona_mes {select * from acs_objects]

and the message is:

Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")

SQL:
select * from acs_objects

When I perform the same select using db_list, it works just fine:

set v_mes [db_list -dbn "marketing" seleciona_mes {select mes from churn3_mes}]

It makes me think db_string has some bug on it. I'm using OpenACS Core on version 5.3.0b1. Any ideas?

Collapse
Posted by Victor Guerra on
Hi Eduardo,
I fixed that error sometime ago.

http://cvs.openacs.org/cvs/openacs-4/packages/acs-tcl/tcl/00-database-procs.tcl?r1=1.63.2.1&r2=1.63.2.2&only_with_tag=oacs-5-3
db_string was ignoring the -dbn switch.

You just need to update the file: /packages/acs-tcl/tcl/00-dabatabese-procs.tcl and reload the ac-tcl package from the APM.

Cheers.

Collapse
Posted by Eduardo Santos on
Thank you very much, I thought the problem was there, but I didn't want to mess with these files. i don't like to change the core packages.

I'll apply the patch. Thanks...