These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Matching a datacore with a skill, SQL.

Author
Victoria Sin
Doomheim
#1 - 2013-09-02 09:27:21 UTC  |  Edited by: Victoria Sin
Hey,

I run the following query against the database to get the items I need to do an invention job:

Quote:
USE Eve

DECLARE @blueprintType INT = 11370 -- Prototype Cloaking Device I

SELECT t.typeID AS ID,
t.typeName AS Name,
r.quantity AS Quantity
FROM
ramTypeRequirements r,
invTypes t,
invBlueprintTypes bt
WHERE
r.requiredTypeID = t.typeID
AND
r.typeID = bt.blueprintTypeID
AND
r.activityID = 8
AND
bt.productTypeID = @blueprintType


This gives me the following:

Quote:
20414 Datacore - Quantum Physics 2
20419 Datacore - Graviton Physics 2
25555 Esoteric Data Interface 1


Now in order to calculate invention chance for character X, I need to be able to associate a skill with a datacore. That is to say, I'd like a query that will return a skill ID (from invTypes) for each datacore (in invTypes). Is such a thing possible?
Rob Crowley
State War Academy
#2 - 2013-09-02 10:03:24 UTC
Victoria Sin wrote:
Now in order to calculate invention chance for character X, I need to be able to associate a skill with a datacore. That is to say, I'd like a query that will return a skill ID (from invTypes) for each datacore (in invTypes). Is such a thing possible?

Yep, it's in the datacore's attributes. Since datacores only have 1 prereq skill it's easy.

select valueInt,valueFloat from dgmTypeAttributes where typeID = X and attributeID = 182

I guess by your edit you figured out yourself that the groupIDs and marketGroupIDs aren't quite all over the place. Big smile
Victoria Sin
Doomheim
#3 - 2013-09-02 10:43:18 UTC
Rob Crowley wrote:

I guess by your edit you figured out yourself that the groupIDs and marketGroupIDs aren't quite all over the place. Big smile



Wonderful, thanks. Yes, 333. I was mistaken Lol.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#4 - 2013-09-02 12:02:20 UTC
if you've not run into it, the coalesce() function tends to be very useful, when dealing with dgmTypeAttributes. it returns the first non-null value in the list you give it. so:
coalesce(valueInt,valueFloat) as value

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Victoria Sin
Doomheim
#5 - 2013-09-02 16:10:21 UTC
Steve Ronuken wrote:
if you've not run into it, the coalesce() function tends to be very useful, when dealing with dgmTypeAttributes. it returns the first non-null value in the list you give it. so:
coalesce(valueInt,valueFloat) as value


Yea, I worked that one out thanks Steve.