Proper method of dropping 160K views
Posted in 2006
Topics: General Discussion
Greetings, I need to do a massive drop of views, but I'm a bit unclear as to the proper procedure. I am familiar with "drop view", but with so many to drop, I was wondering if it is acceptable or advisable to delete from the sysviews table directly? Actually, I want to delete from the systables, since each view in sysviews comprises about 50 rows with the same tabid. Thanks in advance!
On Wed, 2006-05-03 at 12:55, natebsi@gmail.com wrote:
> Greetings,
>
> I need to do a massive drop of views, but I'm a bit unclear as to the
> proper procedure. I am familiar with "drop view", but with so many to
> drop, I was wondering if it is acceptable or advisable to delete from
> the sysviews table directly?
> Actually, I want to delete from the systables, since each view in
> sysviews comprises about 50 rows with the same tabid.
I suggest you use dbaccess to build an sql script that will perform the
drops, along the lines of
---------------------------------------------------------------
unload to "drop_views.sql" delimiter ";"
select "drop view "||tabname
from systables
where tabtype = "V" and tabid >= 100
---------------------------------------------------------------
Note that this will select all views in the database against which you
run this snippet. Add conditions to the where clause to taste so that it
selects "only" the 160000 views you wish to drop.
Hope this helps,
--
Carsten Haese | Phone: (419) 861-3331
Software Engineer | Direct Line: (419) 794-2531
Unique Systems, Inc. | FAX: (419) 893-2840
1687 Woodlands Drive | Cell: (419) 343-7045
Maumee, OH 43537 | Email: carsten@uniqsys.com