cancel
Showing results for 
Search instead for 
Did you mean: 

how to use todate function in JDBC adapter

Former Member
0 Kudos

Hi All,

How can we use the todate function to update a date field in Oracle database. I am getting a

java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric was expected

Exception, when I am mapping the date fields with to_date('03/28/2009 18/43/19','MM/DD/YYYY HH24/MI/SS').

Thanks,

Yomesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Make sure that you use the attribute hasQuot with value as No.

Regards.

Liang

Former Member
0 Kudos

Hi Can you explain a bit more on attribit hasquote ? where to use it. Is a document I can refer to

Former Member
0 Kudos

The following is standard SAP document regarding this attribute, this attribute used to compose your SQL clause for string or non-string, for string, you need to put the "YES". in your case, you need to set set the value "NO"

so create an attribute, pass a constant value "NO" to it, that is it.

hasQuot= YES|NO During construction of the WHERE condition of the SQL statement, the table column type determines whether the default is to set the values in quotation marks (text column types) or not (numerical column types). In a few cases (for example, when using functions), it may be necessary to override this. This attribute enables you to do this. If YES, quotation marks are always set round the values for which this attribute is set in the SQL syntax. If NO, quotation marks are never set. Only use this attribute in individual cases.

Regards.

Liang

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

did you try with my last post??

about the post about Quotes, yin refer to the value assign in dateTrans funtion. same as I

thanks

Former Member
0 Kudos

Hi,

Refer SAP Notes: 831162.

In that point no 3. Date Field Handling will provide you the solution of this problem.

Thanks

Swarup

Former Member
0 Kudos

Hi Guys,

Thanks for your help. Adding the attribut solved the problem. Thanks.

Yomesh

Answers (1)

Answers (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

hi,,

which is the format you are specting the date in DB.

as i can see if you send ('03/28/2009 18/43/19','MM/DD/YYYY HH24/MI/SS'). surely you have to send the date with the next format in PI ddMMyyyy HHmmss.

try that

thanks.

Former Member
0 Kudos

Hey Alejandro,

Yes I tried your suggestion. That was failing and giving SQL exception. Adding the attribute solved the problem.

Thanks for your inputs..