Reputation: 817
I am kinda lost, I dont know what to try next.
com.CommandText =@"insert into TDESADV_H_T (spplr_mailbox,message_id,asn_no,TO_DATE('message_date', 'YYYY/MM/DD HH24:MI'))"
+ " VALUES(:spplr_mailbox,:message_id,:asn_no,:message_date)";
It is definetly on the message date. The query recieves:
com.Parameters.AddWithValue("message_date", edi.MESSAGE_SEND_DATE);
which is: 2017/10/23 18:01. I am not sure what is wrong
Upvotes: 0
Views: 150
Reputation: 817
As @LasseVågsætherKarlsen navigated me. I was trying to use TO_DATE for column name. All I had to do was to use the function in values (). Thanks a lot guys.
Upvotes: 0
Reputation: 522571
Your SQL syntax is off, and the insert should look something like this:
INSERT INTO TDESADV_H_T (spplr_mailbox, message_id, asn_no, message_date)
VALUES (:spplr_mailbox, :message_id, :asn_no, :message_date);
Regarding your call to TO_DATE
, if that happens at all, it should be when you bind the parameter in your C# code. You should ideally be able to bind a C# type which the API can automatically marshall over to the message_date
column, so that call to TO_DATE
might not even be needed.
Upvotes: 2
Reputation: 77926
TO_DATE('message_date', 'YYYY/MM/DD HH24:MI')
in INSERT
statement should be a column name rather. That's what it's complaining about
Upvotes: 2