Jump to content

Error using UNPIVOT in TIBCO TDV SQL : "UNPIVOT missing an alias"


Recommended Posts

I am unable to get the UNPIVOT syntax to work in any SQL query in TDV Studio (TIBCO Data Virtualization).

It gives the error ""UNPIVOT missing an alias. On line 5, column 1. ""

even though I seem to have followed the syntax given in theTIB_tdv_8.4.0_ReferenceGuide.pdf --> page 65-67

The query I wrote has the form shown below.

In fact, if you run this query below in TDV Studio, you will get the error (even though this is a dummy query, the same error will still show up).

Why is the error coming What is missing or wrong in the query

-------

SELECT

col_1, col_2, col_3

FROM

tbl

UNPIVOT

(

(col_1, col_2, col_3)

FOR

seq_nbr

IN

(

(tbl.col_1_1, tbl.col_1_2, tbl.col_1_3),

(tbl.col_2_1, tbl.col_2_2, tbl.col_2_3),

(tbl.col_3_1, tbl.col_3_2, tbl.col_3_3)

)

)

------------

adding aliases to the columnsets doesn't help

SELECT

col_1, col_2, col_3

FROM

tbl

UNPIVOT

(

(col_1, col_2, col_3)

FOR

seq_nbr

IN

(

(tbl.col_1_1, tbl.col_1_2, tbl.col_1_3) as 'SET1',

(tbl.col_2_1, tbl.col_2_2, tbl.col_2_3) as 'SET2',

(tbl.col_3_1, tbl.col_3_2, tbl.col_3_3) as 'SET3'

)

)

------------

Link to comment
Share on other sites

×
×
  • Create New...