Skip to Main Content

Japanese

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

pl/sql のboolean型を画面に出力したい

859671May 23 2011 — edited May 25 2011
お世話になっております。

掲題の通り、pl/sqlブロック内で定義したbooleanを戻すfunctionを作成したいのですが、
boolean型を何とかして、キャラに変換できませんか?

変換関数を探しても見つからず、現在、↓の用にラッパを作っていますが、イマイチ
すっきりしません。直接booleanを変換する方法は無いでしょうか?
ちなみにis_universe()関数はpl/sql内のパッケージからも呼ばれるので戻り値は
出来ればこのままが良いような気がします。それとも、呼び出し側に戻す時の戻り値は
boolean型は使わず、テキストでTRUE/FALSEを返すほうが良いのでしょうか?

①create or repalce function is_universe( pi_code in varchar2 )
is
t_code varchar2;
begin
select code into t_code from test1 where code=pi_code;
if t_code is not null then
return true;
else
return false;
excepion
when others then
return false;
end ;

②create or replace function is_universe_text( pi_code in varchar2)
is
t_ret varchar2;
begin
if is_universe(pi_code) = true then
t_ret := 'TRUE' ;
else
t_ret := 'FALSE';
end ;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 22 2011
Added on May 23 2011
7 comments
10,670 views