Topic
  • 1 reply
  • Latest Post - ‏2013-01-19T20:26:52Z by SystemAdmin
SystemAdmin
SystemAdmin
2826 Posts

Pinned topic .net DB2 Express-C Exception SQLSTATE=58005 Year, Month, and Day parameters

‏2013-01-19T14:29:29Z |
Observation: Encountering error - Year, Month, and Day parameters describe an un-representable DateTime. Check InnerException property for more detail. SQLSTATE=58005

Condition: Happens when I execute a Stored-procedure which queries & returns records from a single table based on the parameter provided.

OS: Windows Vista
IDE: Miscrosoft Visual Studio 2005 (C# Windows Application)
Other Information: Kindly have other tables also with these kinds of field layout and I don't find this happening. On checking I came across this link http://support.microsoft.com/kb/926357/en-us?sd=rss&spid=1967. However, it cannot be installed on my system.

Would it be possible for someone to please help me with this.

SAMPLE STRUCTURES

Table Structure Pattern

CREATE TABLE TRANSACTION_MASTER
(
RECORD_ID INTEGER NOT NULL,
DATE_OF_CREATION TIMESTAMP NOT NULL,
DATE_OF_MODIFICATION TIMESTAMP,
DATE_OF_DELETION TIMESTAMP,
LAST_UPDATED_BY VARCHAR(200) NOT NULL,
LAST_UPDATED_FROM VARCHAR(200) NOT NULL,
IS_ACTIVE INTEGER,

INVOICE_DATE DATE,
INVOICE_NO VARCHAR(50),
INVOICE_AMOUNT DECIMAL(30 , 2)
)
DATA CAPTURE NONE
COMPRESS NO;

Stored Procedure Pattern

CREATE PROCEDURE USER.GET_TRANSACTION_MASTERS
(
INOUT VAL_UNIQUE_RECORD_ID INTEGER,
INOUT VAL_DATE_OF_CREATION TIMESTAMP,
INOUT VAL_DATE_OF_MODIFICATION TIMESTAMP,
INOUT VAL_DATE_OF_DELETION TIMESTAMP,
INOUT VAL_LAST_UPDATED_BY VARCHAR(200),
INOUT VAL_LAST_UPDATED_FROM VARCHAR(200),
INOUT VAL_IS_ACTIVE INTEGER,

INOUT VAL_INVOICE_DATE DATE,
INOUT VAL_INVOICE_NO VARCHAR(50),
INOUT VAL_INVOICE_AMOUNT DECIMAL(30 , 2)

)
RESULT SETS 1
LANGUAGE SQL
BEGIN

DECLARE CR_TRANSACTIONMASTERS CURSOR WITH RETURN FOR
SELECT
* FROM
USER.TRANSACTION_MASTER
WHERE
(
(
(
INVOICE_NO = VAL_INVOICE_NO
OR
VAL_INVOICE_NO LIKE VAL_INVOICE_NO
)
AND
VAL_INVOICE_NO IS NOT NULL
)
OR
VAL_INVOICE_NO IS NULL
)
AND
(
(DATE(INVOICE_DATE) = DATE(VAL_INVOICE_DATE) AND VAL_INVOICE_DATE IS NOT NULL)
OR
VAL_INVOICE_DATE IS NULL
)
AND
(
(
INVOICE_AMOUNT = VAL_INVOICE_AMOUNT
AND
VAL_INVOICE_AMOUNT IS NOT NULL
)
OR
VAL_INVOICE_AMOUNT IS NULL
) ;
OPEN CR_TRANSACTIONMASTERS;
END
Updated on 2013-01-19T20:26:52Z at 2013-01-19T20:26:52Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2826 Posts

    Re: .net DB2 Express-C Exception SQLSTATE=58005 Year, Month, and Day parameters

    ‏2013-01-19T20:26:52Z  
    Content moved to.

    https://www.ibm.com/developerworks/forums/thread.jspa?threadID=468507&tstart=0

    Sorry, it was a mistake from my side. I ended up posting the same thing 4 times. I am sorry about the same.