<?xml version="1.0" encoding="UTF-8"?>

<!-- <!DOCTYPE sddlschema SYSTEM "sddlschema.xsd">-->

<sddl>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- -->
<!--  SDDL Name:    STIS_FRINGETMP_EXTERNALS.SDDL     -->
<!-- -->
<!--  Purpose:      This SDDL file defines relation STIS_FRINGETMP_EXTERNALS-->
<!-- -->
<!--  Modification History:-->
<!-- -->
<!--    Date       OPR      Who              Reason -->
<!-- - - - - - -   - - -   - - - -   - - - - - - - - - - - - - - - - - - - -->
<!--  07/09/09   62815      Sherbert         first version -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

    <record name="STIS_FRINGETMP_EXTERNALS_TYPE">

           <description>
                  This SDDL file defines relation STIS_FRINGETMP_EXTERNALS, 
                  a permanent but volatile table to contain only STIS 
                  external science exposures from the SMS being 
                  processed, used along the way to filling the stis_fringeflat 
                  table by insert_stis_fringeflats_records.pl.  
                  This is being created to avoid the problems encountered 
                  with temporary tables that can disappear in the middle 
                  of complex involved queries.
                </description>
  
           <field name="program_id">
                   <type>C3</type>
                   <description>The program_id field
                                from SPSS qobservation table 
                        </description>
           </field>

           <field name="obset_id">
                   <type>C2</type>
                   <description>The obset_id field
                                from SPSS qobservation table
                        </description>
           </field>

           <field name="ob_number">
                   <type>C2</type>
                   <description>The ob_number field
                                from SPSS qobservation table
                        </description>
           </field>

           <field name="proposal_id">
                   <type>C5</type>
                   <description>The proposal_id field 
                                from SPSS qolink table
                        </description>
           </field>

           <field name="alignment_id">
                   <type>C2</type>
                   <description>The alignment_id field 
                                from SPSS qolink table
                        </description>
           </field>

           <field name="exposure_id">
                   <type>C2</type>
                   <description>The exposure_id field 
                                from SPSS qolink table
                        </description>
           </field>

           <field name="version_num">
                   <type>C2</type>
                   <description>The version_num field 
                                from SPSS qolink table
                        </description>
           </field>

           <field name="sp_1">
                   <type>C20</type>
                   <description>The spectral element (sp_1 field) 
                                from SPSS qelogsheet table
                        </description>
           </field>

           <field name="minwave">
                   <type>R8</type>
                   <description>The minimum wavelength (minwave field) 
                                from SPSS qelogsheet table
                        </description>
           </field>

           <field name="sunit_id">
                   <type>C7</type>
                   <description>The sunit_id field 
                                from SPSS qsbranching table
                        </description>
           </field>

           <field name="pred_strt_tm">
                   <type>C17</type>
                   <description>The predicted start time (pred_strt_tm field) 
                                from SPSS qobservation table
                        </description>
           </field>

    </record>


    <relation name="stis_fringetmp_externals">

        <type>STIS_FRINGETMP_EXTERNALS_TYPE</type>

        <description>
                  A permanent temporary table to contain only STIS 
                  external science exposures from the SMS being 
                  processed, used along the way to filling the stis_fringeflat 
                  table by insert_stis_fringeflats_records.pl.  
             </description>

        <subsystem_using>OPUS</subsystem_using>

        <index name="stis_fringetmp_ext_1">
            <type>unique clustered</type>
            <field name="program_id"/>
            <field name="obset_id"/>
            <field name="ob_number"/>
            <attr>ignore_dup_key</attr>
        </index>

    </relation>

    <instance  name="STIS_FRINGETMP_EXTERNALS" 
               scope="global" 
               type="STIS_FRINGETMP_EXTERNALS_TYPE" />
</sddl>
