Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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