Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. HELP ME ADD EXCEPTION

HELP ME ADD EXCEPTION

Scheduled Pinned Locked Moved Database
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VicPat
    wrote on last edited by
    #1

    I created a procedure to stop users from submitting all invoices having zero value. But the challenge am having now is to create exception in this procedure so that three authorized users can submit all such zero invoices. Please see below the created procedure: CREATE OR REPLACE PROCEDURE SIMS_ORN_LIVE.EV_INV_ITEM_VALUE_CHECK_SIMS(P_INVH_SYS_ID NUMBER ) AS CURSOR C1 IS SELECT Sum(INVI_FC_VAL) FROM OT_INVOICE_ITEM WHERE INVI_INVH_SYS_ID=P_INVH_SYS_ID; M_VAL NUMBER; BEGIN IF C1%ISOPEN THEN CLOSE C1; END IF; OPEN C1; FETCH C1 INTO M_VAL; CLOSE C1; IF Nvl(M_VAL,0)=0 THEN RAISE_APPLICATION('OP',585844 ,'YOU ARE NOT AUTHORIZED TO SUBMIT INVOICES WITH PROMO ITEMS ONLY, KINDLY CONTACT ED-OPS, MR. LAWRENCE, OR MRS NWABUIKE. ',' ',' ',' ',' ',' ',' ',' '); END IF; END ; /

    M 1 Reply Last reply
    0
    • V VicPat

      I created a procedure to stop users from submitting all invoices having zero value. But the challenge am having now is to create exception in this procedure so that three authorized users can submit all such zero invoices. Please see below the created procedure: CREATE OR REPLACE PROCEDURE SIMS_ORN_LIVE.EV_INV_ITEM_VALUE_CHECK_SIMS(P_INVH_SYS_ID NUMBER ) AS CURSOR C1 IS SELECT Sum(INVI_FC_VAL) FROM OT_INVOICE_ITEM WHERE INVI_INVH_SYS_ID=P_INVH_SYS_ID; M_VAL NUMBER; BEGIN IF C1%ISOPEN THEN CLOSE C1; END IF; OPEN C1; FETCH C1 INTO M_VAL; CLOSE C1; IF Nvl(M_VAL,0)=0 THEN RAISE_APPLICATION('OP',585844 ,'YOU ARE NOT AUTHORIZED TO SUBMIT INVOICES WITH PROMO ITEMS ONLY, KINDLY CONTACT ED-OPS, MR. LAWRENCE, OR MRS NWABUIKE. ',' ',' ',' ',' ',' ',' ',' '); END IF; END ; /

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      This sort of business rule should be in your application not the database. Wrong tool for the job.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups