How to prompt a user for input in oracle using SQLTools v1.6? I tried the following PL/SQL block:
DECLARE
type tes_tab is table of test_table%rowtype;
test_tab tes_tab;
BEGIN
execute immediate 'SELECT * FROM test_table WHERE memid=' || &MemID
bulk collect into test_tab;
for i in 1..test_tab.count
loop
dbms_output.put_line(test_tab(i).memid || ' ' || test_tab(i).clmtype);
end loop;
END;
It prompts the user for input during compile time. However, the value cannot be used in the select statement. Is there any other way to achieve what I am seeking.
The table contains 852269 records with multiple rows for a single memID(I have provided a few rows here):
MEMID CLMTYPE PAIDAMT SERVICEDATE PAIDDATE
----------- --------- --------- --------------------- ---------------------
220000096 RX 77.22 06.05.2011 00:00:00 27.05.2011 00:00:00
220000096 RX 77.22 04.02.2011 00:00:00 27.02.2011 00:00:00
220000096 RX 93.36 01.01.2011 00:00:00 27.01.2011 00:00:00
220000096 RX 15.07 09.08.2012 00:00:00 07.09.2012 00:00:00
220000096 RX 105.52 06.01.2012 00:00:00 04.02.2012 00:00:00
220000096 RX 93.36 02.03.2011 00:00:00 27.03.2011 00:00:00
220000096 RX 105.52 09.11.2011 00:00:00 09.12.2011 00:00:00
220000096 RX 105.52 10.03.2012 00:00:00 13.04.2012 00:00:00
220000096 RX 50.52 06.04.2011 00:00:00 27.04.2011 00:00:00