× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.