[Dev] Oracleで、functionを登録してみる

in japanese •  8 months ago 

こんにちは、@yasuです。

ログイン
sqlplus hogeuser/passw0rd@//localhost:1521/pdb01

function 登録

CREATE OR REPLACE function ppp(name VARCHAR2) RETURN VARCHAR2
AS 
BEGIN
RETURN ('Welcome ' || name);
END;
/

確認(方法1)

variable x VARCHAR2(20);
call ppp('hoge') into :x;
print x;

確認(方法2)

select ppp('hoge') from dual;

方法2の方が楽かな

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!