Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Shaiya > Shaiya Private Server > Shaiya PServer Development
You last visited: Today at 20:58

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



usp_save_user_buypointitems_ncash

Discussion on usp_save_user_buypointitems_ncash within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2010
Posts: 17
Received Thanks: 1
Cool usp_save_user_buypointitems_ncash

hi, somebody could help me with this problem?

the problem is the usual error 0 when buying things from item mall

Here usp_Save_User_BuyPointItems_NCash:


Here the logs:

PS_DBAGENT__system log start

PS_GAMELOG__system log start


If I'm missing some logs or dbo please tell me
Syek is offline  
Old 06/23/2013, 05:47   #2
 
castor4878's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 717
Received Thanks: 3,359
PS_DBAGENT__system.log indicates what kind of error occurs:

[SQL Server]La conversión del tipo de datos varchar en datetime produjo un valor fuera de intervalo., SQL STATE: 22007, NATIVE ERROR: 242 (0xF2)

and where the error occurs, we also got all transmitted parameters:

2013-06-22 19:17:46 SaveBuyPointItem 7 Leon qerr=0, {?=call usp_Save_User_BuyPointItems_NCash(1,7,0,'B1_Cface0 001', '2013-06-22 19:17:46')}

so, yet another, date conversion error ....

your stored procedure is defined as:

Code:
ALTER Proc [dbo].[usp_Save_User_BuyPointItems_NCash]

@UserUID int,
@CharID int,
@UsePoint int,
@ProductCode varchar(20),
@textDate varchar(30)

AS

DECLARE @UseTime datetime
set @UseTime=CONVERT(datetime, @textDate, 120)
so far so good, it receives:
1 as an int stored in @UserUID
7 as an int stored in @CharID
0 as an int stored in @UsePoint
'B1_Cface0 001' as varchar(20) (it is 13 char long) stored in @ProductCode
'2013-06-22 19:17:46' as varchar(30) (it is 29 char long) stored in @textDate

then you convert that "ODBC canonical" date into a datetime field using the convert function with the right parameter (120 means it is "ODBC canonical").

*w/o surptise* the log doesn't contain something like, "invalid argument for convert function", nor "unknown convert function", nor "invalid argument for assignment / invalid value for @UseTime field" or whatever close to that.

the error is so in the code present after.

we have:

PS_UserData.dbo.usp_Update_UserPoint @UserUID, @UsePoint

that does not use date (and the log does contain a date related error).

so last statement:

INSERT INTO PointLog(UseType,UserUID,CharID,UsePoint,ProductCo de,UseDate)
VALUES(@UseType,@UserUID,@CharID,@UsePoint,@Produc tCode,@textDate)

where we need about 3 seconds to figure out that the string-field-containing-an-OBDC-string-date-that-the-server-can-NOT-handle-by-itself parameter (the "textDate" variable) is used instead of the @UseTime variable, the one we introduced to handle that error ...
castor4878 is offline  
Thanks
4 Users
Old 06/23/2013, 07:40   #3
 
elite*gold: 0
Join Date: Sep 2010
Posts: 17
Received Thanks: 1
thanks thanks thanks you are awesome thanks for all the help more than says the errors, explaining to us how to fix them and how to understand why they happen

long live to you
Syek is offline  
Old 08/31/2013, 03:17   #4
 
AxelMac's Avatar
 
elite*gold: 0
Join Date: Aug 2012
Posts: 454
Received Thanks: 111
Quote:
Originally Posted by castor4878 View Post
PS_DBAGENT__system.log indicates what kind of error occurs:

[SQL Server]La conversión del tipo de datos varchar en datetime produjo un valor fuera de intervalo., SQL STATE: 22007, NATIVE ERROR: 242 (0xF2)

and where the error occurs, we also got all transmitted parameters:

2013-06-22 19:17:46 SaveBuyPointItem 7 Leon qerr=0, {?=call usp_Save_User_BuyPointItems_NCash(1,7,0,'B1_Cface0 001', '2013-06-22 19:17:46')}

so, yet another, date conversion error ....

your stored procedure is defined as:

Code:
ALTER Proc [dbo].[usp_Save_User_BuyPointItems_NCash]

@UserUID int,
@CharID int,
@UsePoint int,
@ProductCode varchar(20),
@textDate varchar(30)

AS

DECLARE @UseTime datetime
set @UseTime=CONVERT(datetime, @textDate, 120)
so far so good, it receives:
1 as an int stored in @UserUID
7 as an int stored in @CharID
0 as an int stored in @UsePoint
'B1_Cface0 001' as varchar(20) (it is 13 char long) stored in @ProductCode
'2013-06-22 19:17:46' as varchar(30) (it is 29 char long) stored in @textDate

then you convert that "ODBC canonical" date into a datetime field using the convert function with the right parameter (120 means it is "ODBC canonical").

*w/o surptise* the log doesn't contain something like, "invalid argument for convert function", nor "unknown convert function", nor "invalid argument for assignment / invalid value for @UseTime field" or whatever close to that.

the error is so in the code present after.

we have:

PS_UserData.dbo.usp_Update_UserPoint @UserUID, @UsePoint

that does not use date (and the log does contain a date related error).

so last statement:

INSERT INTO PointLog(UseType,UserUID,CharID,UsePoint,ProductCo de,UseDate)
VALUES(@UseType,@UserUID,@CharID,@UsePoint,@Produc tCode,@textDate)

where we need about 3 seconds to figure out that the string-field-containing-an-OBDC-string-date-that-the-server-can-NOT-handle-by-itself parameter (the "textDate" variable) is used instead of the @UseTime variable, the one we introduced to handle that error ...
you can post the complet query? pls
AxelMac is offline  
Old 08/31/2013, 10:16   #5
 
elite*gold: 0
Join Date: Aug 2013
Posts: 2,066
Received Thanks: 796
#Wrong Section btw. Thank you castor , helped me too .
Hep is offline  
Thanks
1 User
Old 08/31/2013, 13:47   #6
 
AxelMac's Avatar
 
elite*gold: 0
Join Date: Aug 2012
Posts: 454
Received Thanks: 111
what changes should I make?
AxelMac is offline  
Reply




All times are GMT +2. The time now is 20:58.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.