Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 05.10.2006, 06:16   #1
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default [HELP] lin_NominateHeroes

Quote:
10/05/2006 08:00:xx.xx4, Error sql: EXEC lin_NominateHeroes 1, 1, 1159653600 (0)
10/05/2006 08:00:xx.xx7, Error 21S01:[Microsoft][ODBC SQL Server Driver][SQL Server]Insert Error: Column name or number of supplied values does not match table definition.
So this is a cached error given from time to time.. In fact I get quite a flood of it, always same msg and same numbers.

¿Anyone can help me out on this? My SQL guy is Missing in action T_T

I guess I should check the stored procedure and check what column it's looking for and check if it exists or not right?
m4rk is offline  
Old 05.10.2006, 07:05   #2
kin
Архивный участник
 
Join Date: Sep 2006
Posts: 882
Default

I think you have all tables, but the value inserted is in wrong format.
kin is offline  
Old 06.10.2006, 07:01   #3
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

Quote:


CREATE PROCEDURE dbo.lin_NominateHeroes
(
@now_season INT,
@new_step INT,
@new_season_start_time INT
)
AS
SET NOCOUNT ON

UPDATE user_nobless
SET hero_type = 0

CREATE TABLE #hero_candidate (char_id INT, main_class INT, match_count INT, olympiad_point INT)
INSERT INTO #hero_candidate
SELECT un.char_id, ud.subjob0_class, un.match_count, un.olympiad_point
FROM user_nobless un, user_data ud
WHERE un.char_id = ud.char_id AND un.match_count >= 5 AND un.olympiad_win_count >= 1

CREATE TABLE #highest_score (main_class INT, olympiad_point INT, match_count INT)

DECLARE @hero_candidate_class INT
DECLARE hero_candidate_cursor CURSOR FOR
SELECT DISTINCT main_class FROM #hero_candidate

OPEN hero_candidate_cursor

FETCH NEXT FROM hero_candidate_cursor INTO @hero_candidate_class

WHILE @@FETCH_STATUS = 0
BEGIN

INSERT INTO #highest_score
SELECT TOP 1 main_class, olympiad_point, match_count
FROM #hero_candidate
WHERE main_class = @hero_candidate_class
ORDER BY olympiad_point DESC, match_count DESC

FETCH NEXT FROM hero_candidate_cursor INTO @hero_candidate_class
END

CLOSE hero_candidate_cursor
DEALLOCATE hero_candidate_cursor

CREATE TABLE #highest_score_nobless (char_id INT, main_class INT)
INSERT INTO #highest_score_nobless
SELECT c.char_id, c.main_class FROM #hero_candidate c, #highest_score s
WHERE c.main_class = s.main_class AND c.olympiad_point = s.olympiad_point AND c.match_count = s.match_count

CREATE TABLE #hero (char_id INT, main_class INT)
INSERT INTO #hero
SELECT char_id, main_class FROM #highest_score_nobless WHERE main_class IN (SELECT main_class FROM #highest_score_nobless GROUP BY main_class HAVING COUNT(main_class) = 1)

