Hi, ich habe folgenden Query nach Anleitung erstellt.
DELETE FROM `itemloot` WHERE `entryid` = 35232,
INSERT INTO `itemloot` (`entryid`, `itemid`, `percentchance`, `heroicpercentchance`, `mincount`, `maxcount`) VALUES
(35232, 24669, 3, 0, 1, 1),
(35232, 29434, 10.1, 0, 1, 1),
(35232, 25055, 6.1, 1, 1, 1),
(35232, 24671, 3.1, 1, 1, 1),
(35232, 24673, 3.1, 1, 1, 1),
(35232, 24672, 3.1, 1, 1, 1),
(35232, 24675, 3, 1, 1, 1,),
(35232, 24669, 3, 1, 1, 1,),
(35232, 24670, 3, 1, 1, 1,),
(35232, 24676, 2.9, 1, 1, 1,),
Jedoch funktioniert dieser nicht, sonder bricht Navicat mit folgender Meldung ab:
1064 - You have an error in your SQL Syntax; Check corresponds to your MYSQL server version for the right Syntax to use near '
INSERT INTO `itemloot` (`entryid`, `itemid`, `percentchance`, `heroicpercentchance`, `mi' at line 1
Matrix316
2008-08-23, 12:59:34
Stimmen die Spaltennamen? Wobei ich nicht weiß, ob man überhaupt mehrere Zeilen mit nur einem insert into...values einfügen kann.
Moment: probiers mal so:
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance, mincount, maxcount)
also ohne die Hochkommas. Die braucht man (bei MSSQL zumindest) nur bei den Values, wenns Strings oder Datums sind.
EDIT2: außerdem kanns hier: WHERE `entryid` = 35232,
krachen, weil da ein Komma steht obwohl der Befehl abgeschlossen ist.
Ich würde es dann so probieren:
DELETE FROM itemloot WHERE entryid = 35232;
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24669, 3, 0, 1, 1),
(35232, 29434, 10.1, 0, 1, 1),
(35232, 25055, 6.1, 1, 1, 1),
(35232, 24671, 3.1, 1, 1, 1),
(35232, 24673, 3.1, 1, 1, 1),
(35232, 24672, 3.1, 1, 1, 1),
(35232, 24675, 3, 1, 1, 1),
(35232, 24669, 3, 1, 1, 1),
(35232, 24670, 3, 1, 1, 1,,
(35232, 24676, 2.9, 1, 1, 1);
go
alternativ:
DELETE FROM itemloot WHERE entryid = 35232;
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24669, 3, 0, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 29434, 10.1, 0, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 25055, 6.1, 1, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24671, 3.1, 1, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24673, 3.1, 1, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24672, 3.1, 1, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24675, 3, 1, 1, 1,);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24669, 3, 1, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24670, 3, 1, 1, 1);
go
INSERT INTO itemloot (entryid, itemid, percentchance, heroicpercentchance,mincount, maxcount) VALUES
(35232, 24676, 2.9, 1, 1, 1);
Das wäre halt so in MSSQL. Möglich, dass die Syntax bei mysql etwas anders ist (glaub ich aber net ;)). Das go ist auch nicht unbedingt nötig, aber schaden tuts net. ;)
vBulletin®, Copyright ©2000-2025, Jelsoft Enterprises Ltd.