Hello,
I am reading my oracle non spatial database with an SQL query containing couple of dates.When inputting the dates directly in the query,there is no problem and it runs smoothly.
I would like to make user parameters from these dates.So I have created published user parameters choosing 'date' as type.
I then try to use the parameter in my SQL query (where clause) but I get a type error over and over.I have tried couple of different notations but it doesn't seem to work...
This works (without parameters)
AUTO_START_DATE <= TO_DATE('15/12/2019','DD/MM/YYYY')
Then I tried several variation to use :
$(START_DATE)
but I can't seem to find the right syntax.
Thank you
I am trying to convert a three character month to a two digit month (e.g.- Mar to 03) using FME 2016.1 (build 16492).Should be easy enough using the DateFormatter but the converted value returned is always 01.I think my parameters are set up correctly.Screenshot attached.Any ideas?
Thanks,
Aaron
I am using a FeatureReader to connect to our SDE GDB.I want to add a query (WHERE Clause) to the FeatureReader so that I am only pulling in records within the Feature Class that were edited within the last month (or sometimes edited in the last 5 days).
When I look at the SDE data via MS SQL Server Management Studio (SSMS) vs within FME's Data Inspector I see the data in different formats:
Within SSMS - LAST_UPDATED field is a DATE field:
last_updated (datetime2(7),null)
2018-12-01 16:23:56.0000000
Within Data Inspector - LAST_UPDATED field is STRING field:
last_updated (string)
20181128133118
My questions:
1) is there a way to specify which attributes I want to be brought in?Right now I am using an attribute manager to remove the unwanted attributes.
2) How do I only at a WHERE Clause so that I only pull in the data I want within the specific time range?I have tried"last_updated" > '20180500000000'but this brings in nothing.I am assuming this is because FME is treating the field as a string?If this is true,then...
3) How do I get FME to see this field as a date field while using the FeatureReader?
4) Once I am able to work with this data as a date,how do I do a WHERE Clause so that I only pull data that has been edited within the last 5 days?I will be running this query everyday,so I want the query to be something likelast_updated >= dateadd(DAY,-5,GETDATE())
I am using FME(R) 2018.1.0.2 (20180903 - Build 18547 - WIN64)
Also tried a WHERE Clause of@DateTimeCast("last_updated",datetime) > '20181201000000'but get the following error:
The error number from ArcObjects is: '-2147216072'.The error message from ArcObjects is: {Underlying DBMS error [[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near '>'
Has anyone got a workaround for updating a hosted feature layer without effecting the edit date?I have had multiple editors updating many hosted layers for over a year.I now need to change some attributes on a large scale (+30k records).
Mick
I have two string fields (TimeStartedCTZone,TimeEndedCTZone) formatted as shown below.How can I calculate the difference in Hours despite having strings as inputs instead of datetime data types?
Hi,
I thought I'd solved this issue with a spreadsheet reader however I appear to be experiencing the same thing with a CSV reader.Whenever a record with a null date field hits the writer it will have the error "attribute could not be written.The containing feature has been dropped." - but I still require that record.With the spreadsheet reader once the spreadsheet date fields were cleaned up so they only had either a date or a null value (the cell contents were cleared in excel) it worked fine.I would've thought that a CSV reader would have less difficulty.
Is there a transformer/parameter out there that remedies this issue?
Any ideas FMEers?
Cheers,
Mike
I'm reading in data from multiple XML files,all of which have the same date attributes (xml_char in the XML Reader).However the dates are not all the same format - some are 2018-06-22 and some are 22/06/2018.I want to write the dates to date fields in a File Geodatabase.
I can have 2 DateTimeConverters (one for one date format and one for the other) based on whether the date attribute contains - or / and use a Tester or TestFilter to send the features to the appropriate converter.But is there a better way?
I'm wary of using "Auto detect" in the DateTimeConverter - people have previously said it's better to specify a specific Input Format.
Hey guys,
I have a dynamic feature reader that reads and SDE database,one of the fields is a date time field called UFI_CREATED
When i use a standard SDE reader this works fine on the dynamic writer.But when I use the feature reader,it appears that its sending the full attribute into UFI_CREATED.full and date attribute called UFI_CREATED.When I try and write this I get an error saying that
A feature,of feature type 'PROPERTY',had an invalid time component for its time/datetime attribute 'UFI_CREATED'.
This is because its expecting the .full attribute but dynamically its getting the shortened one.
I could change all the attributes that I think might be affected manually back to non full,but this defeats the purpose.
Why is it mapping it like this?And is there any way I can prevent this from happening.
Regards,
James
Hi,
Previously when passing attributes names 'today','1 week ago' etc ot the dateformatter it could work out the date.现在这是失败的。
Have I missed something?
Thanks
I have the following datetime format built from python datetime like bellow.
datetime.datetime.today()2018-04-29 12:20:36.975031
Im reading a csv dataset and trying to load it to an elasticsearch writer setting the writer field with the pythondate to a datatype 'date' but it always fail with following error
2018-04-30 16:35:25| 2.0| 0.0|ERROR |ELASTICSEARCH writer: {"took":0,"errors":true,"items":[{"index":{"_index":"imob","_type":"imov","_id":"pzIxF2MB3029rqSru8Tt","status":400,"error":{"type":"mapper_parsing_exception","reason":"failed to parse [date]","caused_by":{"type":"illegal_field_value_exception","reason":"Cannot parse \"0000/00/00 00:00:00.000\": Value 0 for monthOfYear must be in the range [1,12]"}}}}]}
Seems odd cause the date beeing sent is beeing checked with a logger just before the ES writer and the value is
2018-04-30 16:40:42| 1.7| 0.0|INFORM|Attribute(string) : `date' has value `2018-04-29 12:20:36.975031'
So how is it beeing converted to \"0000/00/00 00:00:00.000\" as the ES 400 code replys back ?
Also tried to convert this format any other formats but it looks like FME does not recognizes the python created format .
Anyone dribbled similar topic before ?
Regards
Hi all,
Just taking my first steps with FME.I am using the FTPCaller to download two .zip files that are provided on a weekly basis.When I specify an existing folder everything works fine.However,I'd actually like to download the .zips to a folder whose name is actually the date on which the download took place.However,when I try and incorporate this into the FTPCaller's 'Target File' path (e.g.C:\Downloads\@DateTimeFormat(@DateTimeNow(),%Y_%m_%d)\@filename) the translation fails as the file is unable to be written.
If the FTPCaller is unable to create a destination folder on the fly,how would I go about creating the folder?
Any suggestions appreciated!
Thanks!!
I have many entities with DATE attributes.
When I have no value,I set them to null (NullAttributeMapper).
But DateTimeConverter generates a WARN for each null value and rejects entities,so the logfile is very big and its very slow.
I would like a parameter to ignore null values in DATE attributes (don't log them) and maybe a new output port for null values in DateTimeConverter.
Hi,I have a bunch of data in SQL with date stamps and I have had a request to convert the data into our 4 weekly cycles.eg.any dates from 7th Jan to 13th Jan 2017 are a week 1,from 14th Jan to 20th Jan 2017 are Week2 ...Week 3,Week 4 and then 4th Feb to 10th Feb being Week 1 again ongoing.The data continues to be added to and they want me to be able to continue to run this workspace into the future and keep working out on the new data which week is it falling into.Any thoughts
Add support for an FME date calculation function (either as a datetime function or within a transformer such as DateTimeCalculator) that works on a 5-day week or 'business days' system.Excel has aNETWORKDAYS functionthat takes a start date,end date,and holidays input to do this kind of calculation.