Hello,
I Keep getting following error -
IBM.Data.DB2.DB2Exception {"ERROR [58005] [IBM][DB2.NET] SQL0902 An
unexpected exception has occurred in Process: 4952 Thread 16
InnerException Message: Year, Month, and Day parameters describe an
un-representable DateTime. Check InnerException property for more detail.
SQLSTATE=58005"}
This happens when I select a row with a certain date in it
Data
KRT_IND NM_IND AD_IND NR_TEL_HUIS GSL_IND DT_GBR PLA_GBR COD_PO
ID_BRK_CRE_RE TMS_CRE_RE ID_BRK_WY_L_RE TMS_WY_L_RE NR_WY
-------- --------------------------------------------------
-------------------------------------------------- ---------------
---------- ---------- ---------------------------------------- ------
------------- ---------- -------------- ----------- -----------
SIDAVET Ann verdoodt adres NR_TEL_HUIS V 23/02/1966 AALST 8000 SIDNALE
08/04/2006 - - 0
1 record(s) selected.
When I use dynamic SQL in my code , I can easily select that row from that
table. But when I issue the same SQL packaged in a Stored procedure I get
Errors regarding the datetime format.
The strange thing is that when I change the values in the table in the
date type column from 1980-02-23 (feb , 23th) to 1980-02-03 (feb , 3rd)
Both Embedded SQL and the stored procedure version work.
Also executing the stored procedure from the command editor gives no
problem with a date like 1980-02-23.
Any help is welcome !
best regards,
Alexander
ps : some details
I using a DB2 server in BELGIUM so the dateTime format is Day-Month-Year
Data
KRT_IND NM_IND AD_IND NR_TEL_HUIS GSL_IND DT_GBR PLA_GBR COD_PO
ID_BRK_CRE_RE TMS_CRE_RE ID_BRK_WY_L_RE TMS_WY_L_RE NR_WY
-------- --------------------------------------------------
-------------------------------------------------- ---------------
---------- ---------- ---------------------------------------- ------
------------- ---------- -------------- ----------- -----------
SIDAVET Ann verdoodt adres NR_TEL_HUIS V 23/02/1966 AALST 8000 SIDNALE
08/04/2006 - - 0
1 record(s) selected.
DDl TABLE TEMPPERS" (
"KRT_IND" CHAR(8) NOT NULL ,
"NM_IND" VARCHAR(50) NOT NULL ,
"AD_IND" VARCHAR(50) NOT NULL ,
"NR_TEL_HUIS" VARCHAR(15) ,
"GSL_IND" CHAR(10) NOT NULL ,
"DT_GBR" DATE NOT NULL ,
"PLA_GBR" VARCHAR(40) NOT NULL ,
"COD_PO" CHAR(4) NOT NULL ,
"ID_BRK_CRE_RE" CHAR(8) NOT NULL ,
"TMS_CRE_RE" DATE NOT NULL ,
"ID_BRK_WY_L_RE" CHAR(8) ,
"TMS_WY_L_RE" DATE ,
"NR_WY" INTEGER NOT NULL )
IN "USERSPACE1" ;
Dyn. SQL.
Rows Affected: 1
DB2Statement: SELECT KRT_IND, NM_IND, AD_IND, NR_TEL_HUIS, GSL_IND,
DT_GBR, PLA_GBR, COD_PO, ID_BRK_CRE_RE, TMS_CRE_RE, ID_BRK_WY_L_RE,
TMS_WY_L_RE, NR_WY FROM TEMPPERS WHERE KRT_IND = @KRT_IND
DB2Connection: Database=TEMPL;Server=xxxx;UID=xxx;
TableName: TEMPPERS
Parameter: @KRT_IND -- "SIDAVET"
Executed DB2Statement will look like: SELECT KRT_IND, NM_IND, AD_IND,
NR_TEL_HUIS, GSL_IND, DT_GBR, PLA_GBR, COD_PO, ID_BRK_CRE_RE, TMS_CRE_RE,
ID_BRK_WY_L_RE, TMS_WY_L_RE, NR_WY FROM TEMPPERS WHERE KRT_IND = 'SIDAVET'
Stored procedure
CREATE PROCEDURE USP_GetPerson( IN I_KRT_IND char(8) )
DYNAMIC RESULT SETS 1
LANGUAGE SQL
BEGIN
DECLARE c1 CURSOR WITH RETURN FOR
SELECT KRT_IND, NM_IND, AD_IND, NR_TEL_HUIS,
GSL_IND, DT_GBR, PLA_GBR, COD_PO, ID_BRK_CRE_RE,
TMS_CRE_RE, ID_BRK_WY_L_RE, TMS_WY_L_RE, NR_WY FROM
TEMPPERS WHERE KRT_IND = I_KRT_IND;
OPEN c1;
end
Error
- IBM.Data.DB2.DB2Exception {"ERROR [58005] [IBM][DB2.NET] SQL0902 An
unexpected exception has occurred in Process: 4952 Thread 16
InnerException Message: Year, Month, and Day parameters describe an
un-representable DateTime. Check InnerException property for more detail.
SQLSTATE=58005"}
****
This message and any attachment are confidential, intended solely for the use of the individual or entity to whom it is addressed and may be protected by professional secrecy or intellectual property rights.
If you have received it by mistake, or are not the named recipient(s), please immediately notify the sender and delete the message. You are hereby notified that any unauthorized use, copying or dissemination of any or all information contained in this message is prohibited.
Arcelor shall not be liable for the message if altered, falsified, or in case of error in the recipient.
This message does not constitute any right or commitment for Arcelor except when expressly agreed otherwise in writing in a separate agreement.
****
DB2 & UDB email list listserv db2-l LazyDBA home page