Wednesday, 1 July 2026

Storing Expression Value in PLSQL and Java

Every Expression return True or False. So we can easily store their value in Boolean expression

Using this Method we can easily check conditions instead of testing these scenarios in IF-ELSE condition .

---Example of Storing Expression Value in PLSQL

---Example of Storing Expression Value in PLSQL
--By mFaisal
declare
lExpressionValue boolean;
begin
  --- Expression Value
  lExpressionValue:=1=2 or 2=2;
 
  -- Is True Then
  ---1
  ---else
  --2
 
if  lExpressionValue Then
    --1
  DBMS_OUTPUT.put_line('Expression is  True..');
  else
    --- 2
  DBMS_OUTPUT.put_line('Expression is not True..');
  end if;


end;



Example of JAVA Code

public class Server {

    public static void main(String[] args) {
        Server.isTrue((1==2));
    //isTrue((1=1)));
    }

   
    public static void isTrue(boolean expression) {
    if (expression) {
       System.out.println("Expression is true.");
    }
    else
    {
        System.out.println("Expression is not true.");
    }
    }
   

   
}



No comments:

Post a Comment

How To: Remove all rows from view object (VO) in OAF & ADF

This is the basic requirement when we are working with oracle OAF. In which we need to removed the all rows from the table. The best use ca...