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

Kenneth Crocker KFCrocker at lbl.gov
Thu Feb 28 13:14:58 EST 2008


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.
	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
> 




More information about the rt-users mailing list