Assert procedure : Utility Procedure « Stored Procedure Function « Oracle PL / SQL






Assert procedure

 
SQL>
SQL>
SQL> SET ECHO ON
SQL>
SQL> CREATE OR REPLACE PROCEDURE ASSERT (
  2      condition IN BOOLEAN,
  3      message IN VARCHAR2) AS
  4  BEGIN
  5      IF NOT condition THEN
  6          RAISE_APPLICATION_ERROR (-20000,message);
  7      END IF;
  8  END;
  9  /

Procedure created.

SQL>
SQL>
SQL> --

 








Related examples in the same category

1.Use stored procedure to output table content
2.emp table lookup
3.Use stored procedure to log message
4.Create a stored procedure to measure a table usage
5.Procedure does not count space
6.File dump procedure
7.Copy tables
8.Count credits