Mailing List Archive

TracReports
Question:

Is there a way to chain together SQL commands for TracReports -- What
I'd like to do is create a temporary table, pipe the results of one
select into that table, and then conduct a second select from the
temporary table...I'm not able to do it just by writing the SQL
commands into the TracReports window, but perhaps someone else can give
me a hand...

Oh, and if anyone wants to know why you do such a crazy thing, it's so
that I can track how many tickets were opened or closed against a
particular version or milestone, including those that may have been
moved to a previous or future version.

Any help would be great!

sean

_______________________________________________________________________
Sean A. Spicer

"Your mind is a shovel, use it." -anonymous

pgp key fingerprint: 8CED 19B7 3A3A BF54 B8E8 FB11 E044 F6B8 1585 9D54
pgp public key available at www.keyserver.net or pgpkeys.mit.edu (KEY
ID: 15859D54)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archive/trac/attachments/20040803/91d12911/PGP.pgp
TracReports [ In reply to ]
Sean,

Sounds like what you are trying to do is to create a report that =
contains data from both the report table and the report_change table.

I wrote a report that does a similar thing (lists all active tickets =
that I have reported or changed in any way). I couldn't use multiple SQL =
statements, but I got around it by doing a UNION of two selects. I =
haven't put it in our live trac yet, and anoyingly, I seem to have =
misplaced the SQL statement. I'll see if I can dig it out later today.

Let me know if you want more details.

Ian.

-----Original Message-----
From: trac-bounces@bobcat.edgewall.com =
[mailto:trac-bounces@bobcat.edgewall.com] On Behalf Of Sean Spicer
Sent: 03 August 2004 23:51
To: trac@bobcat.edgewall.com
Subject: [Trac] TracReports



Question:

Is there a way to chain together SQL commands for TracReports -- What=20
I'd like to do is create a temporary table, pipe the results of one=20
select into that table, and then conduct a second select from the=20
temporary table...I'm not able to do it just by writing the SQL=20
commands into the TracReports window, but perhaps someone else can give=20
me a hand...

Oh, and if anyone wants to know why you do such a crazy thing, it's so=20
that I can track how many tickets were opened or closed against a=20
particular version or milestone, including those that may have been=20
moved to a previous or future version.

Any help would be great!

sean

_______________________________________________________________________
Sean A. Spicer

"Your mind is a shovel, use it." -anonymous

pgp key fingerprint: 8CED 19B7 3A3A BF54 B8E8 FB11 E044 F6B8 1585 9D54 =
pgp public key available at www.keyserver.net or pgpkeys.mit.edu (KEY=20
ID: 15859D54)

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.733 / Virus Database: 487 - Release Date: 02/08/2004
=20
=20
TracReports [ In reply to ]
Sean Spicer <saspicer@mac.com> writes:

> Is there a way to chain together SQL commands for TracReports --
> What I'd like to do is create a temporary table, pipe the results of
> one select into that table, and then conduct a second select from
> the temporary table...I'm not able to do it just by writing the SQL
> commands into the TracReports window, but perhaps someone else can
> give me a hand...
>
> Oh, and if anyone wants to know why you do such a crazy thing, it's
> so that I can track how many tickets were opened or closed against a
> particular version or milestone, including those that may have been
> moved to a previous or future version.
>
> Any help would be great!

I'm not sure I understand what you want, but to use a query result in
another query in SQL, you can do like this:

select some, fields
from (select some, other, fields from some_table where foo = ...)
where bar = ...

(By the way: Please don't send a new mail to the list by replying to
another list mail and erasing the subject and body. There are still
references (in the form of In-Reply-To and References headers) to the
mail you replied to, which messes up the mail threading in mail
programs that support this. Your mail will end up sorted in the thread
of the mail you replied to, not as the root of a new thread as it
should.)

Regards,
Joel

--
Joel Rosdahl <joel@rosdahl.net>
Key BB845E97; fingerprint 9F4B D780 6EF4 5700 778D 8B22 0064 F9FF BB84 5E97