Skip to Content
1

HANA Cloud Integration OData Query

Oct 12, 2016 at 05:28 PM

203

avatar image

Hi

I'm building an interface in HCI using the OData adapter. I've created a filter condition in the Query builder that compares 2 dates (I realise that if it worked no records will be selected, but humour me!), but I keep getting an error 'wrong literal format for literal:'.

See attached screenshots.

It's probably something simple. So please put me out of my misery!

Thanks

Jonathan

log.png (8.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Best Answer
Navdeep Singh Oct 13, 2016 at 09:35 PM
0

Hi Jonathan,

The value in the 'lastModifiedWithTZ' is it in the same format as your property currentDateTime.

I think you have an expression in currentDateTime as yyyy-MM-dd'T'HH:mm:ss'Z' , try changing it to yyyy-MM-dd'T'HH:mm:ssZ

-Navdeep

Share
10 |10000 characters needed characters left characters exceeded
Navdeep Singh Oct 13, 2016 at 05:28 AM
0

Hi Jonathan,

Can you put a screenshot of the filter condition, and what is the expression in 'lastModifiedWithTZ'

-Navdeep

Share
10 |10000 characters needed characters left characters exceeded
Jonathan Griffiths Oct 13, 2016 at 02:32 PM
0

Hi Navdeep

Thanks for getting back to me. This is my OData query.

User?$select=cellPhone,city,country,dateOfBirth,division,email,firstName,gender,hireDate,lastModified,lastName,location,nationality,userId&$filter=lastModifiedWithTZ > datetime'${property.currentDateTime}'

'lastModifiedWithTZ' is a field from the entity User.

Cheers

Jonathan


query.png (21.3 kB)
Share
10 |10000 characters needed characters left characters exceeded
Jonathan Griffiths Oct 14, 2016 at 01:56 PM
0

Hi Navdeep

I still get the error message, but I think your on the right track. The two values I'm comparing are in different formats. Do you know where I can find a list of all the valid datetime formats?

Thanks

Jonathan

Share
10 |10000 characters needed characters left characters exceeded
Navdeep Singh Oct 16, 2016 at 06:37 AM
0

Hi Jonathan,

The valid date formats that you can use are as permitted by java.text.SimpleDataFormat (examples : https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html)

You need to check the date format returned from the Odata service and use the same format in your properties expression

Cheers,

Navdeep

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Navdeep

That's great, thanks a lot for your help.

Cheers

Jonathan

0