1
create or replace procedure upstat(tablename in varchar2,
2
orderservid in varchar2,
3
table_num in number,
4
status in number) is
5
i number(4, 0);
6
smstable varchar2(32);
7
update_sql varchar2(500);
8
begin
9
i := 0;
10
while i < table_num loop
11
if (i >= 10) then
12
smstable := 'SMS_USER_0' || to_char(i);
13
else
14
smstable := 'SMS_USER_00' || to_char(i);
15
end if;
16
update_sql := 'update ' || smstable || ' t set t.status=' || status || '
17
where t.orderservid=''' || orderservid ||
18
''' and exists (select ''x'' from ' || tablename ||
19
' b where b.ms = t.mobileno)';
20
DBMS_OUTPUT.put_line(update_sql);
21
--execute immediate update_sql;
22
commit;
23
i := i + 1;
24
end loop;
25
end upstat;
![](/Images/OutliningIndicators/None.gif)
2
![](/Images/OutliningIndicators/None.gif)
3
![](/Images/OutliningIndicators/None.gif)
4
![](/Images/OutliningIndicators/None.gif)
5
![](/Images/OutliningIndicators/None.gif)
6
![](/Images/OutliningIndicators/None.gif)
7
![](/Images/OutliningIndicators/None.gif)
8
![](/Images/OutliningIndicators/None.gif)
9
![](/Images/OutliningIndicators/None.gif)
10
![](/Images/OutliningIndicators/None.gif)
11
![](/Images/OutliningIndicators/None.gif)
12
![](/Images/OutliningIndicators/None.gif)
13
![](/Images/OutliningIndicators/None.gif)
14
![](/Images/OutliningIndicators/None.gif)
15
![](/Images/OutliningIndicators/None.gif)
16
![](/Images/OutliningIndicators/None.gif)
17
![](/Images/OutliningIndicators/None.gif)
18
![](/Images/OutliningIndicators/None.gif)
19
![](/Images/OutliningIndicators/None.gif)
20
![](/Images/OutliningIndicators/None.gif)
21
![](/Images/OutliningIndicators/None.gif)
22
![](/Images/OutliningIndicators/None.gif)
23
![](/Images/OutliningIndicators/None.gif)
24
![](/Images/OutliningIndicators/None.gif)
25
![](/Images/OutliningIndicators/None.gif)