Hi,
Thanks for your quick response. Please find the sql query below which I am using in my code :
#prepare the Sql Query
my $sql = sprintf 'select bugs.bug_id,bugs.short_desc,bugs.bug_status,IF(bugs.resolution <> "",bugs.resolution,"-"),bugs.version,bugs.creation_ts,
IF(bugact1.resolved_date <> "",bugact1.resolved_date,"-"),
IF(bugact2.verified_date <> "",IF(bugact1.resolved_date > bugact2.verified_date,"-",bugact2.verified_date),"-"),
IF(bugact3.closed_date <> "",bugact3.closed_date,"-"),
IF(bugact1.resolved_date <> "",TO_DAYS(bugact1.resolved_date) - TO_DAYS(bugs.creation_ts),"-"),
IF(bugact2.verified_date <> "",IF(bugact2.verified_date < bugact1.resolved_date,"-",
TO_DAYS(bugact2.verified_date) - TO_DAYS(bugact1.resolved_date)),"-"),
IF(bugact3.closed_date <> "",IF(bugact2.verified_date <> "" ,IF(bugact2.verified_date > bugact1.resolved_date,
TO_DAYS(bugact3.closed_date) - TO_DAYS(bugact2.verified_date),TO_DAYS(bugact3.closed_date) - TO_DAYS(bugact1.resolved_date)),
TO_DAYS(bugact3.closed_date) - TO_DAYS(bugact1.resolved_date)),"-"),
IF(bugact1.resolved_date <> "",IF(bugact2.verified_date <> "",
IF(bugact3.closed_date <> "","-",TO_DAYS(SYSDATE()) - TO_DAYS(bugact2.verified_date)),
IF(bugact3.closed_date <> "", "-",TO_DAYS(SYSDATE()) - TO_DAYS(bugact1.resolved_date))),TO_DAYS(SYSDATE()) - TO_DAYS(bugs.creation_ts))
from bugs
LEFT JOIN(select bugs_activity.bug_id,added ,max(bug_when) as "RESOLVED_DATE" from bugs, bugs_activity where added ="RESOLVED"
and bugs.bug_status IN("RESOLVED","VERIFIED","CLOSED")and bugs.bug_id = bugs_activity.bug_id group by bug_id)as bugact1
on bugs.bug_id = bugact1.bug_id
LEFT JOIN (select bugs_activity.bug_id,added ,max(bug_when) as "VERIFIED_DATE" from bugs, bugs_activity where added ="VERIFIED"
and bugs.bug_status IN("VERIFIED","CLOSED") and bugs.bug_id = bugs_activity.bug_id group by bug_id) as bugact2
on bugs.bug_id = bugact2.bug_id
LEFT JOIN (select bugs_activity.bug_id,added ,max(bug_when) as "CLOSED_DATE" from bugs, bugs_activity where added ="CLOSED"
and bugs.bug_status="CLOSED" and bugs.bug_id = bugs_activity.bug_id group by bug_id) as bugact3
on bugs.bug_id= bugact3.bug_id where bugs.bug_id in (%s)',join(",",@uniq_bugnos);
#Get Statement Object
my $sth = $dbh->prepare_cached($sql) or die "can't execute SQL:" . $dbh->errstr();
#Execute the query
$sth->execute() or die $DBI::errstr;
This code was working fine on bugzilla 3.0 without any error message but its giving error message in Bugzilla 3.4.
Please let me know your thoughts.
Thanks
kumar
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.