MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Jan 17, 2012 2:23 am
[3.34]%sqldb() object needs to be accessible to %sql() for all contexts |
%sqldb() generates an SQL db connection object. As it is a function, you can assign this object to a variable. Being as it's in a variable, you can then refer to said db connection object from any context.
%sql(), however, only deals with the db connection object name (AardwolfData) rather than the db connection object itself (@dbAardwolfData). This means that %sql() cannot currently be used out of context (ie, from a second window), as this generates a reproducible AV about an unknown database. The workaround, obviously, is to create a local connection object.
Any chance of having either the variable handle an %sql() call (ie, @dbAardwolfData.query("SQL string") or letting %sql() take the variable for the db reference (ie, %sql(@dbAardwolfData,"SQL string"))? |
|