Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 03.01.2007, 13:45   #1
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default Manor procedures

hi all
it is normal if players must set manor every day?
First time I think yes..but now I see sometimes in cacheD some errors with procedure lin save ..last manor.. something like that..
problems with converting varchar to datetime..

I tried to edit manor table and save manor procedures and changed datetime to varchar.. but still get some errors..

Can anyone post here your manor procedures?

Code:
01/02/2007 06:00:xx.xx4, Error sql: EXEC lin_SetLastTaxUpdate '2007-0-1 12:0:52', '2007-0-2 0:0:4', '2007-0-2 6:0:8' (0)
01/02/2007 06:00:xx.xx4, Error sql: exec lin_SaveManorInfo 7, 7, 0, 0, 1, '0-0-0 0:0:0' (0)
01/02/2007 06:00:xx.xx4, Error 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to datetime.
01/02/2007 06:00:xx.xx4, Error 42000:[Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to datetime.
01/02/2007 06:00:xx.xx4, [.\Socket.cpp][12448] cannot update last tax change date.
01/02/2007 06:00:xx.xx4, [.\ManorDb.cpp][207]Cannot Save manor info, [7]-[7][0][0]
SetLastTaxUpdate:
Code:
ALTER PROCEDURE [dbo].[lin_SetLastTaxUpdate]  
(  
@income  varchar,
@tax varchar,
@manor varchar
I changed it from datetime to varchar.. It seems to bad.. but I get "vice versa" error earlier (Error converting data type datetime to varchar.) .. so I changed it to varchar..

SaveManorInfo
Code:
 @last_changed varchar
rodier is offline  
Old 03.01.2007, 16:54   #2
FidoW
Архивный участник
 
Join Date: Sep 2005
Posts: 1,014
Default

Umm, im not sure, a lot of time since i fixed that.. but the fix was converting input values in the store procedure to a valid datetime format... or something like that
FidoW is offline  
Old 03.01.2007, 21:05   #3
rodier
Архивный участник
 
Join Date: May 2005
Posts: 979
Default

can u show me your stored procedures?
rodier is offline  
Old 07.01.2007, 12:15   #4
kin
Архивный участник
 
Join Date: Sep 2006
Posts: 882
Default

FidoW
Can you share your fix please. I'm facing the same problem
kin is offline  
Old 17.01.2007, 09:05   #5
mono
Архивный участник
 
Join Date: Dec 2006
Posts: 16
Default

ALTER PROCEDURE dbo.lin_SetLastTaxUpdate
(
@income varchar(100),
@tax varchar(100),
@manor varchar(100)
)
AS

declare @income_ datetime
declare @tax_ datetime
declare @manor_ datetime

set @income =left(@income,5) + cast((cast(replace(substring(@income,6,2),'-','') as int) + 1) as varchar) + substring(@income, charindex ('-', @income, 6),100)
set @tax =left(@tax,5) + cast((cast(replace(substring(@tax,6,2),'-','') as int) + 1) as varchar) + substring(@tax, charindex ('-', @tax, 6),100)
set @manor =left(@manor,5) + cast((cast(replace(substring(@manor,6,2),'-','') as int) + 1) as varchar) + substring(@tax, charindex ('-', @tax, 6),100)

set @income_ = convert(datetime, @income)
set @tax_ = convert(datetime, @tax)
set @manor_ = convert(datetime, @manor)


SET NOCOUNT ON
IF EXISTS(SELECT * FROM castle_tax)
BEGIN
UPDATE castle_tax SET income_update = @income_, tax_change = @tax_, manor_reset = @manor_
END
ELSE
BEGIN
INSERT INTO castle_tax VALUES
( @income_, @tax_, @manor_)

END
mono is offline  
Old 17.01.2007, 09:35   #6
mcrabben7
Архивный участник
 
Join Date: Apr 2006
Posts: 461
Default

Thanks for the fix. It's useful (and amazingly simple) =)
mcrabben7 is offline  
Old 17.01.2007, 10:50   #7
Rexx
Архивный участник
 
Join Date: Jun 2006
Posts: 64
Default

Thanks for the fix,
I have been working on this error for several weeks with no results.
Rexx is offline  
Old 30.01.2007, 00:10   #8
KOC2000
Архивный участник
 
Join Date: Jun 2006
Posts: 100
Default

Thank you so much.
KOC2000 is offline  
 


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 21:03.