DB2 - Problembeschreibung
Problem IC62393 | Status: Geschlossen |
.NET STORED PROCEDURES AND UDF'S WITH DATE TYPE INPUT PARAMETER CAUSE SQL04302N IN DATE TYPE AS TIMESTAMP(0) MODE | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
Platform: Windows The Oracle Compatibility Feature DATE data type as Timestamp(0) is enabled (DB2_COMPATIBILITY_VECTOR=ORA or 040) and a .NET StoredProcedure or UDF with a DATE data type input parameter is invoked. You receive a SQL04302N error with the token "String was not recognized as a valid DateTime". Example procedure definition: CREATE PROCEDURE test.clrdate ( IN in1_DT DATE ) NOT DETERMINISTIC NULL CALL OLD SAVEPOINT LEVEL EXECUTION CONTROL FILEWRITE LANGUAGE CLR EXTERNAL NAME 'testdate.dll:test.date!testdateclr' FENCED EXTERNAL ACTION INHERIT SPECIAL REGISTERS PARAMETER STYLE SIMPLE CALL WITH NULLS NO DBINFO@ Example Call: db2 call test.clrdate('1761-09-14 03:09:29.0') SQL04302N Exception "String was not recognized as a valid DateTime" The db2diag.log contains the following entries: 2009-07-15-11.17.36.421000+540 I1511441F525 LEVEL: Error PID : 2544 TID : 2444 PROC : db2fmp64.exe INSTANCE: DB2 NODE : 000 EDUID : 2444 FUNCTION: DB2 UDB, DB2 .NET Routine Infrastructure, sqlecMethodManager.InvokeMet hod, probe:10 MESSAGE : Class test.date, function testdateclr, parameter 0 caused exception String was not recognized as a valid DateTime. DATA #1 : Hexdump, 4 bytes 0x00000000061A7648 : 0701 0000 .... 2009-07-15-11.17.36.421000+540 I1511968F787 LEVEL: Error PID : 2544 TID : 2444 PROC : db2fmp64.exe INSTANCE: DB2 NODE : 000 EDUID : 2444 FUNCTION: DB2 UDB, DB2 .NET Routine Infrastructure, sqlecRoutineLoaderClass.sqle cRunDotNetRo, probe:10 DATA #1 : String, 360 bytes System.FormatException: String was not recognized as a valid DateTime. at IBM.Data.DB2.Routine.sqlecMethodManager.InvokeMethod() at IBM.Data.DB2.Routine.sqlecRoutineLoaderClass.sqlecRunDotNetRouti ne(IntPtr ufob, IntPtr pSqlca, IntPtr nativeThreadID, IntPtr invokerSQLSTATE, IntPtr invok erMessage, IntPtr scratchpad, IntPtr dbinfo, IntPtr processReturn) DATA #2 : Hexdump, 4 bytes 0x00000000061A57D8 : 32EF FFFF 2... | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * DB2 LUW on Windows with .NET routines using DATE as * * Timestamp(0) as input parameter * **************************************************************** * PROBLEM DESCRIPTION: * * A SQL04302N error with the token "String was not recognized * * as a valid DateTime" is returned when invoking a LANGUAGE * * CLR Stored Procedure or UDF which has been cataloged with an * * input parameter whose data type is DATE. * * * * Example procedure definition: * * CREATE PROCEDURE test.clrdate * * ( * * IN in1_DT DATE * * ) * * NOT DETERMINISTIC * * NULL CALL * * OLD SAVEPOINT LEVEL * * EXECUTION CONTROL FILEWRITE * * LANGUAGE CLR * * EXTERNAL NAME 'testdate.dll:test.date!testdateclr' * * FENCED * * EXTERNAL ACTION * * INHERIT SPECIAL REGISTERS * * PARAMETER STYLE SIMPLE CALL WITH NULLS * * NO DBINFO@ * * * * Example Call: * * db2 call test.clrdate('1761-09-14 03:09:29.0') * * SQL04302N Exception "String was not recognized as a valid * * * * DateTime" * * * * The db2diag.log contains the following entries: * * 2009-07-15-11.17.36.421000+540 I1511441F525 LEVEL: Error * * PID : 2544 TID : 2444 PROC : * * db2fmp64.exe * * INSTANCE: DB2 NODE : 000 * * EDUID : 2444 * * FUNCTION: DB2 UDB, DB2 .NET Routine Infrastructure, * * sqlecMethodManager.InvokeMet * * hod, probe:10 * * MESSAGE : Class test.date, function testdateclr, parameter 0 * * * * caused exception * * String was not recognized as a valid DateTime. * * DATA #1 : Hexdump, 4 bytes * * 0x00000000061A7648 : 0701 0000 * * .... * * * * 2009-07-15-11.17.36.421000+540 I1511968F787 LEVEL: Error * * PID : 2544 TID : 2444 PROC : * * db2fmp64.exe * * INSTANCE: DB2 NODE : 000 * * EDUID : 2444 * * FUNCTION: DB2 UDB, DB2 .NET Routine Infrastructure, * * sqlecRoutineLoaderClass.sqle * * cRunDotNetRo, probe:10 * * DATA #1 : String, 360 bytes * * System.FormatException: String was not recognized as a valid * * * * DateTime. * * at IBM.Data.DB2.Routine.sqlecMethodManager.InvokeMethod() * * at * * IBM.Data.DB2.Routine.sqlecRoutineLoaderClass.sqlecRunDotNetRou * ne(IntPtr * * ufob, IntPtr pSqlca, IntPtr nativeThreadID, IntPtr * * invokerSQLSTATE, IntPtr invok * * erMessage, IntPtr scratchpad, IntPtr dbinfo, IntPtr * * processReturn) * * DATA #2 : Hexdump, 4 bytes * * 0x00000000061A57D8 : 32EF FFFF * * 2... * **************************************************************** * RECOMMENDATION: * * Install V97 fp1 * **************************************************************** | |
Local-Fix: | |
Change the type of the input parameter in the procedure definition from DATE to TIMESTAMP(0). | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 1 for Linux, UNIX, and Windows | |
Lösung | |
Fixpack 1 for DB2 V9.7 includes the fix for this issue. When invoking a LANGUAGE CLR Stored Procedure or UDF with an input parameter of data type DATE the procedure will execute successfully. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 05.08.2009 29.12.2009 29.12.2009 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7., 9.7.FP1 | |
Problem behoben lt. FixList in der Version | |
9.7.0.1 |