lastvalue replace variables workbench 5
I am trying to get our table to append new info everyday instead of replacing our tables every day. when I try to use the lastvalue in workbench 5 I am getting the same error:
[11.14.19 2:12:27 PM] One or more errors occurred.
ERROR [HY000] [Oracle][ODBC][Ora]ORA-01858: a non-numeric character was found where a numeric was expected
I ran the query:
SELECT DISTINCT
A.*
FROM
WH_ACCTDEPOSIT A
ORDER BY A.EFFDATE
and then I ran it to append:
SELECT DISTINCT
A.*
FROM
WH_ACCTDEPOSIT A
WHERE
A.EFFDATE>'!{LASTVALUE:EFFDATE}!'
ORDER BY A.EFFDATE
I have tried every way to enter that date Value that I can think of and I also tried to make a custom date format transform but I have gotten the same error every time. I have tried to follow the following link for details but I must be missing something:
Best Answer
-
I was able to get it to work, I had two problems.
first !{lastvalue:}! is case sensitive it needed to be lower case.
second I had to format the date TO_DATE('!{lastvalue:EFFDATE}!', 'YYYY/MM/DD')
so the final product looked like:
SELECT DISTINCT
A.*FROM
WH_ACCTDEPOSIT AWHERE
A.EFFDATE > TO_DATE('!{lastvalue:EFFDATE}!', 'YYYY/MM/DD')
ORDER BYA.EFFDATE
on the Replacement Variables tab the Column name was EFFDATE and the Vaue was 11/30/2019 12:00:00 AM
1
Answers
-
I'm not super familiar with setting this up in Workbench, but it appears that the LAST_VALUE syntax in oracle would require some kind of a window
I'm not sure how to define the window in workbench, but I would assume your issue is with the last value function in your where clause
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
I was able to get it to work, I had two problems.
first !{lastvalue:}! is case sensitive it needed to be lower case.
second I had to format the date TO_DATE('!{lastvalue:EFFDATE}!', 'YYYY/MM/DD')
so the final product looked like:
SELECT DISTINCT
A.*FROM
WH_ACCTDEPOSIT AWHERE
A.EFFDATE > TO_DATE('!{lastvalue:EFFDATE}!', 'YYYY/MM/DD')
ORDER BYA.EFFDATE
on the Replacement Variables tab the Column name was EFFDATE and the Vaue was 11/30/2019 12:00:00 AM
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive