Skip to Main Content
SQL in a Nutshell
book

SQL in a Nutshell

by Kevin Kline
December 2000
Intermediate to advanced content levelIntermediate to advanced
224 pages
9h 52m
English
O'Reilly Media, Inc.
Content preview from SQL in a Nutshell

Name

DROP FUNCTION

Synopsis

This command removes a user-defined function from the current database.

Vendor

Command

SQL Server

Supported, with variations

MySQL

Supported, with variations

Oracle

Supported, with variations

PostgreSQL

Supported, with variations

SQL99 Syntax and Description

DROP FUNCTION function_name {RESTRICT | CASCADE}

This command permanently destroys a function. The RESTRICT clause ensures that the command fails if other database objects, such as a view, depend upon the function. On the other hand, the CASCADE option drops the function, any grants based on the function, and any dependent database objects!

Microsoft SQL Server Syntax and Variations

DROP FUNCTION [owner_name.]function_name [,...n]

As with other SQL Server DROP commands, more than one database object of the same type may be dropped by placing a comma between the names of each database object.

MySQL Syntax and Variations

This command does not actually delete the file containing the function. Instead, it deletes the function reference from the system table, which can be added back by using the CREATE FUNCTION statement.

Oracle Syntax and Variations

DROP FUNCTION [owner_name.]function_name

As with other Oracle DROP commands, the name of the function owner may be specified. Otherwise, Oracle assumes the current-user context, and only functions owned by the current user to be dropped. Alternately, those users with DROP ANY FUNCTION system privilege are allowed to drop any function anywhere.

PostgreSQL Syntax ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL in a Nutshell, 3rd Edition

SQL in a Nutshell, 3rd Edition

Kevin Kline

Publisher Resources

ISBN: 1565927443