Başlangıç > PL/SQL > selected two variables that control whether the program from a fixed start and end

selected two variables that control whether the program from a fixed start and end


Hi;
This is my first English post.Sometimes we need a program for check the anything.Someday such a program was needed and I and my friend wrote this program.This program is checking the numbers between two numbers.If the number is between the start and end points of the two variables is terminating the process.If two values are given, but processing continues in the start and end values.
The syntax of program below.I hope it will be useful.

DECLARE
  begin_number     NUMBER := 8; --first number for time line
  end_number       NUMBER := 20; --last number for time line
  variable_number1 NUMBER := 22; --first variable for time line
  variable_number2 NUMBER := 5; --last variable for time line
  break            NUMBER := 0; -- value:1 break,value:0 continue
BEGIN
  --/*Condition 1*/
  IF variable_number1 < begin_number AND variable_number2 < end_number THEN
    IF variable_number1 < begin_number AND variable_number2 > begin_number THEN
      break := 1;
    END IF;
  END IF;

  --/*Condition 2*/
  IF variable_number1 < begin_number AND variable_number2 > end_number THEN
    break := 1;
  END IF;

  --/*Condition 3*/
  IF variable_number1 > begin_number AND variable_number2 > end_number THEN
    IF variable_number1 < end_number AND variable_number2 > end_number THEN
      break := 1;
    END IF;
  END IF;

  --/*Condition 4*/
  IF variable_number1 > begin_number AND variable_number2 < end_number THEN
    IF variable_number1 > end_number AND variable_number2 < begin_number THEN
      break := 0;
    ELSE
      IF variable_number1 = end_number AND variable_number2 < begin_number THEN
        break := 0;
      ELSE
        IF variable_number1 = end_number AND variable_number2 = begin_number THEN
          break := 0;
        ELSE
          IF variable_number1 > end_number AND variable_number2 = begin_number THEN
            break := 0;
          ELSE
            break := 1;
          END IF;
        END IF;
      END IF;
    END IF;
  END IF;

  --/*Condition 5*/
  IF variable_number1 = begin_number AND variable_number2 = end_number THEN
    break := 1;
  END IF;

  --/*Condition 6*/
  IF variable_number1 > begin_number AND variable_number2 = end_number THEN
    break := 1;
  END IF;

  --/*Condition 7*/
  IF variable_number1 = begin_number AND variable_number2 < end_number THEN
    break := 1;
  END IF;

  --/*Condition 8*/
  IF variable_number1 < begin_number AND variable_number2 = end_number THEN
    break := 1;
  END IF;

  --/*Condition 9*/
  IF variable_number1 = begin_number AND variable_number2 > end_number THEN
    break := 1;
  END IF;

  IF nvl(break, 0) = 1 THEN
    dbms_output.put_line('Result=' || break || ' Break the program.');
  ELSE
    dbms_output.put_line('Result=' || break || ' Continue the program.');
  END IF;

END;

Note:Please let me know if you have an error in my article.

Reklamlar
  1. Henüz yorum yapılmamış.
  1. No trackbacks yet.

Bir Cevap Yazın

Aşağıya bilgilerinizi girin veya oturum açmak için bir simgeye tıklayın:

WordPress.com Logosu

WordPress.com hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Twitter resmi

Twitter hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Facebook fotoğrafı

Facebook hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Google+ fotoğrafı

Google+ hesabınızı kullanarak yorum yapıyorsunuz. Çıkış  Yap / Değiştir )

Connecting to %s

%d blogcu bunu beğendi: