[rt-users] Query to show tickets containing file attachments

Ruslan Zakirov ruz at bestpractical.com
Thu Feb 28 17:41:57 EST 2008


On Thu, Feb 28, 2008 at 9:14 PM, Kenneth Crocker <KFCrocker at lbl.gov> wrote:
> Shannon,
>
>
>         Your code doesn't make any sense to me. You use "A" for the Attachments
>  table and "T" for the Transactions table. But when you refer to the
>  field in your code you wrote "T.Ticket". There is no "Ticket" field on
>  the Transaction table. That's probably why you got the error.
Ticket was there for a long time until 3.4 (I think or even 3.2)
version, when transactions were only for tickets. Now, other records
may have transactions too.

>         My DataDictionary describes the "Type" field as "containing what the
>  transaction is for (i.e. to change a field on a ticket, the "type" would
>  be "set")". "ObjectID" is described as "the ID of the record the
>  transaction is referring to". "ObjectType" is described as "Describes
>  the class of record to which the transaction refers (most often
>  "Ticket")". Your code should probably refer to these three fields as
>  "T.ObjectType = 'Ticket' and T.ObjectID = A.Id and T.Type = (the type of
>  transaction attachment you're looking for i.e. t"create" or "set" or
>  whatever). Hope this helps.
>
>
>  Kenn
>  LBNL
>
>
>
>  On 2/28/2008 8:07 AM, Shannon Adams wrote:
>  > Update on this.  I found some old posts and I am trying to use the following command to display tickets by size:
>  >
>  > mysql -u root -p<mypasswd> -hlocalhost rt3 -e'select length(A.Content), A.id, T.Ticket  fromAttachments A, Transactions T where A.TransactionId = T.id order by 1'
>  >
>  > it returns:
>  > "ERROR 1054 (42S22) at line 1: Unknown column 'T.Ticket' in 'field list'"
>  >
>  > I am running RT 3.6.5.  Can help would be greatly appreciated!
>  >
>  > Thanks,
>  > Shannon
>  >
>  >
>  >
>  >
>  >
>  >       ____________________________________________________________________________________
>  > Never miss a thing.  Make Yahoo your home page.
>  > http://www.yahoo.com/r/hs
>  > _______________________________________________
>  > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>  >
>  > Community help: http://wiki.bestpractical.com
>  > Commercial support: sales at bestpractical.com
>  >
>  >
>  > Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>  > Buy a copy at http://rtbook.bestpractical.com
>  >
>
>  _______________________________________________
>  http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>  Community help: http://wiki.bestpractical.com
>  Commercial support: sales at bestpractical.com
>
>
>  Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>  Buy a copy at http://rtbook.bestpractical.com
>



-- 
Best regards, Ruslan.



More information about the rt-users mailing list