Estrazione di dati

Per estrarre dei dati da un database mediante l'Extractor, č necessario specificare i dati che si desidera estrarre dal database utilizzando un file filtro di estrazione. Il filtro di estrazione che si utilizza dipende dal tipo di dati che si desidera estrarre.

Esempio di filtro di estrazione

Il seguente esempio di filtro di estrazione consente di estrarre informazioni su prodotti e categorie dalle tabelle CATGROUP, CATGRPDESC, CATGRPREL, CATENTRY, CATENTSHIP, OFFER, CATENTREL, CATGPENREL, CATENTDESC e ATTRVALUE:

  <sqlx>

    <!-- **************************** -->
    <!-- extract Category information -->
    <!-- **************************** -->

    <functionDef id="Category" description="Extract Categories" schemaentity="catgroup">
      <paramDef name=":lastRecord" type="string" value="10301" description="Last record 
       before loading new data" />
      <body>
        select * from catgroup where catgroup_id > :lastRecord
      </body>
    </functionDef>

    <execute id="Category" description="Extract Categories" schemaentity="catgroup">
      <param name=":lastRecord" type="string" value="10300" description="Last record 
       before loading new data" />
    </execute>

    <functionDef id="Category Description" description="Extract Category Descriptions 
     for a Locale" schemaentity="catgrpdesc">
      <paramDef name=":lastRecord" type="string" value="10300" description="Last record 
       before loading new data" />
      <body>
        select * from catgrpdesc where catgroup_id > :lastRecord
      </body>
    </functionDef>

    <execute id="Category Description" description="Extract Category Descriptions  
     for a Locale" schemaentity="catgrpdesc">
      <param name=":lastRecord" type="string" value="10300" description="Last record 
       before loading new data" />
    </execute>

    <functionDef id="Category Relationship" description="Extract Category-Relations  
     for a Locale" schemaentity="catgrprel">
      <paramDef name=":lastRecord" type="string" value="10300" description="Last record 
       before loading new data" />
      <body>
        select * from catgrprel where catgroup_id_child > :lastRecord
      </body>
    </functionDef>

    <execute id="Category Relationship" description="Extract Category-Relations for  
     a Locale" schemaentity="catgrprel">
      <param name=":lastRecord" type="string" value="10300" description="Last record 
       before loading new data" />
    </execute>

    <!-- *************************** -->
    <!-- extract Product information -->
    <!-- *************************** -->

    <functionDef id="Product" description="Extract Product" schemaentity="catentry">
      <paramDef name=":lastrecord" type="string" value="10300" description="Last record 
       before loading new data" />
      <body>
        select * from catentry where catentry_id > :lastrecord
      </body>
    </functionDef>

    <execute id="Product" description="Extract Product" schemaentity="catentry">
      <param name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
    </execute>

    <functionDef id="Product Relationship" description="Extract Product Ship 
     information" schemaentity="catentrel">
      <paramDef name=":lastrecord" type="string" value="10300" description="Last record 
       before loading new data" />
      <body>
        select * from catentrel where catentry_id_child > :lastrecord
      </body>
    </functionDef>

    <execute id="Product Relationship" description="Extract Product Ship information" 
     schemaentity="catentrel">
      <param name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
    </execute>

    <functionDef id="Product Description" description="Extract Product Description" 
     schemaentity="catentdesc">
      <paramDef name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
      <body>
        select * from catentdesc where catentry_id > :lastrecord
      </body>
    </functionDef>

    <execute id="Product Description" description="Extract Product Description" 
     schemaentity="catentdesc">
      <param name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
    </execute>

    <functionDef id="Product Ship" description="Extract Product Ship information" 
     schemaentity="catentship">
      <paramDef name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
      <body>
        select * from catentship where catentry_id > :lastrecord
      </body>
    </functionDef>

    <execute id="Product Ship" description="Extract Product Ship information" 
     schemaentity="catentship">
      <param name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
    </execute>

    <functionDef id="Category Product Relationship" description="Extract Category  
     Product Relations" schemaentity="catgpenrel">
      <paramDef name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
      <body>
        select * from catgpenrel where catgroup_id > :lastrecord
      </body>
    </functionDef>

    <execute id="Category Product Relationship" description="Extract Category Product 
     Relations" schemaentity="catgpenrel">
      <param name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
    </execute>

    <!-- **************************************** -->
    <!-- Extract Product Attribute Information    -->
    <!-- **************************************** -->

    <functionDef id="Product Attribute Values" description="Extract Product Attribute  
     values for a Locale" schemaentity="attrvalue">
      <paramDef name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
      <body>
        select * from attrvalue where catentry_id > :lastrecord
      </body>
    </functionDef>

    <execute id="Product Attribute Values" description="Extract Product Attribute values 
     for a Locale" schemaentity="attrvalue">
      <param name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
    </execute>

    <!-- ************************************************* -->
    <!-- Extract Product Price Information                 -->
    <!-- ************************************************* -->

    <functionDef id="Offer" description="Extract Offer" schemaentity="offer">
      <paramDef name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
      <body>
        select * from offer where catentry_id > :lastrecord
      </body>
    </functionDef>

    <execute id="Offer" description="Extract Offer" schemaentity="offer">
      <param name=":lastrecord" type="string" value="10300" description="Last record  
       before loading new data" />
    </execute>

  </sqlx>

Esempio di estrazione di dati

Nel seguente esempio vengono estratti i dati Membro Sistema da un database utilizzando MemberSubsystemFilter.xml come filtro di estrazione.

Windows NT Windows 2000 AIX Solaris Linux
java com.ibm.wca.MassExtract.Extract
-filter MemberSubsystemFilter.xml -outfile MemberSubsystemExtracted.xml
-dbname mall -dbuser myname  -dbpwd mypassword -customizer MemberSubsystemCustomizer

iSeries
QWEBCOMM/EXTWCSDTA FILTER(MemberSubsystemFilter.xml)
OUTFILE(MemberSubsystemExtracted.xml) DATABASE(database_name) 
SCHEMA(mall) INSTROOT(/QIBM/UserData/WebCommerce/instances/mser)
PASSWD(mypassword)

Argomenti correlati

Attivitā correlate

Riferimenti correlati

IBM copyright