Focal Point
PIVOT and UNPIVOT

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/1381057331/m/9047063326

August 20, 2012, 11:45 AM
Koby1Kanoby
PIVOT and UNPIVOT
When creating a Flow, Is there an equivalent to the SQL PIVOT and UNPIVOT relational operators?


WebFOCUS 7.6
Windows, All Outputs
August 21, 2012, 10:06 AM
Clif
Assuming you mean a DataMigrator data flow, while there is no direct equivalent in the SQL used there, it is possible with techniques such as those described in the forum postTranspose rows into columns

Alternately you can use database specific SQL functions in a DBMS SQL Flow, or by creating a synonym for an external SQL script.


N/A
August 22, 2012, 01:30 PM
Koby1Kanoby
quote:
DataMigrator


Thank you Clif for your relpy.

I looked at the suggested forum post. This would work for an equivalent PIVOT solution.

I also built an UNPIVOT query in a DBMS SQL Flow that populates an existing table , but the solution seems slow (over an hour to write about 300,000 records).

I’m about to try a synonym for an external SQL script. I’ll let you know how this goes.


WebFOCUS 7.6
Windows, All Outputs
August 24, 2012, 10:21 AM
Clif
A DBMS SQL Flow and creating a synonym for an external SQL script are two means to the same end. In either case the database specific SQL is passed through directly to the underlying relational database which executes the query. Throughput will be comparable.


N/A