Re: Procedure Delete Script !
Posted in 1999
Nayan
Create a shell script (call it dropprocs.sh) like so:
#!/bin/ksh
cat proclist.dat | while true
do
read $procname
dbaccess $1 <<EOF
DROP PROCEDURE $procname
EOF
done
and call it with the database name, like so:
$ ./dropprocs.sh yourdatabasename
The file proclist.dat would contain a list of your procedures, like so:
proc1
proc2
...
procn
HTH
Sujit
Nayan Jain <nayan.jain@tatainfotech.com> on 05/29/99 12:40:33 AM
To: "Informix-List (E-mail)" <informix-list@iiug.org>
cc: (bcc: Sujit Pal)
Subject: Procedure Delete Script !
Hi all,
Your this student is again back with a question.
Thanks to all the people who have replied to my previous question
BTW, I shud say that you people are marvellous and sometimes i am amazed
by the knowledge u posses and it also incite me to work hard to come
somewhere near to ur level.
Also, With many people working with me it still becomes difficult to get
answers to some question haunting and hence i have to come to u for help.
##---- My Question ------##
I have a .sql file where i have written delete statements like this
##------Cut Here-------##
DROP PROCEDURE proc1;
DROP PROCEDURE proc2;
DROP PROCEDURE proc3;.
.
.
.
.
.
DROP PROCEDURE proc4;##------Cut Here-------##
Now what happens is that if there is any procedure missing the dbaccess
stops at that procedure drop statement. Then i have to comment that
procedure drop statement and rerun the .sql
But now the earlier procedures which were dropped cannt be dropped
so...they also have to be commented. )-;
Is there any way that i have a script which will have all the procedure
names (with drop stmts) and then delete whichever are there and skip
whichever are not there..
Let em tell u that this will be a common script that will be running at
many servers. Currently i go to that server, find how many procs are
there, prepare drop statments, execute .sql file. seems to be boring and
tiresome when u have many servers.
Sorry for the long mail...)-;
TIA,
Nayan Jain !