Interesting, I whipped up a test program and it didn't like that I was assigning %date to a timestamp field.
D testDate S z
testDate = %date;
RNF7416: The types of the right and left hand side do not match in the EVAL operation.
I figured that should have emulated what you were doing.
Oh well, sorry I don't have an answer for you.
-Kurt
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: Friday, April 12, 2013 8:57 AM
To: 'RPG programming on the IBM i (AS/400 and iSeries)'
Subject: RE: jdbc_setTimeStamp issue
I do have isotimestmp defined as a timestamp and it looks like a a legit timestamp when I view it.
D isotimestmp s Z
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Anderson, Kurt
Sent: Friday, April 12, 2013 9:46 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: jdbc_setTimeStamp issue
Is it because you're passing a Date data type as the 3rd parm to JDBC_SetTimeStamp while in the example that works you're passing a Timestamp data type? Your "date" field reads as IsoTimeStmp, but you're assigning a date to it, and according to the compiler I'm on at 7.1, it does not allow assigning a Date value to a Timestamp field.
You could try:
isoTimeStmp = %timestamp(%char( %date(smcpd:*ISO)) + '-00.00.00.000000';
I'm not quite sure offhand, but the %char/%date may be redundant. So you could try isoTimeStmp = %timestamp(smcpd + '-00.00.00.000000';
-Kurt
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Smith, Mike
Sent: Friday, April 12, 2013 8:38 AM
To: RPG programming on the IBM i / System i (rpg400-l@xxxxxxxxxxxx)
Subject: jdbc_setTimeStamp issue
We are updating a file in SQL Server that has a Date/Time Field.
We really aren't interested in the Time portion of the field, so I have been only loading the date into the time stamp
When I run
isotimestmp = %date(smcpd:*ISO) ;
JDBC_SetTimeStamp(stmt:1:isotimestmp);
rc = JDBC_ExecPrepUpd(stmt);
I check RC and it is 3, which is the number of records that should be updated.
However when I check the table in SQL Server, the records have not been updated.
If I do
JDBC_SetTimeStamp(stmt:1:%timestamp);
Rc=JDBC_ExecPrepUpd(stmt);
I check RC and it is 3 and the records have been updated with the current time stamp.
Any idea what is going on?
FWIW we are looking at changing the SQL Server field to be a Date field, but I would like to understand what is happening anyway.
Mike
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.