Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Devel

Re: [rt-users] Custom SQl - RT Handle

 

 

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded


slane at cedvalinfo

Jun 17, 2009, 9:51 AM

Post #1 of 2 (992 views)
Permalink
Re: [rt-users] Custom SQl - RT Handle

I am sure this may be a little basic for the developers list, but no-one on
the users' seems to have any idea...



In RT 3.6.4, I had the following example working well for a direct SQL
query:



my $dbh = $RT::Handle->dbh;
my $query_text = $some_specific_direct_query;
my $cursor = $dbh->prepare($query_text);
$cursor->bind_columns( undef, \$ticket_id);
$cursor->execute();
while ($cursor->fetch())

..



I believe that the $RT::Handle 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
Attachments: smime.p7s (4.16 KB)


ruslan.zakirov at gmail

Jun 17, 2009, 10:37 AM

Post #2 of 2 (893 views)
Permalink
Re: [rt-users] Custom SQl - RT Handle [In reply to]

I'm pretty sure it should work in 3.8. You don't do even basic error checking.

On Wed, Jun 17, 2009 at 8:51 PM, Simon Lane<slane [at] cedvalinfo> wrote:
> I am sure this may be a little basic for the developers list, but no-one on
> the users’ seems to have any idea………
>
>
>
> In RT 3.6.4, I had the following example working well for a direct SQL
> query:
>
>
>
> my $dbh = $RT::Handle->dbh;
> my $query_text = $some_specific_direct_query;
> my $cursor = $dbh->prepare($query_text);
> $cursor->bind_columns( undef, \$ticket_id);
> $cursor->execute();
> while ($cursor->fetch())
>
> ……
>
>
>
> I believe that the $RT::Handle 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
>
>
>
> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
>



--
Best regards, Ruslan.
_______________________________________________
List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

Request Tracker devel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.