|
You last visited: Today at 16:38
Advertisement
sqlQuery for create new Item
Discussion on sqlQuery for create new Item within the SRO PServer Questions & Answers forum part of the SRO Private Server category.
09/20/2024, 14:35
|
#1
|
elite*gold: 0
Join Date: Sep 2008
Posts: 8
Received Thanks: 0
|
sqlQuery for create new Item
Hi all,
i try to make a sqlQuery for creating a new row in _RefObjItem and take the generated ID from the column ID and paste in _RefObjCommon a new line and in column Link it paste die column ID from the new line in _RefObjItem ... i try all but all time i get the faildure:
Code:
Msg 109, Level 15, State 1, Line 1
There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
Completion time: 2024-09-20T14:31:15.0465060+02:00
Here is the sqlQuery that i made:
Quote:
INSERT INTO [SILKROAD_R_SHARD].[dbo].[_RefObjItem]
(ID, MaxStack, ReqGender, ReqStr, ReqInt, ItemClass, SetID, Dur_L, Dur_U, PD_L, PD_U, PDInc, ER_L, ER_U, ERInc, PAR_L, PAR_U, PARInc, BR_L, BR_U, MD_L, MD_U, MDInc, MAR_L, MAR_U, MARInc, PDStr_L, PDStr_U, MDInt_L, MDInt_U, Quivered, Ammo1_TID4, Ammo2_TID4, Ammo3_TID4, Ammo4_TID4, Ammo5_TID4, SpeedClass, TwoHanded, [Range], PAttackMin_L, PAttackMin_U, PAttackMax_L, PAttackMax_U, PAttackInc, MAttackMin_L, MAttackMin_U, MAttackMax_L, MAttackMax_U, MAttackInc, PAStrMin_L, PAStrMin_U, PAStrMax_L, PAStrMax_U, MAInt_Min_L, MAInt_Min_U, MAInt_Max_L, MAInt_Max_U, HR_L, HR_U, HRInc, CHR_L, CHR_U, Param1, Desc1_128, Param2, Desc2_128, Param3, Desc3_128, Param4, Desc4_128, Param5, Desc5_128, Param6, Desc6_128, Param7, Desc7_128, Param8, Desc8_128, Param9, Desc9_128, Param10, Desc10_128, Param11, Desc11_128, Param12, Desc12_128, Param13, Desc13_128, Param14, Desc14_128, Param15, Desc15_128, Param16, Desc16_128, Param17, Desc17_128, Param18, Desc18_128, Param19, Desc19_128, Param20, Desc20_128, MaxMagicOptCount, ChildItemCount, [Link])
VALUES
(1, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5000, 1, -1, 'RESURRECT', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', 0, 0, 0);
DECLARE @NewID INT;
SET @NewID = SCOPE_IDENTITY();
INSERT INTO [SILKROAD_R_SHARD].[dbo].[_RefObjCommon]
(Service, ID, CodeName128, ObjName128, OrgObjCodeName128, NameStrID128, DescStrID128, CashItem, Bionic, TypeID1, TypeID2, TypeID3, TypeID4, DecayTime, Country, Rarity, CanTrade, CanSell, CanBuy, CanBorrow, CanDrop, CanPick, CanRepair, CanRevive, CanUse, CanThrow, Price, CostRepair, CostRevive, CostBorrow, KeepingFee, SellPrice, ReqLevelType1, ReqLevel1, ReqLevelType2, ReqLevel2, ReqLevelType3, ReqLevel3, ReqLevelType4, ReqLevel4, MaxContain, RegionID, Dir, OffsetX, OffsetY, OffsetZ, Speed1, Speed2, Scale, BCHeight, BCRadius, EventID, AssocFileObj128, AssocFileDrop128, AssocFileIcon128, AssocFile1_128, AssocFile2_128, [Link])
VALUES
(1, @NewID, 'ITEM_MALL_NAME', 'NAME', 'xxx', 'SN_ITEM_MALL_NAME', 'SN_ITEM_MALL_NAME_TT_DESC', 0, 0, 3, 3, 3, 1, 180000, 3, 0, 1, 1, 1, 3, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 'xxx', 'item\etc\drop_mall_scroll.bsr', 'item\kern\name.ddj', 'xxx', 'xxx', @NewID);
SELECT * FROM [SILKROAD_R_SHARD].[dbo].[_RefObjItem] WHERE ID = @NewID;
SELECT * FROM [SILKROAD_R_SHARD].[dbo].[_RefObjCommon] WHERE ID = @NewID;
|
Anybody has a idea or could help me to fix it?
I know i can put the lines manuel but i want to make it over sqlQuery it has some reasons...
it would be really really nice if someone could help me
now i just try to create only in _RefObjItem a new line with this Query but it also failed and i get this error:
Code:
Msg 109, Level 15, State 1, Line 1
There are more columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
Quote:
INSERT INTO _RefObjItem (
MaxStack, ReqGender, ReqStr, ReqInt, ItemClass, SetID, Dur_L, Dur_U, PD_L, PD_U, PDInc,
ER_L, ER_U, ERInc, PAR_L, PAR_U, PARInc, BR_L, BR_U, MD_L, MD_U, MDInc, MAR_L, MAR_U, MARInc,
PDStr_L, PDStr_U, MDInt_L, MDInt_U, Quivered, Ammo1_TID4, Ammo2_TID4, Ammo3_TID4, Ammo4_TID4,
Ammo5_TID4, SpeedClass, TwoHanded, Range, PAttackMin_L, PAttackMin_U, PAttackMax_L, PAttackMax_U,
PAttackInc, MAttackMin_L, MAttackMin_U, MAttackMax_L, MAttackMax_U, MAttackInc, PAStrMin_L, PAStrMin_U,
PAStrMax_L, PAStrMax_U, MAInt_Min_L, MAInt_Min_U, MAInt_Max_L, MAInt_Max_U, HR_L, HR_U, HRInc, CHR_L, CHR_U,
Param1, Desc1_128, Param2, Desc2_128, Param3, Desc3_128, Param4, Desc4_128, Param5, Desc5_128, Param6, Desc6_128,
Param7, Desc7_128, Param8, Desc8_128, Param9, Desc9_128, Param10, Desc10_128, Param11, Desc11_128, Param12, Desc12_128,
Param13, Desc13_128, Param14, Desc14_128, Param15, Desc15_128, Param16, Desc16_128, Param17, Desc17_128,
Param18, Desc18_128, Param19, Desc19_128, Param20, Desc20_128, MaxMagicOptCount, ChildItemCount, Link
) VALUES (
1000, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 820, 'HP회복양', 0, 'HP회복양(%)', 820, 'MP회복양',
0, 'MP회복양(%)', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1,
'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', 0, 0, 0
);
|
|
|
|
09/25/2024, 01:04
|
#2
|
dotCom
elite*gold: 9560
Join Date: Mar 2009
Posts: 16,443
Received Thanks: 4,535
|
SRO Private Server -> SRO PServer Quest…
#moved
|
|
|
09/25/2024, 06:50
|
#3
|
elite*gold: 0
Join Date: Sep 2018
Posts: 386
Received Thanks: 853
|
This query creates an instant return scroll.
You may learn something out from it.
Quicknote: I prefer to use IDENT_CURRENT since it doesn't really matter at our case.
PHP Code:
USE [SRO_VT_SHARD]
-- Basic Setup DECLARE @@CodeName128 VARCHAR(129) = 'ITEM_RETURN_SCROLL_SYSTEM_01' DECLARE @@IconDDJ VARCHAR(129) = 'item\etc\mall_return_scroll.ddj' DECLARE @@DropBSR VARCHAR(129) = 'item\etc\drop_mall_scroll.bsr'
-- Add Item DECLARE @@RefObjItem_ID INTEGER = IDENT_CURRENT('_RefObjItem') INSERT INTO [_RefObjItem] ([MaxStack],[ReqGender],[ReqStr],[ReqInt],[ItemClass],[SetID],[Dur_L],[Dur_U],[PD_L],[PD_U],[PDInc],[ER_L],[ER_U],[ERInc],[PAR_L],[PAR_U],[PARInc],[BR_L],[BR_U],[MD_L],[MD_U],[MDInc],[MAR_L],[MAR_U],[MARInc],[PDStr_L],[PDStr_U],[MDInt_L],[MDInt_U],[Quivered],[Ammo1_TID4],[Ammo2_TID4],[Ammo3_TID4],[Ammo4_TID4],[Ammo5_TID4],[SpeedClass],[TwoHanded],[Range],[PAttackMin_L],[PAttackMin_U],[PAttackMax_L],[PAttackMax_U],[PAttackInc],[MAttackMin_L],[MAttackMin_U],[MAttackMax_L],[MAttackMax_U],[MAttackInc],[PAStrMin_L],[PAStrMin_U],[PAStrMax_L],[PAStrMax_U],[MAInt_Min_L],[MAInt_Min_U],[MAInt_Max_L],[MAInt_Max_U],[HR_L],[HR_U],[HRInc],[CHR_L],[CHR_U],[Param1],[Desc1_128],[Param2],[Desc2_128],[Param3],[Desc3_128],[Param4],[Desc4_128],[Param5],[Desc5_128],[Param6],[Desc6_128],[Param7],[Desc7_128],[Param8],[Desc8_128],[Param9],[Desc9_128],[Param10],[Desc10_128],[Param11],[Desc11_128],[Param12],[Desc12_128],[Param13],[Desc13_128],[Param14],[Desc14_128],[Param15],[Desc15_128],[Param16],[Desc16_128],[Param17],[Desc17_128],[Param18],[Desc18_128],[Param19],[Desc19_128],[Param20],[Desc20_128],[MaxMagicOptCount],[ChildItemCount],[Link]) VALUES (9999,2,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'????',1,'??????',-1,'RESURRECT',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx',0,0,0)
INSERT INTO [_RefObjCommon] ([Service],[CodeName128],[ObjName128],[OrgObjCodeName128],[NameStrID128],[DescStrID128],[CashItem],[Bionic],[TypeID1],[TypeID2],[TypeID3],[TypeID4],[DecayTime],[Country],[Rarity],[CanTrade],[CanSell],[CanBuy],[CanBorrow],[CanDrop],[CanPick],[CanRepair],[CanRevive],[CanUse],[CanThrow],[Price],[CostRepair],[CostRevive],[CostBorrow],[KeepingFee],[SellPrice],[ReqLevelType1],[ReqLevel1],[ReqLevelType2],[ReqLevel2],[ReqLevelType3],[ReqLevel3],[ReqLevelType4],[ReqLevel4],[MaxContain],[RegionID],[Dir],[OffsetX],[OffsetY],[OffsetZ],[Speed1],[Speed2],[Scale],[BCHeight],[BCRadius],[EventID],[AssocFileObj128],[AssocFileDrop128],[AssocFileIcon128],[AssocFile1_128],[AssocFile2_128],[Link]) VALUES (1,@@CodeName128,'Scroll for New Systems','xxx',CONCAT('SN_',@@CodeName128),CONCAT('SN_',@@CodeName128,'_TT_DESC'),1,0,3,3,3,1,180000,3,0,1,1,1,255,0,1,0,0,1,0,0,0,0,0,0,0,-1,0,-1,0,-1,0,-1,0,-1,0,0,0,0,0,0,0,100,0,0,0,'xxx',@@DropBSR,@@IconDDJ,'xxx','xxx',@@RefObjItem_ID+1)
|
|
|
10/22/2024, 19:46
|
#4
|
elite*gold: 0
Join Date: May 2021
Posts: 50
Received Thanks: 7
|
Quote:
BEGIN TRY
INSERT INTO [SILKROAD_R_SHARD].[dbo].[_RefObjItem] (ID, MaxStack, ReqGender, ReqStr, ReqInt, ItemClass, SetID, Dur_L, Dur_U, PD_L, PD_U, PDInc, ER_L, ER_U, ERInc, PAR_L, PAR_U, PARInc, BR_L, BR_U, MD_L, MD_U, MDInc, MAR_L, MAR_U, MARInc, PDStr_L, PDStr_U, MDInt_L, MDInt_U, Quivered, Ammo1_TID4, Ammo2_TID4, Ammo3_TID4, Ammo4_TID4, Ammo5_TID4, SpeedClass, TwoHanded, [Range], PAttackMin_L, PAttackMin_U, PAttackMax_L, PAttackMax_U, PAttackInc, MAttackMin_L, MAttackMin_U, MAttackMax_L, MAttackMax_U, MAttackInc, PAStrMin_L, PAStrMin_U, PAStrMax_L, PAStrMax_U, MAInt_Min_L, MAInt_Min_U, MAInt_Max_L, MAInt_Max_U, HR_L, HR_U, HRInc, CHR_L, CHR_U, Param1, Desc1_128, Param2, Desc2_128, Param3, Desc3_128, Param4, Desc4_128, Param5, Desc5_128, Param6, Desc6_128, Param7, Desc7_128, Param8, Desc8_128, Param9, Desc9_128, Param10, Desc10_128, Param11, Desc11_128, Param12, Desc12_128, Param13, Desc13_128, Param14, Desc14_128, Param15, Desc15_128, Param16, Desc16_128, Param17, Desc17_128, Param18, Desc18_128, Param19, Desc19_128, Param20, Desc20_128, MaxMagicOptCount, ChildItemCount, [Link])
VALUES
(1, 2, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5000, 1, -1, 'RESURRECT', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', 0, 0, 0);
DECLARE @NewID INT;
SET @NewID = SCOPE_IDENTITY();
INSERT INTO [SILKROAD_R_SHARD].[dbo].[_RefObjCommon]
(Service, ID, CodeName128, ObjName128, OrgObjCodeName128, NameStrID128, DescStrID128, CashItem, Bionic, TypeID1, TypeID2, TypeID3, TypeID4, DecayTime, Country, Rarity, CanTrade, CanSell, CanBuy, CanBorrow, CanDrop, CanPick, CanRepair, CanRevive, CanUse, CanThrow, Price, CostRepair, CostRevive, CostBorrow, KeepingFee, SellPrice, ReqLevelType1, ReqLevel1, ReqLevelType2, ReqLevel2, ReqLevelType3, ReqLevel3, ReqLevelType4, ReqLevel4, MaxContain, RegionID, Dir, OffsetX, OffsetY, OffsetZ, Speed1, Speed2, Scale, BCHeight, BCRadius, EventID, AssocFileObj128, AssocFileDrop128, AssocFileIcon128, AssocFile1_128, AssocFile2_128, [Link])
VALUES
(1, @NewID, 'ITEM_MALL_NAME', 'NAME', 'xxx', 'SN_ITEM_MALL_NAME', 'SN_ITEM_MALL_NAME_TT_DESC', 0, 0, 3, 3, 3, 1, 180000, 3, 0, 1, 1, 1, 3, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, -1, 0, -1, 0, -1, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 'xxx', 'item\etc\drop_mall_scroll.bsr', 'item\kern\name.ddj', 'xxx', 'xxx', @NewID);
SELECT * FROM [SILKROAD_R_SHARD].[dbo].[_RefObjItem] WHERE ID = @NewID;
SELECT * FROM [SILKROAD_R_SHARD].[dbo].[_RefObjCommon] WHERE ID = @NewID;
END TRY
BEGIN CATCH
SELECT ERROR_MESSAGE() AS ErrorMessage;
END CATCH;
|
The error has been corrected. The code works with you.
BEGIN TRY
INSERT INTO _RefObjItem (
MaxStack, ReqGender, ReqStr, ReqInt, ItemClass, SetID,
Dur_L, Dur_U, PD_L, PD_U, PDInc, ER_L, ER_U, ERInc,
PAR_L, PAR_U, PARInc, BR_L, BR_U, MD_L, MD_U, MDInc,
MAR_L, MAR_U, MARInc, PDStr_L, PDStr_U, MDInt_L,
MDInt_U, Quivered, Ammo1_TID4, Ammo2_TID4, Ammo3_TID4,
Ammo4_TID4, Ammo5_TID4, SpeedClass, TwoHanded,
[Range], PAttackMin_L, PAttackMin_U, PAttackMax_L,
PAttackMax_U, PAttackInc, MAttackMin_L, MAttackMin_U,
MAttackMax_L, MAttackMax_U, MAttackInc, PAStrMin_L,
PAStrMin_U, PAStrMax_L, PAStrMax_U, MAInt_Min_L,
MAInt_Min_U, MAInt_Max_L, MAInt_Max_U, HR_L, HR_U,
HRInc, CHR_L, CHR_U, Param1, Desc1_128, Param2,
Desc2_128, Param3, Desc3_128, Param4, Desc4_128,
Param5, Desc5_128, Param6, Desc6_128, Param7,
Desc7_128, Param8, Desc8_128, Param9, Desc9_128,
Param10, Desc10_128, Param11, Desc11_128, Param12,
Desc12_128, Param13, Desc13_128, Param14, Desc14_128,
Param15, Desc15_128, Param16, Desc16_128, Param17,
Desc17_128, Param18, Desc18_128, Param19, Desc19_128,
Param20, Desc20_128, MaxMagicOptCount, ChildItemCount,
[Link]
) VALUES (
1000, 2, 0, 0, 5, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0,
820, 'HP회복양', 0, 'HP회복양(%)', 820,
'MP회복양', 0, 'MP회복양(%)', -1, 'xxx',
-1, 'xxx', -1, 'xxx', -1, 'xxx',
-1, 'xxx', -1, 'xxx', -1, 'xxx',
-1, 'xxx', -1, 'xxx', -1, 'xxx',
-1, 'xxx', -1, 'xxx', -1, 'xxx',
-1, 'xxx', -1, 'xxx', 0, 0, 0
);
|
|
|
 |
Similar Threads
|
[HELP] How create some weapons in ShStudio? / Crash item mall / can't create new mobs
06/24/2021 - Shaiya PServer Development - 3 Replies
Hey,
Before say "use the search button" or "see other topic for resolve ur problem" i have search and i don't have found any fix for my problem :/
I have 4 big problem:
-1: When i buy an item in my item mall IG the game crash (please try to recconect to the server ERROR 0) i don't have found help after 2 days of search
-2: When i want create a boss/mobs IG (only boss and mobs who i have add in my Monster.SData) i have this error in the tchat "Not authorized to create!" why i have this...
|
[Solved] Create Item from WorldServer, Item visible only after restart client
03/20/2017 - Flyff Private Server - 4 Replies
Hi,
I am currently trying to understand the FlyFF Source by implementing my own systems from scratch.
I just got inspired by a Perin Converter using the Motion System. So I created a new motion which tries to convert penya to perin when clicking the motion.
That also works. I check if user has more or equal to 100.000.000 penya in inventory, if yes, remove the gold, and create a perin in his inventory.
Well removing the penya works flawless. Creating the perin works too, but its...
|
New Private server Update new skill ... new item . . .. New avata . . . New map. . .
01/19/2011 - Cabal Private Server - 54 Replies
Web :cabalvn.net
YouTube - CabalVN Big Update.mpg
]Remember This server is EP2 with newskill..New map..new item
and inferno mob have only in channel hard core 3
New channel 4 . . .for farm
New Item Change Kit (Hair Syle) - Fever:http://images.plurk.com/3399722_2392a65b4121 5880b03fecf8455271e7.jpg
http://images.plurk.com/3399722_a1fea1218f6a2d19d ef18830a9b41a85.jpg
Ring of Luck and Ring of crit :http://ca6.upanh.com/12.452.16684262.CPH0/cabalvn net1283018347rin.jpg
FS new skill...
|
[HELP] How to create a new shop. SHOP CREATE
12/31/2010 - CO2 Private Server - 5 Replies
#closed
|
All times are GMT +1. The time now is 16:38.
|
|