Collection Last Record [message #653755] |
Mon, 18 July 2016 05:08 |
ORAGENASHOK
Messages: 240 Registered: June 2006 Location: Chennai
|
Senior Member |
|
|
Open c_mrg_dtl(tc_file_dtl(i).source_id, tc_tbl_dtl(j).tbl_id, tc_tbl_dtl(j).tbl_name) ;
Loop
Fetch c_mrg_dtl BULK COLLECT INTO tc_mrg_dtl;
EXIT WHEN tc_mrg_dtl.COUNT <= 0;
log_util.log_msg(
p_msg => 'Inside cursor c_mrg_dtl ',
p_msg_code => k_msg_code||(g_msg_code_no) ,
p_module => v_proc_name,
p_action => v_subproc_name);
for o in tc_mrg_dtl.FIRST..tc_mrg_dtl.LAST
Loop
if ( tc_mrg_dtl(o).mrg_on_flg = 'Y') then
[b]v_query := v_query||' '||'ss.'||tc_mrg_dtl(o).tbl_col_name||' = '||'stg.'||tc_mrg_dtl(o).stg_col_name||' '||'and' ;[/b]
End if ;
End Loop ; -- End merge clause for loop end
End Loop ;--- End merge clause open cursor end
I have above code and am forming it dynamically. Now from the inner loop i want find last record like below
if ( last record) then
i will not appended with "and" at end of the statement.
i used LAST = COUNT it returns same value.
Any possibility to identify last record in this case?
|
|
|
|
|
|
|