--- In [email protected], "Leyne, Sean" wrote: > > > > > I would like to add a script that does a "DROP EXTERNAL FUNCTION SQRT". > > > > > > The problem I have is that some of the databases that will run this script > > already have the UDF dropped and so the script errors. > > > > > > Is there a way to run statements like DROP INDEX, DROP EXTERNAL > > FUNCTION, etc. in a script without generating an error of the object isn't > > found? > > > > In a pure SQL script, I wouldn't know. > > This should do: > > EXECUTE BLOCK > AS > BEGIN > IF (EXISTS (SELECT 1 FROM RDB$Functions WHERE RDB$FunctionName = 'SQRT') ) > THEN > EXECUTE STATEMENT 'DROP EXTERNAL FUNCTION SQRT'; > > END > > > > Sean >
Thanks Sean Worked great! Just had to surround the statements with SET TERM and fix the column name (RDB$FUNCTION_NAME). This will allow us to clean up a bunch of things in the database. Todd
