Skip to content

Instantly share code, notes, and snippets.

View sonu041's full-sized avatar

Shuvankar Sarkar sonu041

  • India
  • X @sonu041
View GitHub Profile
@sonu041
sonu041 / self_validating_script_part_1.sql
Created December 25, 2023 15:52
Self Validating Scripts Parts
UPDATE TABLE1 SET COL1 = 'XYZ' WHERE STATUS = 'N'
IF SQL%ROWCOUNT <> 5 THEN
l_msg := 'Update Failed';
raise_application_error(-20101, l_msg);
ELSE
l_msg := 'Upadte Successfully'
dbms_output.put_line(l_msg);
COMMIT;
END IF
@sonu041
sonu041 / self_validating_script.sql
Last active December 25, 2023 15:48
Self Validating Script
SET SERVEROUTPUT ON SIZE 200000;
SET SCAN OFF;
WHENEVER SQLERROR EXIT;
DECLARE
l_env VARCHAR2(50) := '';
l_count_act NUMBER := 0;
l_count_exp NUMBER := 0;
l_exp_upper_bound NUMBER := 0;
l_exp_lower_bound NUMBER := 0;