[ic] Accessing database from a CommonAdjust UserTag
Kevin Walsh
interchange-users@icdevgroup.org
Wed Dec 4 21:28:00 2002
Benjamin Hillé [benjamin@yellow.uk.net] wrote:
>
> I have been strugling to access any table with a UserTag called from
> CommonAdjust.
> From all the docs and the mails I have read, you cannot access any tables
> from a UserTag because of Safe. Only if the tables are for instance open
> before calling the userTag can you access it. Or you can use perl tag to
> pass the name of tables. Now since I am calling the UserTag from the
> CommonAdjust I cannot open any table before hand in a page and I cannot use
> perl tag (I am laready calling my usertag). What should I Do ?
> Can anyone help ?
>
You could open the table yourself, from within the UserTag, like this:
my $db = ::database_exists_ref('sometable') or die 'Table? what table?';
my $resultset = $db->query($somequery) or die 'Query failed - oh no!';
>
> (30-line signature deleted)
>
--
_/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/
_/_/_/ _/_/ _/ _/ _/ _/_/ _/ K e v i n W a l s h
_/ _/ _/ _/ _/ _/ _/ _/_/ kevin@cursor.biz
_/ _/ _/_/_/_/ _/ _/_/_/ _/ _/