UPDATE user_nobless
SET hero_type = 1, win_count = win_count+1
WHERE char_id IN (SELECT char_id FROM #hero)

UPDATE user_nobless
SET previous_point = olympiad_point

UPDATE user_nobless
SET olympiad_point = 0, match_count = 0, olympiad_win_count = 0, olympiad_lose_count = 0

INSERT INTO olympiad_result
SELECT @now_season, main_class, char_id, olympiad_point, match_count FROM #hero_candidate

INSERT INTO olympiad
(step, season_start_time) VALUES (@new_step, @new_season_start_time)

SELECT @@IDENTITY





GO
I put this as a log of what I try to fix it, in case anyone has the same problem.

So... I will check all the tables affected by insert commands:
hero_candidate
highest_score
highest_score_nobless
hero
olympiad result
m4rk is offline  
Old 02.11.2006, 08:56   #4
tpuNIsher
Архивный участник
 
Join Date: Mar 2006
Posts: 685
Default

managed to fix it? m4rk?
tpuNIsher is offline  
Old 02.11.2006, 09:22   #5
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

well first I noticed those tables weren't created so I created them looking in stored procedures. After that I took olympiad off so I haven't really checked... will do shortly as my players are reaching high levels (if I have time i'll run a test today or tomorrow and update).
m4rk is offline  
Old 02.11.2006, 09:42   #6
tpuNIsher
Архивный участник
 
Join Date: Mar 2006
Posts: 685
Default

Looking forward to the result :>
tpuNIsher is offline  
Old 02.11.2006, 15:19   #7
Haygor
Архивный участник
 
Join Date: Apr 2006
Posts: 36
Default

after finally getting it to try to roll over on our two servers, I got it to work on one server but tgot these error n the other server, so these tells me there is a difference with converted databases, digging now to try and find this "minor" difference
Haygor is offline  
Old 02.11.2006, 16:00   #8
Haygor
Архивный участник
 
Join Date: Apr 2006
Posts: 36
Default

Anyone out there that is willing to do the digging and post the results here, I need to know what columns are set in your olympiad_result table inside lin2world. I think there is extra columns that is throwing a converted database off.
Haygor is offline  
Old 02.11.2006, 19:01   #9
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

Ok seems like my problems were solved by me creating the tables...

SO create the tables and set primary key well (remember must be something whose value can't repeat) and check ^_^

CREATE TABLE #hero_candidate (char_id INT, main_class INT, match_count INT, olympiad_point INT)
primary key: char_id

CREATE TABLE #highest_score (main_class INT, olympiad_point INT, match_count INT)
primary key: main_class

CREATE TABLE #highest_score_nobless (char_id INT, main_class INT)
primary key: char_id

CREATE TABLE #hero (char_id INT, main_class INT)
primary key: char_id
m4rk is offline  
Old 02.11.2006, 19:39   #10
djvogans
Архивный участник
 
Join Date: Apr 2005
Posts: 306
Default

what means # in front of the table ? hidden table or ? cause in 2k5 i can explore those table
djvogans is offline  
Old 02.11.2006, 19:45   #11
m4rk
Архивный участник
 
Join Date: Jan 2006
Posts: 607
Default

I don't know :S that's the stored procedure...
as it wasn't creating correctly those tables and reporting the error on the first post I created them by hand and now it seems OK
m4rk is offline  
Old 02.11.2006, 20:35   #12
djvogans
Архивный участник
 
Join Date: Apr 2005
Posts: 306
Default

thank you for info talmage
djvogans is offline  
Old 01.01.2007, 12:45   #13
djvogans
Архивный участник
 
Join Date: Apr 2005
Posts: 306
Default

01/01/2007 14:31:xx.xx9, Error sql: EXEC lin_NominateHeroes 1, 1, 1167523200 (0)
01/01/2007 14:31:xx.xx9, Error 21S01:[Microsoft][SQL Native Client][SQL Server]Insert Error: Column name or number of supplied values does not match table definition.



one fix : check olympiad_result table format :

CREATE TABLE [dbo].[olympiad_result] (
[season] int NOT NULL ,
[class] int NOT NULL ,
[char_id] int NOT NULL ,
[point] int NOT NULL ,
[match_count] int NOT NULL ,
[olympiad_win_count] int NOT NULL DEFAULT (0) ,
[olympiad_lose_count] int NOT NULL DEFAULT (0)
)
GO

ALTER TABLE [dbo].[olympiad_result] WITH NOCHECK
ADD CONSTRAINT [PK_olympiad_result] PRIMARY KEY CLUSTERED ( [season],[class],[char_id] )
djvogans is offline  
Old 27.03.2007, 05:40   #14
kok
Архивный участник
 
Join Date: Jun 2005
Posts: 39
Default

how many registered nobless need for they would throw to the stadium ?
kok is offline  
Old 27.03.2007, 05:59   #15
zaferk
Архивный участник
 
Join Date: Apr 2006
Posts: 92
Default

never quite counted, but its 5 i think
zaferk is offline  
Old 27.03.2007, 08:06   #16
seraphii
Архивный участник
 
Join Date: Jun 2006
Posts: 126
Default

for both competiton need 5 players nobless, class match and no class match.

Ps: in the class match need five nobless with same class. ex: five wind rider
seraphii is offline  
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 19:01.