開発者ドキュメント

Oracle PL/SQL – DROP関数の例

この記事では、 `DROP FUNCTION`を使用してOracleデータベースから関数を削除する方法を説明します。

1. DROP関数の例

1.1関数 `get

current

month`を作成します。次に、 `DROP FUNCTION`ステートメントを使って関数を削除します。

--Creating function

CREATE OR REPLACE FUNCTION get__current__month RETURN VARCHAR2 ISはcurr__month VARCHAR2(10)です。

BEGIN SELECT to__char(sysdate、 'MONTH')INTO curr__monthからデュアル; return curr__month;

END get__current__month;

1.2実行します。

デュアルからget__current__month()を選択します。

-- AUGUST

1.3関数 `get

current

month`を削除します。

DROP FUNCTION GET__CURRENT__MONTH;

-- function GET__CURRENT__MONTH dropped.

1.4 Run the deleted function

get

current

month

again.

デュアルからget__current__month()を選択します。

-- ORA-00904: "GET__CURRENT__MONTH": invalid identifier
-- 00904. 00000 -  "%s: invalid identifier"

References


  1. https://docs.oracle.com/cd/B28359


    01/appdev.111/b28370/drop

    function.htm#LNPLS99993[DROP
    Function :- Oracle official docs]

    function


    oracle


    plsql

モバイルバージョンを終了