home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / SQL and Data Base / Logic Works ERwin 3.5 / data.1 / erwrenin.fiv < prev    next >
Encoding:
Text File  |  1998-01-28  |  1.4 KB  |  42 lines

  1. /* ------------------------------------------------------------------------
  2. --    ERWRENIN.FIV                                                          --
  3. --    Copyright (C) Logic Works, Inc. 1994                                 --
  4. --                                                                       --
  5. --  Stored function to insert relationship ends                          --
  6. --  into the Oracle CASE 5.1 dictionary                                      --
  7. ------------------------------------------------------------------------- */
  8. CREATE OR REPLACE FUNCTION ERWRENIN(pEntFrom    CI_ENTITIES.ID%TYPE,
  9.                              pName         CI_RELATIONSHIP_ENDS.NAME%TYPE,
  10.                              pDegree     CI_RELATIONSHIP_ENDS.DEGREE%TYPE,
  11.                              pOptional     CI_RELATIONSHIP_ENDS.OPTIONAL%TYPE,
  12.                              pOtherEnd     CI_RELATIONSHIP_ENDS.ID%TYPE)
  13.         RETURN CI_RELATIONSHIP_ENDS.ID%TYPE
  14.         AS
  15.         stRelend        ciorelationship_end.data;
  16.           act_status        varchar2(100);
  17.         act_warnings    varchar2(100);
  18. BEGIN
  19.         stRelend.v.FROM_ENTITY_REFERENCE := pEntFrom;
  20.         stRelend.i.FROM_ENTITY_REFERENCE := true;
  21.         stRelend.v.NAME := pName;
  22.         stRelend.i.NAME := true;
  23.         stRelend.v.DEGREE := pDegree;
  24.         stRelend.i.DEGREE := true;
  25.         stRelend.v.OPTIONAL := pOptional;
  26.         stRelend.i.OPTIONAL := true;
  27.         if pOtherEnd > 0 THEN
  28.             stRelend.v.OTHER_RELATIONSHIP_END_REF := pOtherEnd;
  29.             stRelend.i.OTHER_RELATIONSHIP_END_REF := true;
  30.         else
  31.             stRelend.i.OTHER_RELATIONSHIP_END_REF := false;
  32.         end if;
  33.         BEGIN
  34.             ciorelationship_end.ins(null,stRelend);
  35.             RETURN stRelend.v.ID;                     
  36.         EXCEPTION
  37.             WHEN OTHERS THEN
  38.                 RETURN -1;                        
  39.         END;
  40. END ERWRENIN;
  41. /
  42.