oracle存储过程,求指导

-- 3 判断语句
-- IF 比较式 THEN BEGIN END; END IF;
CREATE OR REPLACE PROCEDURE test(x IN NUMBER)
IS
  BEGIN
    IF x > 0
    THEN
      BEGIN
        x := 0 - x;
      END;
    END IF;
    IF x = 0
    THEN
      BEGIN
        x := 1;
      END;
    END IF;
  END test;

[2017-03-21 15:48:19] [99999][17110] Warning: 执行完毕, 但带有警告

[2017-03-21 15:48:19] completed in 8ms

Mr丶zcy
浏览 2192回答 3
3回答

six喵土豆

存储过程需要有输入和输出的参数

慕的地8582982

BWZGNMJXZXUCJVHMCCFPCMEYREMSXRNLLXFOOHSYENJJXUKRUYWCFYFUJDDOKDRNBUNQQTHSMQDJDFFZZGJJCVJAZWCCOFTWWCNWTSIIOHODQUDDZAQBEUKAHMWUTTDXNQXRHNMDOEEXXOYTMPYJXLBBCDRRUUBBHFKDTVIOENNGDCKURSERRSOCREOOFYBCLQJPCARBPJPQQBAXLTWIJGISPLBBZZKTGTNMLSVCEILVELCVWMFPYSLFWCDUNOOLFOWJZIMFYUAUPYLMVNXQAGOJNPZCSMROSLCXKQTWQIHESFMWZWPHDUFFPQLBHIJHKBUOOPQGJNBVIOICLEDKQAXQVUUUYHUENDQJNHSSXUMGGWZTDOEEONZZOPWQGDGPGNDTKCTPPPPPJCUNXXQOUBLTPISMVIOZGCQDQTDDMSFFYGGWWKKJZWYOBRKKOOOUPPPABNPQOJWBEEMGNATXAKRMKNOOZPDXKOIZWJQDDDKILQLHEOTXGIFVXYXNNNYYYFCGREAHPZEXOOSZTYBYHRPMRPFMPIVYFCLTXDGJYBLYBLURPFSVLTQTMFJDZDUTCUUQGURQIULBKGRGKBPKDPZEUVOTTZUWWAGHUHFVSDWHVSFQGWGSYVSSGXQZVJRXVBGFAUTRSUKGOYFPCMHFOHGHVVBEEOBZSVDYCZUOJMFVRKRVFCVZJTIULLDWUHAHCARYFLILVMTNBXCUUUONHOJJWCMHECBVKPERRWGTDCGANQTNNWEPSKSNTMWGEVZSTQGQCAKKNKKBSEHAAUUEXEBSNABFPGPMGXLOVCPNAKUDAOWMDKHHPVHZDZMNNMMLIPGMQDZQQYYSGARGRFKUNXYICCOVYYOCQJXXMZVSSZDXKTTF

Mr丶zcy

x是输入参数,那么下面x是不能被赋值的,如果想赋值需要改成create or replace procedure test(x in out number)
打开App,查看更多内容
随时随地看视频慕课网APP