Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tELTOracleMap connect to tELTOracleMap with context variable both in inner and outer query

Hi,

 

I wanted to order the primary key and then select N rows - so my query looks like

 

select * from (

select * from table1 a, table2 b where a.id = b.id and mod(a.id, 3) = context.process_num order by b.id)

where rownum <= context.number_of_rows

 

I am using 2 tELTMap. The 1st tELTMap generated select query is as expected:
"select * from

" + "table1" + " a," + "table2"+ " b

where a.id = b.id and mod(a.id, 3) = " + context.process_num+"

order by b.id

"

 

But the 2nd tELTMap generated select query is as NOT expected:

"select * from (

select * from

"+ "table1"+ " a,"+ "table2" + "b

where a.id = b.id and mod(a.id, 3) = context.process_num

order by b.id) c"

+"where rownum <="+ context.number_of_rows

 

context.process_num becomes part of string and throws the below error:

java.sql.SQLSyntaxErrorException: ORA-00904: "CONTEXT"."PROCESS_NUM": invalid identifier

 

How to resolve having context.process_num in inner query but not inside String?

 

Thanks

Labels (3)
0 Replies