Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

CASE WHEN statement not working in script

I'm having troubles in executing a SQL script from QV on to a Oracle database.

The particular column which is causing the trouble contains a CASE WHEN statement.
When we (un)comment this part of the script everything is fine

The SQL statement alone parses and retrieves results in tools like: "Oracle SQL developper" or "TOAD"
But when ran from QV-script it returns a SQL parse error...(unless we "//" this part)

It seems QV-script can't cope with the CASE WHEN statement (or someting goes wrong when translating it) cause when I ran a very simple example of a CASE WHEN statement from the QV-script it's also giving me the error...

Anyone any ideas (using QV 9 sr 5

1 Solution

Accepted Solutions
Not applicable
Author

It seems when I choose a different connect string (e.g "Microsoft OLE DB for Oracle" vs "Oracle native OLE DB" ) the QV script with the CASE WHEN does gets parsed!!

So probably the Oracle OLE DB driver is not ready for CASE WHEN's (and MicroSoft OLE DB is)

View solution in original post

3 Replies
Miguel_Angel_Baeyens

Hello,

I'd rather use ApplyMap for that in the load of the table in QlikView, getting raw values from the database. Say the field involved in the CASE statement is named "KEY":

MappingTable:MAPPING LOAD * INLINE [Input, OutputA, DeveloperB, ConsultantC, Other];Table:LOAD ApplyMap('MappingTable', KEY) AS KEY;SQL SELECT KEY FROM OracleDatabase;


Hope that helps

Not applicable
Author

It seems when I choose a different connect string (e.g "Microsoft OLE DB for Oracle" vs "Oracle native OLE DB" ) the QV script with the CASE WHEN does gets parsed!!

So probably the Oracle OLE DB driver is not ready for CASE WHEN's (and MicroSoft OLE DB is)

orlando
Partner - Contributor
Partner - Contributor

Hello

instead of dealing with the 'case'-statement and some OLE DB driver problems in the sql-part using the if()-function in the load-part of the statement could be another solution.