IICS no viable alternative at input '\n/* partner: Informatica -v 2.0 *

107 Views Asked by At
SELECT 
    concat('-', column_1) as column_1,
    column_2 as column_2,
    concat('-', column_3) as column_3,
    'hard_code_string' as column_4,
    column_5 as column_5,
    column_6 as column_6,
    column_7,
    column_8 as column_8,
    column_9 AS column_9,
    column_10 as column_10, 
    column_11 AS column_11,
    column_12 AS column_12,
    'hard_code_string' as column_13,
    CAST(column_3 AS VARCHAR(255)) || ',' || 
    CAST(column_4 AS VARCHAR(255)) || ',' || 
    CAST(column_5 AS VARCHAR(255)) || ',' || 
    CAST(column_6 AS VARCHAR(255)) AS column_14 
FROM "table_name_here"
LIMIT 10;

Returns the following error

[ERROR] line 3:413 no viable alternative at input '\n/* partner: Informatica -v 2.0 */\nunload ('SELECT concat(\'-\', column_1) as column_1,column_2 as column_2,concat(\'-\', column_3) as column_3,column_4 as column_4,column_5 as column_5,column_6,column_7 as column_7,column_8 AS column_8,column_9 column_10,column_11 AS column_11,column_12 AS column_12,\'link_here' as column_13 FROM "table_name" WHERE column_3 is not null LIMIT 10;'
2

There are 2 best solutions below

0
On

As far as I recall IICS adds some statement to your query, like the ORDER BY clause. With your query having the semicolon (;) at the end, this results in an error.

0
On

Error was caused by having the limit 10; Once I removed this, the query worked. Another work around I found was by creating a view in redshift and select * from that view.