Tomáš Filip
Tomáš Filip

Reputation: 817

Additional information: ORA-00917: missing comma

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

Answers (3)

Tomáš Filip
Tomáš Filip

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

Tim Biegeleisen
Tim Biegeleisen

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

Rahul
Rahul

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

Related Questions