1. Alvis Mikovs
  2. Narita

Commits

Alvis Mikovs  committed e13ced9

Ignore types returned by API, if they aren't in DB.

  • Participants
  • Parent commits 0cefac6
  • Branches default

Comments (0)

Files changed (1)

File data.sql

View file
 	WHERE narita.characters.characterID = t.characterID;
 	MERGE narita.characterSkills AS t
 	USING (
-		SELECT t.*
-		FROM OPENXML (@xmldoc, '//rowset[@name="skills"]/row')
-		WITH (characterID int '/eveapi/result/characterID', typeID int, skillpoints int, level tinyint, published bit) AS t
+		SELECT t.* FROM (
+			SELECT t.*
+			FROM OPENXML (@xmldoc, '//rowset[@name="skills"]/row')
+			WITH (characterID int '/eveapi/result/characterID', typeID int, skillpoints int, level tinyint, published bit) AS t
+		) AS t
+		INNER JOIN invTypes AS it ON it.typeID = t.typeID
 	) AS s ON
 		s.characterID = t.characterID AND
 		s.typeID = t.typeID
 		)
 	INSERT INTO narita.wallet
 	SELECT t.* FROM t
+	INNER JOIN invTypes AS it ON it.typeID = t.typeID
 	LEFT JOIN narita.wallet AS w ON
 		w.characterID = t.characterID AND
 		w.transactionID = t.transactionID