Bivalve molluscs: Dynamic search of genera/subgenera


http://porites.geology.uiowa.edu:8001/ows-bin/owa/biv_idform

PROCEDURE       BIV_IDFORM AS

CURSOR C1 IS
SELECT DISTINCT PAGETITLE
FROM BIVSBGEN
ORDER BY PAGETITLE;
 
 

X1 VARCHAR2 (100);

 BEGIN
 HTP.HTMLOPEN;
 HTP.HEADER(1,'<font color="red">Bivalve Genus Dynamic Search Tool</font>');
 HTP.P('<BODY BGCOLOR="#FFFFFF">');
 HTP.LINE;
 HTP.P('<BR><font size=+1 color="#005EBB">This is a quick way to search the database for a Genus
 (and Subgenus) you are looking for!</font><BR>');
 HTP.FORMOPEN('BIV_FORM2');
 HTP.PREOPEN;
 OPEN C1;
 FETCH C1 INTO X1;
 HTP.FORMSELECTOPEN('Page', 'Select Genus (and Subgenus): ');
 WHILE C1%FOUND LOOP
 HTP.FORMSELECTOPTION(X1);
 FETCH C1 INTO X1;
 END LOOP;
 CLOSE C1;
 HTP.FORMSELECTCLOSE;
 HTP.PRECLOSE;
 HTP.FORMRESET;
 HTP.FORMSUBMIT;
 HTP.FORMCLOSE;
 HTP.LINE;
 HTP.HTMLCLOSE;
END;

 PROCEDURE       BIV_FORM2 (
PAGE VARCHAR2 := NULL) AS
 CURSOR C1 IS
  SELECT BIVIMAGE.ILLUSFILE, BIVIMAGE.BIGILLUS,
  BIVIMAGE.GENUSNAME, BIVIMAGE.SUBGENUSNAME, BIVIMAGE.SBGNNAME,
  BIVIMAGE.SPECIESNAME, BIVIMAGE.VALVE, BIVIMAGE.ILLVIEW,
  BIVIMAGE.NMITAIDNO, BIVIMAGE.NMBLOC, BIVOCCUR.PPPNUMBER,
  BIVOCCUR.NMBLOC, BIVLOCAT.PPPNUMBER, BIVLOCAT.LOCALITY,
                BIVLOCAT.REGION, BIVLOCAT.CNTRY, BIVSBGEN.PAGETITLE,
                BIVSBGEN.GENUSNAME, BIVSBGEN.SBGNNAME
  FROM BIVIMAGE, BIVOCCUR, BIVLOCAT, BIVSBGEN
  WHERE (BIVSBGEN.PAGETITLE = PAGE)
                AND (BIVSBGEN.GENUSNAME = BIVIMAGE.GENUSNAME)
                AND (BIVSBGEN.SBGNNAME = BIVIMAGE.SBGNNAME)
  AND (BIVOCCUR.NMBLOC = BIVIMAGE.NMBLOC)
  AND (BIVLOCAT.PPPNUMBER = BIVOCCUR.PPPNUMBER)
  ORDER BY BIVIMAGE.NMITAIDNO;
 

        CURSOR C2 IS
  SELECT DISTINCT BIVDISTR.GENUSNAME, BIVDISTR.SBGNNAME,
  BIVDISTR.PPPNUMBER, BIVLOCAT.PPPNUMBER, BIVLOCAT.GEOLAGE,
  BIVLOCAT.FORMATION, BIVLOCAT.LOCALITY, BIVLOCAT.REGION,
  BIVLOCAT.CNTRY, BIVSBGEN.PAGETITLE,
                BIVSBGEN.GENUSNAME, BIVSBGEN.SBGNNAME
  FROM BIVDISTR, BIVLOCAT, BIVSBGEN
  WHERE (BIVSBGEN.PAGETITLE = PAGE)
  AND (BIVSBGEN.GENUSNAME=BIVDISTR.GENUSNAME)
  AND (BIVSBGEN.SBGNNAME=BIVDISTR.SBGNNAME)
  AND (BIVLOCAT.PPPNUMBER=BIVDISTR.PPPNUMBER)
                AND (BIVLOCAT.CNTRY = 'Costa Rica')
  ORDER BY BIVLOCAT.REGION;
 
 

         CURSOR C3 IS
                SELECT DISTINCT BIVDISTR.GENUSNAME, BIVDISTR.SBGNNAME,
  BIVDISTR.PPPNUMBER, BIVLOCAT.PPPNUMBER, BIVLOCAT.GEOLAGE,
  BIVLOCAT.FORMATION, BIVLOCAT.LOCALITY, BIVLOCAT.REGION,
  BIVLOCAT.CNTRY, BIVSBGEN.PAGETITLE,
                BIVSBGEN.GENUSNAME, BIVSBGEN.SBGNNAME
  FROM BIVDISTR, BIVLOCAT, BIVSBGEN
  WHERE (BIVSBGEN.PAGETITLE = PAGE)
  AND (BIVSBGEN.GENUSNAME=BIVDISTR.GENUSNAME)
  AND (BIVSBGEN.SBGNNAME=BIVDISTR.SBGNNAME)
  AND (BIVLOCAT.PPPNUMBER=BIVDISTR.PPPNUMBER)
                AND (BIVLOCAT.CNTRY = 'Panama')
  ORDER BY BIVLOCAT.REGION;
 
 

         CURSOR C4 IS
                SELECT DISTINCT BIVDISTR.GENUSNAME, BIVDISTR.SBGNNAME,
  BIVDISTR.PPPNUMBER, BIVLOCAT.PPPNUMBER, BIVLOCAT.GEOLAGE,
  BIVLOCAT.FORMATION, BIVLOCAT.LOCALITY, BIVLOCAT.REGION,
  BIVLOCAT.CNTRY, BIVSBGEN.PAGETITLE,
                BIVSBGEN.GENUSNAME, BIVSBGEN.SBGNNAME
  FROM BIVDISTR, BIVLOCAT, BIVSBGEN
  WHERE (BIVSBGEN.PAGETITLE = PAGE)
  AND (BIVSBGEN.GENUSNAME=BIVDISTR.GENUSNAME)
  AND (BIVSBGEN.SBGNNAME=BIVDISTR.SBGNNAME)
  AND (BIVLOCAT.PPPNUMBER=BIVDISTR.PPPNUMBER)
                AND (BIVLOCAT.CNTRY !='Costa Rica')
                AND (BIVLOCAT.CNTRY !='Panama')
  ORDER BY BIVLOCAT.CNTRY, BIVLOCAT.REGION;
 
 
 
 

X1 VARCHAR2 (100);
X2 VARCHAR2 (100);
X3 VARCHAR2 (100);
X4 VARCHAR2 (100);
X5 VARCHAR2 (100);
X6 VARCHAR2 (100);
X7 VARCHAR2 (100);
X8 VARCHAR2 (100);
X9 VARCHAR2 (100);
X10 VARCHAR2 (100);
X11 VARCHAR2 (100);
X12 VARCHAR2 (100);
X13 VARCHAR2 (100);
X14 VARCHAR2 (100);
X15 VARCHAR2 (100);
X16 VARCHAR2 (100);
X17 VARCHAR2 (100);
X18 VARCHAR2 (100);
X19 VARCHAR2 (100);
X20 VARCHAR2 (100);
X21 VARCHAR2 (100);
X22 VARCHAR2 (100);
X23 VARCHAR2 (100);
X24 VARCHAR2 (100);
X25 VARCHAR2 (100);
X26 VARCHAR2 (100);
X27 VARCHAR2 (100);
X28 VARCHAR2 (100);
X29 VARCHAR2 (100);
X30 VARCHAR2 (100);
X31 VARCHAR2 (100);
X32 VARCHAR2 (100);
X33 VARCHAR2 (100);
X34 VARCHAR2 (100);
X35 VARCHAR2 (100);
X36 VARCHAR2 (100);
X37 VARCHAR2 (100);
X38 VARCHAR2 (100);
X39 VARCHAR2 (100);
X40 VARCHAR2 (100);
X41 VARCHAR2 (100);
 
 

BEGIN
 HTP.HTMLOPEN;
 HTP.TITLE('NMITA: Bivalve '||Page||' Genus Page');
 HTP.P('<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#009191" VLINK="#551A8B" ALINK="#00CACA">');
 HTP.HEADER(1,'<img SRC="nmitalog.gif" HSPACE=6
 VSPACE=3 BORDER=2 height=32 width=32 align=LEFT><b><font size=+1><font color="#005EBB">
 NMITA:</font><font color="#CA0065">N</font><font color="#005EBB">eogene</font>
 <font color="#CA0065">M</font><font color="#005EBB">arine
 B</font><font color="#CA0065">i</font><font color="#005EBB">ota of </font>
 <font color="#CA0065">T</font><font color="#005EBB">ropical</font><font color="#CA0065">
 A</font><font color="#005EBB">merica</font></font></b>
 ');
 HTP.NL;
 HTP.LINE;

 HTP.HEADER(1, '<CENTER><I>'||PAGE||'</I></CENTER>');
 HTP.P('<HR ALIGN=CENTER SIZE = 2 WIDTH = 40%><BR>');

        HTP.NL;
        HTP.NL;
        HTP.P('<TABLE BORDER>');
 OPEN C1;
        FETCH C1 INTO X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19;
 WHILE C1%FOUND LOOP
  HTP.P('<TR><TD align=center><img src=http://nmita.geology.uiowa.edu/database/bivalves/systemat/'||X1||'
  width=300 hspace=2 vspace=2>');
 HTP.P(X1);
 HTP.PARAGRAPH;
             HTP.P('(C) Naturhistorisches Museum Basel</TD>');
 HTP.P('<TD>');
  HTP.BOLD('<I><font size=+1>Specimen details:</font></I><BR>');
  HTP.P('<I>'||PAGE||' '||X6||'</I>, '||X8||';<BR>');
  HTP.P('NMITA specimen '||X9||', NMB locality '||X10||', ');
         HTP.P('PPP '||X13||', '||X14||', '||X15||', '||X16||'.');
                HTP.P('<BR><BR><a href="database/bivalves/systemat/'||X2||'"><B>- Enlarge Image -</B></a>');
  HTP.P('</TD></TR>');

 FETCH C1 INTO X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13,X14,X15,X16,X17,X18,X19;
        END LOOP;
        CLOSE C1;
        HTP.P('</TABLE>');
 

       HTP.NL;
       HTP.NL;
       HTP.P('<B><I><FONT SIZE=+1>Occurrences:</FONT></I></B><BR><BR>');
 
 
 

       OPEN C2;
       FETCH C2 INTO X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31;
       HTP.P('<B>Costa Rica:</B>');
       HTP.ULISTOPEN;
       WHILE C2%FOUND LOOP

         IF X26 = X27 THEN
          IF (X24 IS NOT NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '||X25||' Formation, '
                 ||X26||', '||X28||'.');
                 ELSIF (X24 IS NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X25||' Formation, '
                 ||X26||', '||X28||'.');
                 ELSIF (X24 IS NOT NULL AND X25 IS NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '
                 ||X26||', '||X28||'.');
                 ELSE
                 HTP.LISTITEM('PPP '||X23||', '
                 ||X26||', '||X28||'.');
                 END IF;
         ELSE
                 IF (X24 IS NOT NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '||X25||' Formation, '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSIF (X24 IS NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X25||' Formation, '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSIF (X24 IS NOT NULL AND X25 IS NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSE
                 HTP.LISTITEM('PPP '||X23||', '
                 ||X26||', '||X27||', '||X28||'.');
                 END IF;
  END IF;
       FETCH C2 INTO X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31;
       END LOOP;
       CLOSE C2;
       HTP.ULISTCLOSE;
       HTP.NL;
 
 
 

       OPEN C3;
       FETCH C3 INTO X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31;
       HTP.P('<B>Panama:</B>');
       HTP.ULISTOPEN;
       WHILE C3%FOUND LOOP

                IF X26 = X27 THEN
          IF (X24 IS NOT NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '||X25||' Formation, '
                 ||X26||', '||X28||'.');
                 ELSIF (X24 IS NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X25||' Formation, '
                 ||X26||', '||X28||'.');
                 ELSIF (X24 IS NOT NULL AND X25 IS NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '
                 ||X26||', '||X28||'.');
                 ELSE
                 HTP.LISTITEM('PPP '||X23||', '
                 ||X26||', '||X28||'.');
                 END IF;
         ELSE
                 IF (X24 IS NOT NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '||X25||' Formation, '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSIF (X24 IS NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X25||' Formation, '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSIF (X24 IS NOT NULL AND X25 IS NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSE
                 HTP.LISTITEM('PPP '||X23||', '
                 ||X26||', '||X27||', '||X28||'.');
                 END IF;
                END IF;
       FETCH C3 INTO X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31;
       END LOOP;
       CLOSE C3;
       HTP.ULISTCLOSE;
       HTP.NL;
 

       OPEN C4;
       FETCH C4 INTO X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31;
       HTP.P('<B>Other:</B>');
       HTP.ULISTOPEN;
       WHILE C4%FOUND LOOP

                IF X26 = X27 THEN
          IF (X24 IS NOT NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '||X25||' Formation, '
                 ||X26||', '||X28||'.');
                 ELSIF (X24 IS NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X25||' Formation, '
                 ||X26||', '||X28||'.');
                 ELSIF (X24 IS NOT NULL AND X25 IS NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '
                 ||X26||', '||X28||'.');
                 ELSE
                 HTP.LISTITEM('PPP '||X23||', '
                 ||X26||', '||X28||'.');
                 END IF;
         ELSE
                 IF (X24 IS NOT NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '||X25||' Formation, '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSIF (X24 IS NULL AND X25 IS NOT NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X25||' Formation, '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSIF (X24 IS NOT NULL AND X25 IS NULL) THEN
                 HTP.LISTITEM('PPP '||X23||', '||X24||', '
                 ||X26||', '||X27||', '||X28||'.');
                 ELSE
                 HTP.LISTITEM('PPP '||X23||', '
                 ||X26||', '||X27||', '||X28||'.');
                 END IF;
  END IF;
       FETCH C4 INTO X20,X21,X22,X23,X24,X25,X26,X27,X28,X29,X30,X31;
       END LOOP;
       CLOSE C4;
       HTP.ULISTCLOSE;

       HTP.NL;
       HTP.P('<hr ALIGN=LEFT WIDTH=100%><b>Return to:<BR>');
       HTP.ULISTOPEN;
       HTP.LISTITEM('<a href="">
       NMITA homepage</a>');
       HTP.LISTITEM('<a href="database/bivalves/bivalmnu.htm">Bivalves</a>');
       HTP.LISTITEM('<a href="database/bivalves/systemat/bivalgen.htm">List of Bivalve Genera</a></b>');
       HTP.LISTITEM('<font color = red> Temporary Link!! </font> <a href="http://nmita.geology.uiowa.edu:8001/ows-bin/owa/BIV_IDFORM">Dynamic Search of Bivalve Genera</a></b>');HTP.ULISTCLOSE;
       HTP.HTMLCLOSE;
END;




Last updated on April 29, 2000-afb.