戻る

ストアードプロシジャ PSGFO_CHKINSERT

0001: CREATE PROCEDURE PSGFO_CHKINSERT(
0002:     UPDT          INTEGER,
0003:     ORDERNAME     NCHAR VARYING(24),
0004:     ORDERJPN      CHAR  VARYING(12),
0005:     FAMILYNAME    NCHAR VARYING(24),
0006:     FAMILYJPN     CHAR  VARYING(20),
0007:     GENUSNAME     NCHAR VARYING(24),
0008:     GENUSJPN      CHAR  VARYING(12),
0009:     SPECIESNAME   NCHAR VARYING(40),
0010:     SPECIESJPN    CHAR  VARYING(20),
0011:     SPECIESENG    NCHAR VARYING(40),
0012:     SPECIESENGCAP NCHAR VARYING(40)
0013: )
0014: RETURNS(
0015:     INSORDER   INTEGER,
0016:     INSFAMILY  INTEGER,
0017:     INSGENUS   INTEGER,
0018:     INSSPECIES INTEGER
0019: )
0020: AS
0021: BEGIN
0022:     IF ( EXISTS ( SELECT ORDERNAME FROM ORDERTAB
0023:                   WHERE ORDERNAME=:ORDERNAME ) ) THEN
0024:     BEGIN
0025:         IF (UPDT = 1) THEN
0026:             UPDATE ORDERTAB SET
0027:                 ORDERJPN=:ORDERJPN
0028:               WHERE ORDERNAME=:ORDERNAME;
0029:         INSORDER=0;
0030:     END
0031:     ELSE
0032:     BEGIN
0033:         INSERT INTO  ORDERTAB(
0034:             ORDERNAME,  ORDERJPN )
0035:           VALUES (      
0036:             :ORDERNAME, :ORDERJPN );
0037:         INSORDER=1;
0038:     END
0039:     IF ( EXISTS ( SELECT FAMILYNAME FROM FAMILY
0040:                   WHERE FAMILYNAME=:FAMILYNAME ) ) THEN
0041:     BEGIN
0042:         IF (UPDT = 1) THEN
0043:             UPDATE FAMILY SET
0044:                 ORDERNAME=:ORDERNAME,
0045:                 FAMILYJPN=:FAMILYJPN
0046:               WHERE FAMILYNAME=:FAMILYNAME;
0047:         INSFAMILY=0;
0048:     END
0049:     ELSE
0050:     BEGIN
0051:         INSERT INTO FAMILY(
0052:             ORDERNAME,  FAMILYNAME,  FAMILYJPN )
0053:           VALUES (      
0054:             :ORDERNAME, :FAMILYNAME, :FAMILYJPN );
0055:         INSFAMILY=1;
0056:     END
0057:     IF ( EXISTS ( SELECT GENUSNAME FROM GENUS
0058:                   WHERE GENUSNAME=:GENUSNAME ) ) THEN
0059:     BEGIN
0060:         IF (UPDT = 1) THEN
0061:             UPDATE GENUS SET
0062:                 FAMILYNAME=:FAMILYNAME,
0063:                 GENUSJPN=:GENUSJPN
0064:               WHERE GENUSNAME=:GENUSNAME;
0065:         INSGENUS=0;
0066:     END
0067:     ELSE
0068:     BEGIN
0069:         INSERT INTO GENUS(
0070:             FAMILYNAME,  GENUSNAME,  GENUSJPN )
0071:           VALUES (      
0072:             :FAMILYNAME, :GENUSNAME, :GENUSJPN );
0073:         INSGENUS=1;
0074:     END
0075:     IF ( EXISTS ( SELECT SPECIESNAME FROM SPECIES
0076:                   WHERE SPECIESNAME=:SPECIESNAME ) ) THEN
0077:     BEGIN
0078:         IF (UPDT = 1) THEN
0079:             UPDATE SPECIES SET
0080:                 GENUSNAME=:GENUSNAME,
0081:                 SPECIESJPN=:SPECIESJPN,
0082:                 SPECIESENG=:SPECIESENG,
0083:                 SPECIESENGCAP=:SPECIESENGCAP
0084:             WHERE SPECIESNAME=:SPECIESNAME;
0085:         INSSPECIES=0;
0086:     END
0087:     ELSE
0088:     BEGIN
0089:         INSERT INTO SPECIES(
0090:               GENUSNAME,  SPECIESNAME,  SPECIESJPN,  SPECIESENG,  SPECIESENGCAP )
0091:           VALUES (      
0092:              :GENUSNAME, :SPECIESNAME, :SPECIESJPN, :SPECIESENG, :SPECIESENGCAP );
0093:         INSSPECIES=1;
0094:     END
0095: END;

この HTML を検査する。( XHTML 1.0 Strict で書かれています )
Another HTML Lint Gateway ( Mirrored by htmllint.oosato.org )