/* Test user provided numbe is even or odd */
SET SERVEROUTPUT ON
SET VERIFY OFF
DECLARE
v_user_input NUMBER := &user_input;
BEGIN
-- Test user provided number is even
IF MOD(v_user_input, 2) = 0 THEN
DBMS_OUTPUT.PUT_LINE( v_user_input || ' is a even number');
ELSE
DBMS_OUTPUT.PUT_LINE( v_user_input || ' is a odd number');
END IF;
END;
/
Enter value for user_input: 23
23 is a odd number
PL/SQL procedure successfully completed.
Subscribe to:
Post Comments (Atom)
External Table
Oracle External Table External tables are defined as tables that do not resides in the database allows you to access data that is stor...
-
Oracle PL/SQL block accepts user input information with the help of substitution variable. Substitute variable can not be used to output va...
-
Table clustering is an optional technique of storing data. In table clustering, rows from one or more tables those are associated with ea...
-
DECLARE TYPE emp_ref_cursor IS REF CURSOR; TYPE empno_tab IS TABLE OF NUMBER; TYPE ename_tab IS TABLE OF VARCHAR2(50); v_emp_...
No comments:
Post a Comment