Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Redshift ODBC - error when using WITH clause

Hi all,

This is probably a Redshift IDBC driver issue, but thought maybe someone here has also encountered the problem.

I'm pulling data into QlikView from Amazon Redshift using the latest x64 ODBC driver (Install and Configure the Amazon Redshift ODBC Driver on Microsoft Windows Operating Systems - Amazo...),

and when I'm trying to use the WITH clause (WITH Clause - Amazon Redshift), I get an unkown statement error.

I know the query's syntax correct since it executes fine when running it via any client like datagrip / sql workbench j.

Anybody encountered this problem before and managed to solve it?

Thanks!

Assaf

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Solved.

I forgot the SQL prefix before the actual SQL statement.

I usually omit this prefix and queries run just fine. Turns out that WITH needs that prefix.

The following syntax will work:

SQL

WITH

[table_name] as (select col1 from t1)

select col1 from table_name;

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Solved.

I forgot the SQL prefix before the actual SQL statement.

I usually omit this prefix and queries run just fine. Turns out that WITH needs that prefix.

The following syntax will work:

SQL

WITH

[table_name] as (select col1 from t1)

select col1 from table_name;