T2 production query

Hi capsuleers, i need to build a query that given an item name (eg: Hound) gives me all the base materials (components) needed, to which i can apply ME formula. Can you give me some advice ? I am using Postgres, for the records…

As I recall, the information is held in the blueprint record - and that is a static file you can download rather than an API request.
And, as you probably realise by now, items are referred to by unique number and you need to do the look ups. From another static file.

So it’ll be a process such as:
Look up the ID number for a Hound.
Look up the blueprint that makes that item.
Look at the IDs (and volumes) of the parts that go into manufacturing from that blueprint.
And since it’s a T2 ship:
Look up the blueprint that invents to the Hound blueprint.
Look up the IDs, quantities and probabilities of the items needed for invention.
For each of the IDs look up the item name in the static table of names to IDs.
Build shopping list.

Then you may want to do the calls to the market to find out the costs for making Hounds. Then realise it’s cheaper to buy 'em…

Fuzzworks has the details.
If @Steve_Ronuken posts a reply you can take it as definitely accurate.

If you’ve got the conversion of the sde that I’ve done, the details are in industryactivitymaterials

You’ll still need to handle the formula for ME yourself, but it’s relatively simple.

select "invTypes"."typeName", "industryActivityMaterials"."quantity"
from "industryActivityMaterials"
join "industryActivityProducts"
on "industryActivityMaterials"."typeID" = "industryActivityProducts"."typeID"
join "invTypes"
on "invTypes"."typeID" = "industryActivityMaterials"."materialTypeID"
join "invTypes" it
on "it"."typeID" = "industryActivityProducts"."productTypeID"
where "industryActivityMaterials"."activityID" = 1 and "it"."typeName" = '<ITEM NAME>'

This works. And yes, @Steve_Ronuken, i am using your sde dump. Thanks all, and merry christmas !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.