src-db/database/model/triggers/AD_REGISTRATION_INFO_TRG.xml
author Juan Pablo Aroztegi <juanpablo.aroztegi@openbravo.com>
Mon, 28 Apr 2008 09:28:08 +0000
changeset 785 8dba91261590
parent 756 ae11e4610537
child 2078 cf88ca44cdd2
permissions -rw-r--r--
Fix last update of copyright years in database files
juanpablo@721
     1
<?xml version="1.0"?>
juanpablo@721
     2
  <database name="TRIGGER AD_REGISTRATION_INFO_TRG">
juanpablo@721
     3
    <trigger name="AD_REGISTRATION_INFO_TRG" table="AD_REGISTRATION_INFO" fires="before" insert="true" update="false" delete="false" foreach="row">
anthony@685
     4
      <body><![CDATA[
anthony@685
     5
anthony@685
     6
/*************************************************************************
anthony@685
     7
* The contents of this file are subject to the Openbravo  Public  License
anthony@685
     8
* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
anthony@685
     9
* Version 1.1  with a permitted attribution clause; you may not  use this
anthony@685
    10
* file except in compliance with the License. You  may  obtain  a copy of
anthony@685
    11
* the License at http://www.openbravo.com/legal/license.html
anthony@685
    12
* Software distributed under the License  is  distributed  on  an "AS IS"
anthony@685
    13
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
anthony@685
    14
* License for the specific  language  governing  rights  and  limitations
anthony@685
    15
* under the License.
anthony@685
    16
* The Original Code is Openbravo ERP.
anthony@685
    17
* The Initial Developer of the Original Code is Openbravo SL
anthony@685
    18
* All portions are Copyright (C) 2001-2008 Openbravo SL
anthony@685
    19
* All Rights Reserved.
anthony@685
    20
* Contributor(s):  ______________________________________.
anthony@685
    21
************************************************************************/
antonio@735
    22
  v_Count NUMBER:= 0;
anthony@685
    23
BEGIN
anthony@685
    24
anthony@685
    25
  SELECT COUNT(*) INTO v_Count FROM AD_REGISTRATION_INFO;
anthony@685
    26
  IF (v_Count <> 0) THEN
anthony@685
    27
    RAISE_APPLICATION_ERROR(-20528,'Only one registration permitted.');
anthony@685
    28
  END IF;
antonio@735
    29
END AD_REGISTRATION_INFO_TRG
antonio@735
    30
]]></body>
juanpablo@721
    31
    </trigger>
juanpablo@721
    32
  </database>