Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


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

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[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, 2014Report This Post
Expert
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 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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, 2014Report This Post
Expert
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 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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, 2014Report This Post
Expert
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 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report 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, 2015Report 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' )   


N/A
 
Posts: 397 | Location: New York City | Registered: May 03, 2007Report 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, 2014Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

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-2020 Information Builders