[rt-users] Custom SQl - RT Handle
Simon Lane
slane at cedvalinfo.com
Tue Jun 16 10:05:03 EDT 2009
Does anyone know how to use the $RT->DatabaseHandle for the example below ?
I really have no clue and am not sure where to look.
Thanks.
_____
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Simon Lane
Sent: June 15, 2009 11:54 AM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] Custom SQl - RT Handle
In RT 3.6.4, I had the following working well:
my $dbh = $RT::Handle->dbh;
my $query_text = "SELECT ID FROM TICKETS WHERE ID >= 32394 AND ID <= 32396";
my $cursor = $dbh->prepare($query_text);
$cursor->bind_columns( undef, \$ticket_id);
$cursor->execute();
while ($cursor->fetch())
..
This is no longer working no that we upgraded to 3.8.3. I thought that the
solution might be:
my $dbh = $RT->DatabaseHandle;
..
But I get :
Global symbol "$RT" requires explicit package name
Which I did not get before.. I have tried some variations on the above, but
don't seem to get anywhere.
Anyone have any ideas ?
Thanks.
--
Simon Lane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090616/3afdf32b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4257 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20090616/3afdf32b/attachment.bin>
More information about the rt-users
mailing list