473,467 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DB2 V8.1 does not accept the adDBTimeStamp data type

When our application tries to send a parameter of the type adDBTimeStamp to
DB2 we an error message saying

SQLSTATE 22007 An invalid datetime format was detected; that is, an invalid
string representation or value was specified.

We get this message after upgradeing to DB2 Enterprise Edition V8.1 fixpack
6. On db2 version 7.2 it worked fine.

--
Regards
-----------
Odd Bjørn Andersen

ErgoSolutions AS
Postboks 4364 Nydalen, 0402 Oslo
Telefon 23 14 50 00, Telefaks 23 14 50 01
Direkte tlf.nr. 23 14 46 73, Mobilnr 970 84597
www.ergogroup.no
Nov 12 '05 #1
3 5083
Odd Bjørn Andersen wrote:
When our application tries to send a parameter of the type adDBTimeStamp to
DB2 we an error message saying

SQLSTATE 22007 An invalid datetime format was detected; that is, an invalid
string representation or value was specified.

We get this message after upgradeing to DB2 Enterprise Edition V8.1 fixpack
6. On db2 version 7.2 it worked fine.


Please post an example of string used and code demonstrating this problem. A
very short VB program inserting a timestamp value to a table defined with one
column f type timestamp would be sufficient.

Jan M. Nelken
Nov 12 '05 #2

"Jan M. Nelken" <Un**********@Invalid.Domain> wrote in message
news:41**************@Invalid.Domain...
Odd Bjørn Andersen wrote:
When our application tries to send a parameter of the type adDBTimeStamp to DB2 we an error message saying

SQLSTATE 22007 An invalid datetime format was detected; that is, an invalid string representation or value was specified.

We get this message after upgradeing to DB2 Enterprise Edition V8.1 fixpack 6. On db2 version 7.2 it worked fine.

Please post an example of string used and code demonstrating this problem.

A very short VB program inserting a timestamp value to a table defined with one column f type timestamp would be sufficient.

Jan M. Nelken


This is out VB program where the error occurs. As you can see it first sets
the parameter, and then executes a stored procedure. I have also included
the declarations for the stored procedure.
We don't want to make any changes to the code since this is working fine in
V7 of DB2. And I cannot see why an upgrade of DB2 should trigger a rewrite
of code. Is there anything else we should be aware of and which have changed
since V7, for instance setting of environment variables or settings in the
db2cli.ini file ?

THE VB CODE:

public function ........ ()

On Error GoTo errorhandling:

Dim rs As ADODB.Recordset

Dim cmd As Command

Dim param As ADODB.Parameter

Dim RetVal As Date
Set cmd = New ADODB.Command

cmd.ActiveConnection = mConn

cmd.CommandText = vardb + "HentServerTid"

cmd.CommandType = adCmdStoredProc
--> Set param = cmd.CreateParameter("tid", adDBTimeStamp, adParamOutput)

cmd.Parameters.Append param
Set cmd.ActiveConnection = mConn

--> Set rs = cmd.Execute
RetVal = CDate(cmd("tid"))
FinnDatoTid = RetVal

Set rs = Nothing

Exit Function

And this the declaration for the stored procedure:

#include <memory.h> /* for memcpy() */

#include <string.h>

#include <sqlenv.h>

#include <sql.h>

#include <sqlda.h>

#include <stdio.h>

SQL_API_RC SQL_API_FN HentServerTid(

void *reserved1,

void *reserved2,

struct sqlda *inout_sqlda,

struct sqlca *ca)

{

/* Declare Host Variables */

EXEC SQL BEGIN DECLARE SECTION;

--> char tid[27] = {'\0'};

EXEC SQL END DECLARE SECTION;

/* Declare a local SQLCA */

EXEC SQL INCLUDE SQLCA;

EXEC SQL WHENEVER SQLWARNING CONTINUE;

EXEC SQL WHENEVER SQLERROR GOTO error_exit;

short length;

....

--
Regards
-----------
Odd Bjørn Andersen

ErgoSolutions AS
Postboks 4364 Nydalen, 0402 Oslo
Telefon 23 14 50 00, Telefaks 23 14 50 01
Direkte tlf.nr. 23 14 46 73, Mobilnr 970 84597
www.ergogroup.no
Nov 12 '05 #3
Odd Bjørn Andersen wrote:
This is out VB program where the error occurs. As you can see it first sets
the parameter, and then executes a stored procedure. I have also included
the declarations for the stored procedure.
We don't want to make any changes to the code since this is working fine in
V7 of DB2. And I cannot see why an upgrade of DB2 should trigger a rewrite
of code. Is there anything else we should be aware of and which have changed
since V7, for instance setting of environment variables or settings in the
db2cli.ini file ?


I am guessing from posted fragments that stored procedure RETURNs a timestamp
value from DB2.

Here is simple test:

Create a test stored procedure GetTS() from command line like this:

db2 create procedure GetTS(OUT ts timestamp) language SQL begin values current
timestamp into ts end

You can test it from command line like this:

db2 call GetTS(?)
Now prepare VB program calling this stored procedure and test it.
Jan M. Nelken
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Fred Pacquier | last post by:
First off, sorry for this message-in-a-bottle-like post... I haven't been able to phrase my questions well enough to get a meaningful answer from Google in my research. OTOH, it is standard...
4
by: Brian Glen Palicia | last post by:
My goal is to accept input from the user into a text box and then parse the data using split(). The first step is this tiny program to test the split() function. It runs in IE, but in Mozilla it...
8
by: Rose Chambers | last post by:
How can I insert preformatted text from a file on the web server into a table's cell? And then swapped the text in response to an onClick event. Something like this......... <table>...
2
by: PengYu.UT | last post by:
I'm wondering whether the operator can accept more than 1 arguments Suppose I have a object which is essentially a 2 dimensional array, I want to use operator to access the data. I don't what...
13
by: ranjeet.gupta | last post by:
Dear All What does exactly below code means struct File { void* data; }; typedef struct File File; typedef File* fl;
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
17
by: Michael Reichenbach | last post by:
Here is the example code. int main(int argc, char *argv) { string Result; WIN32_FIND_DATA daten; HANDLE h = FindFirstFile(TEXT("c://test"), &daten); system("PAUSE"); return EXIT_SUCCESS; }
13
by: 7stud | last post by:
I have the following two identical clients #test1.py:----------- import socket s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = 'localhost' port = 5052 #server port
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.