|
-
Are the values already in a table ???
Gregg
if so... let's say table_name = ipaddresses
something to the effect of....
-- This creates a table with the same structure ... no data
create table t_ipaddresses as select * from ipaddresses where
1=2
--- insert ipaddresses into t_ipaddresses without the last digits;
--- now you have a table that you can use...
declare
v_ip varchar2(50);
cursor get_ip is
select ip_address
from ipaddresses;
begin
open get_ip;
fetch get_ip into v_ip;
loop
exit when get_ip%notfound;
insert into t_ipaddresses
select SUBSTR(v_ip,1,INSTR(v_ip,':')-1) from dual;
fetch get_ip into v_ip;
end loop;
close get_ip;
end;
/
Hope this helps
Gregg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|