Skip to Main Content

APEX

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!

redirect to page

Chandler BingNov 29 2019 — edited Dec 3 2019

I have form ,and there is a button that performs to redirect another page in the same application and pass value. for example, as shown below. but the problem is value should be shown null.

I don't want this on a branch, bcoz i am dont want to submit page.

pastedImage_0.png

plz give any suggestion ?

This post has been answered by Veerendra Patil on Nov 29 2019
Jump to Answer

Comments

Holger.Lehmann

Hi,

you have to transfer either a number (1,0) or varchar2(Y, N) to boolean true or false.

But always take the same solution for the whole application, keeps things easier.

Regards

Holger

Al-Salamu Alikum We Rahmatu Allah We Barakatu,

Mohmed, what are you trying to do ?

May be you need to use Boolean in a function logic from forms or db. No  ?

If you need such a flag for such a logic (yes or no) you can use a Number or a Char Datatype.

Then, if the value column  is 1 then return Boolean function with TRUE & vise versa.

If it is 0 You can return False.

need to change the db item types.

Amatu Allah.

Mohamed Ali Soltani

Hi @"Holger.Lehmann",

W Alikum Al-Salamu We Rahmatu Allah We Barakatu @"Amatu Allah Neveen Ebrahim",

Thank you for your answer.

My main question is : Does any of both can make a bug later ? Does both have same effect on performance ?

Holger.Lehmann

Hi Mohamed,

regarding performance this should have no impact.

In most cases I've seen usage of a varchar2(1) flag.

And in my current project there is a PL/SQL function, that converts Boolean values to a varchar2(1) flag.

  FUNCTION myBool_To_Flag_Function (PBoolean IN boolean) RETURN varchar2 IS

Mohamed Ali Soltani

Hi Holger,

I haven't thought about it. It's really a good idea.

Thank you !

Amatu Allah Neveen Ebrahim
Answer

   You don't have to think about any database field as a Boolean value.

Just create a db field as Number, Char or Varchar2 datatype.

Number data type is a db type which i prefer it's faster than other data types.

I recommend using a pl/sql function with a Boolean return value using if statement to switch between two values either 0 or 1.

-------------------------------------------------------------

EXAMPLE:

========

FUNCTION TEST RETURN BOOLEAN IS

v_flage  NUMBER;

BEGIN

     BEGIN

      SELECT your_db_flg

      INTO  v_flage 

      FROM  your_table

     WHERE -- condition--- ;

  EXCEPTION

        WHEN NO_DATA_FOUND THEN RETURN 0;

  END;

IF v_flage   = 1 THEN

    

           RETURN TRUE;

ELSIF v_flage  = 0 THEN

    

         RETURN FALSE;

END IF;

END;

Amatu Allah.

Marked as Answer by Mohamed Ali Soltani · Sep 27 2020
Mohamed Ali Soltani

Thank you

You are welcome.

Andreas Weiden

Would you mind prooving this statement?

- Number data type is a db type which i prefer it's faster than other data types.

I don't think that there is any remarkable performance-difference with using a a NUMBER storing 0 and and a VARCHAR storing Y or N

A datatype decision should always be made to best fit its purpose.

Hello Andreas,

I agree.

Thanks for your comments.

1 - 10

Post Details

Added on Nov 29 2019
3 comments
498 views