Rem
Rem $Header: imp_infil.sql 25-jun-2003.16:51:00 gtang Exp $
Rem
Rem imp_infil.sql
Rem
Rem Copyright (c) 2003, Oracle Corporation.  All rights reserved.  
Rem
Rem    NAME
Rem      imp_infil.sql - Data Mining model import demo
Rem
Rem    DESCRIPTION
Rem      This script demonstrates the use of import_model(),
Rem      to import specific models from a dump using filter
Rem
Rem    NOTES
Rem     Prerequisits:
Rem     - a dump file set was created by expdp or export_model()
Rem     - the dump sits in the directory mapped by directory 'DM_DUMP'
Rem     - the user has READ and WRITE priviledge on 'DM_DUMP'
Rem     - the dump file set contains named models
Rem
Rem    MODIFIED   (MM/DD/YY) 
Rem    gtang       06/25/03 - gtang_txn107754
Rem    gtang       04/15/03 - Creation
Rem

DECLARE
  v_err_msg VARCHAR2(200);
  names     VARCHAR2(200) := 
                    'name IN (''NAIVE_BAYES_SAMPLE'',''ASSOCIATION_RULES_SAMPLE'', ''ABN_CLAS_SAMPLE'')';
BEGIN 
  dbms_data_mining.import_model(filename=>'SAMP1%U.dmp',
                                directory=>'DM_DUMP',
                                model_filter=>names);
  dbms_output.put_line('imptst04: job completed successfully!');
  
  EXCEPTION
    WHEN OTHERS THEN 
      v_err_msg := SUBSTR(SQLERRM, 1, 200);
      dbms_output.put_line('Partial IMPORT TEST failed! Error='||v_err_msg);
END;
/
