Date insert problem

Hi,

I am trying to insert data in the format of yyyy-MM-dd HH:mm:ss into SQL Server 2000. If I am running the adapter service directly, it is inserting the date. On sql server field is defined as timestamp.

But in the flow if I am trying to insert, it is giving me an exception :

Cannot set data for the input field “CHECK_DATE”
Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff

I tested by trimming the field after conversion also, but still not working. Can anyone please help me.

Thanks & Regards,
Srivats

Srivats,

If AS directly works then your flow service also should behave same.
So are using dateTimeFormat service for doing date conversion in the
newPattern field(yyyy-MM-dd HH:mm:ss)?And then mapping the output to the CHECK_DATE JDBC AS input field.

If so the above format should work fine

Still problem persits,then please try to elaborate on your flowsteps before invoking the AS.

HTH,
RMG.

Hi RMG,

I am using dateTimeFormat to convert into yyyy-MM-dd HH:mm:ss format. I have made the input field type as string for check_date in AS. I tried it as java.sql.timestamp . But still it not working.

It is a simple flowstep, convert date from yyyy-MM-dd using pub.date.dateTimeFormat (as transformer in map) to yyyy-MM-dd HH:mm:ss. Then pass that variable to AS for insert.

Thanks & Regards,
Srivats

Srivats,

Its weired behaviour then…
If you set input JDBC field type as java.lang.string for check_date in AS,then this should insert to DB when you map the conversion value from FS to AS input.

Sorry still wondering where could be the reason for error.

please also make sure the transformer output result is showing as expected.i think you have checked the pipeline results.

Regards,

Hi RMG,

I figured out my problem. I had an empty strings in my check_date fields so they are not getting inserted. I converted them to null objects and it is working fine. Thanks for your help.

Thanks & Regards,
Srivats

Srivats,

So Just you always need to check the flow pipeline results and step thru it,then you will find the hole,these mistakes happens.

Anyways its closed.

Regards,

I have the same problem and am not seeing how Srivats solved it? I have an AS with an input field, pos_created_date, and the field type is java.lang.String. I’ve tried running just the AS by itself, and giving the input ‘06/30/2005’. I tried running it both WITH ‘Include empty values for String Types’ and WITHOUT.

I get the same error:

com.wm.app.b2b.server.ServiceException: [ART.117.4002] Adapter Runtime (Adapter Service): Unable to invoke adapter service PositivePay.database:updateChecks.
[ADA.1.314] Cannot set data for the input field “pos_created_date”

I’m positive it is not an empty string, since I’m specifying the input directly to the AS.

please help! thanks.

Luke,

Will your DB accepts the date format ‘06/30/2005’.since u are testing by running AS directing the data should insert fine…

Regards,

we’re actually running an update, and I’ve run this on the database with no problem…

update positive_pays set pos_created_date = ‘07/01/2005’ where pos_program = ‘2’ and pos_check = ‘05006’

the date goes in fine. the JDBC AS has…

on the ‘Table’ tab,
positive_pays
on the ‘UPDATE’ tab,
pos_created_date date DATE ?
pos_created_date date DATE pos_created_date java.lang.String
on the ‘WHERE’ tab,
pos_program = ?
pos_check = ?
VARCHAR java.lang.String program
VARCHAR java.lang.String check_no

and when I run the service, I supply these inputs:

program: 2
check_no: 05006
pos_created_date: 07/01/2005

and get the above message.

any ideas?

Luke,

Thanks for more clarification.

As a test can you change the Date datatype to TIMESTAMP in the DB and then refresh the AS to update with new datatype and use the same field input type as java.lang.string.

HTH,
RMG

we’re connecting to an Informix database, which has no timestamp column that I can find. I did change the column to be of type date-time (Year to Day precision).

got the same error.

fixed.

when I changed the column to a timestamp, I didn’t drop it from the ‘UPDATE’ tab in the JDBC AS. later, I dropped it, then re-added it, and the column type correctly displayed as the new column type. running the service after that successfully updated.

thanks RMG!

Great…

Actually that is what i mentioned in my earlier post that to refresh the AS values when anything changed on the DB side especially new columns/datatypes etc…

HTH,
RMG