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    SQL RIGHT FUNCTION USED IN SELECT STATEMENT
Go
New
Search
Notify
Tools
Reply
  
SQL RIGHT FUNCTION USED IN SELECT STATEMENT
 Login/Join
 
Member
posted
Hi, In a flow, I am trying to use RIGHT function in SQL select statement for the source, as:

SELECT
T1.INV_POST_DATE ,
T1.ACTIVITY_DATE ,
RIGHT(RTRIM(T1.SENDER_ID ), 3) AS TEST,
T1.STORE_NUMBER
FROM
nwest_daily_inv T1

However, Data Migrator throws an error: (FOC14069) SQL SYNTAX ERROR ON LINE 14 AT '('

Interestingly enough, there is no line 14 in that select statement.

The above SELECT statement works fine in DB2, but not in Data Migrator Is there a different syntax for using RIGHT function in Data Migrator?


WebFOCUS 7.7, iWay Data Migrator, Windows
Excel, PDF, HTML, XML
 
Posts: 19 | Registered: March 19, 2012Reply With QuoteReport This Post
Guru
posted Hide Post
While most common SQL functions are supported in what we used to call "EDA/SQL" some DB2 functions like RIGHT are not included. There's a list in the DataMigrator User's Guide.

However in the current production release 7.7.05 you can indicate a database specific function using the new function DB_EXPR.

 DB_EXPR(RIGHT(RTRIM(T1.SENDER_ID), 3) ) 


In prior releases you could use a DBMS SQL Flow to write dialectic specific SQL.
 
Posts: 383 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Thank you Clif.

In your statement "In prior releases you could use a DBMS SQL Flow to write dialectic specific SQL" do you refer to using data transformation on either source or target to get the final result as RIGHT function would have done?


WebFOCUS 7.7, iWay Data Migrator, Windows
Excel, PDF, HTML, XML
 
Posts: 19 | Registered: March 19, 2012Reply With QuoteReport This Post
Guru
posted Hide Post
No, I meant that you could use a DBMS SQL Flow.

Right click on an application directory and select New > DBMS SQL Flow. This special flow type has only a SQL object and target(s). Right click on the SQL object and select Properties to specify your adapter and connection. Then double click to open the SQL object where you can paste or write your DB2 SELECT statement.

Another alternative as you state is to write FOCUS transformations to achieve the same result. In fact in a source transformation could use this syntax to invoke the DB2 RIGHT function
SQL.RIGHT(RTRIM(T1.SENDER_ID),3)
However this at the cost of disabling automatic pass through (APT) which can adversely affect throughput.
 
Posts: 383 | Location: New York City | Registered: May 03, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    SQL RIGHT FUNCTION USED IN SELECT STATEMENT

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