Skip to main content
Question

Oracle TO_DATE function into Where Clause

  • December 10, 2019
  • 1 reply
  • 425 views

philippeb
Enthusiast
Forum|alt.badge.img+18

Hello,

I have a table with millions of features. I need to use the Where Clause to extract what I want.

I'm using a Published Parameter to define a date. My problem is the date format into database (YYYY-MM-DD). And Data Inspector tells me it's encoded windows-1252, not string (don't know if it changes something).

I though to use into Where Clause the TO_DATE function to convert my dates. 

 TO_DATE('@Value(DATE_into_Database)''YYYYMMDD') => '$(DATE_FROM)'

But it's not working. I get an Unable to execute SQL statement. And I'm not even sure if it's supported by FME because this function isn't into the SQL Date Functions choices. I only have those (the help button sent me there) : SQL Date Functions 

Do you have an idea how I could extract those dates ?

1 reply

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • December 10, 2019

I believe the published parameter is a date in char form YYYYMMDD:HHMINSS

So the easiest way would be converting the database date to a char, like this (assuming the DATE_into_Database is an Oracle table attribute):

TO_CHAR(DATE_into_Database, 'YYYYMMDD') => '$(DATE_FROM)'

Hope this helps.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings