473,770 Members | 3,983 Online
Bytes | Software Development & Data Engineering Community
+ 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 5110
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**********@I nvalid.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.ActiveConne ction = mConn

cmd.CommandText = vardb + "HentServer Tid"

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

cmd.Parameters. Append param
Set cmd.ActiveConne ction = 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
2319
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 flattery (but true) that this group has a bunch of the nicest and most knowledgeable Usenet people around, and I know for a fact that there are some pretty good spam- related tools written in Python, so I thought I might get away with it :-) Yes,...
4
3607
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 just hangs and keeps loading forever. I checked around on the web and in USENET, but I haven't seen any mention of split() not working in Mozilla. Thoughts? Thanks in advance. <HTML> <HEAD> </HEAD>
8
1467
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> <tr><td> <img name="swap_grph" src="http://www.mydomain.com/graphs/piechart1.jpg"> </tr></td><tr><td>
2
5894
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 to use to return a 1 dimentional array and use another to access the data in this 1 dimentional array. Is it possible to accept 2 arguments? Thanks,
13
2195
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
4863
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 can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
17
4104
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
3930
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
0
9591
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10002
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9869
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3970
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 we have to send another system
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.