Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] Convert date time variable in data flow
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Convert date time variable in data flow
 Login/Join
 
Member
posted
I have a variable &myDate in A19V format that stored a date time value such as: "2015/10/29 07:00:00".

If using a DBMS SQL flow for Oracle database, I can read and format the variable like this:
SELECT ....
FROM ....
WHERE TIME_MODIFIED <= TO_DATE ['&myDate', 'YYYY/MM/DD HH24:MI:SS')

Using a regular data flow, I cannot use the function TO_DATE to format the variable. What function should I use in iWay dataflow to format the '&myDate' variable from A19V to datetime format HYYMDS?

Thanks for your suggestion.

This message has been edited. Last edited by: Tamra,


iWay Data Migrator v7704M
Windows, All Outputs
 
Posts: 23 | Registered: January 29, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Try using this SQL Function:
WHERE TIME_MODIFIED <= to_timestamp('&myDate', 'yyyy/mm/dd hh24:mi:ss')
  

"MAY" have to do it this way:
WHERE TIME_MODIFIED <= to_timestamp('&myDate.EVAL', 'yyyy/mm/dd hh24:mi:ss')
  

BTW
1. it is a left parenthesis ('&myDate' - NOT a left bracket ['&myDate'
2. &myDate is not A19V, it is a text string...


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1942 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Hi Tom,
Thanks a lot for your suggestion.

I receive the following when running:
(FOC14067) STATEMENT CONTAINS UNKNOWN SCALAR FUNCTION 'to_timestamp' ON LINE 28

Please note that my question is to be used in a regular flow not a DBMS SQL Flow.
In a DBMS Flow, I can use TO_DATE, TO_TIMESTAMP. However, I would like to use a regular flow.

About your reminder:
1. Somehow when copying the code to the forum, the left parenthesis is replaced by [
2. &myDate is stored in a flat file and has format A19V. It is passed into the flow using the "Get parameter using synonym".


iWay Data Migrator v7704M
Windows, All Outputs
 
Posts: 23 | Registered: January 29, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Hi David,
Have no idea the difference, don't know IWAY, just know WebFOCUS.

Try this then, with or without quotes:
  
WHERE TIME_MODIFIED <= DT(&myDate);


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1942 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Tom,
That doesn't work either. I received the same error:

(FOC14067) STATEMENT CONTAINS UNKNOWN SCALAR FUNCTION 'DT' ON LINE 28


iWay Data Migrator v7704M
Windows, All Outputs
 
Posts: 23 | Registered: January 29, 2014Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Hi David,
Can't guess anymore. Maybe someone else can assist.
Might post your code between the code tags on the toolbar </>
Tom


Tom Flynn
WebFOCUS 7.7.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1942 | Location: Parker, CO | Registered: January 31, 2006Reply With QuoteReport This Post
Member
posted Hide Post
I had same type of issue but in different way. But this solution worked for me I just made the &val/HYYMDS. And then the rest. May this would be help ful. Let us know whether it worked or not for you.


Webfocus 8104
Windows 7
 
Posts: 5 | Registered: September 16, 2015Reply With QuoteReport This Post
Guru
posted Hide Post
In the current production release 7.7.06 there are at least three other ways to convert a character string to a timestamp.

In a Source Transformation (FOCUS DEFINE) us the FOCUS function:
TS/HYYMDS=HINPUT( 19, '&MYDATE', 8, 'HYYMDS' )  

In a Source Transformation or SELECT statement invoke the ORACLE database function:
DB_EXPR(to_timestamp('&MYDATE', 'yyyy/mm/dd hh24:mi:ss'))

In a SELECT statement use the simplified function:
TIMESTAMP('&MYDATE' )

This does beg the question as to why are you still using 7.7.04? It was first release 3 1/2 years ago in April 2012 and it's scheduled to functionally stabilized at the end of December 2015. That's next month.

One way to do this in older releases (albeit with restrictions on non APT queries) is to use SQL. which is the less functional predecessor of DB_EXPR to call a database function:
SQL.TO_DATE('&MYDATE' , 'YYYY/MM/DD HH24:MI:SS' )   
 
Posts: 380 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Tom, Kmvgt and Clif,
Thanks a lot for your suggestion.

I've try all of your suggestions in a regular data flow but it still doesn't work. As a workaround, I use a DBMS SQL Flow for now .

We are waiting on management decision to upgrade to new iWay version.

Thanks again for your help.


iWay Data Migrator v7704M
Windows, All Outputs
 
Posts: 23 | Registered: January 29, 2014Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] Convert date time variable in data flow

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.