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

DECLARE
  v_err_msg VARCHAR2(200);
BEGIN 
  dbms_data_mining.import_model(filename=>'SAMP101.dmp',
                                directory=>'DM_DUMP',
                                model_filter=>'NMF_SAMPLE');
  dbms_output.put_line('IMPORT: job completed successfully!');
  
  EXCEPTION
    WHEN OTHERS THEN 
      v_err_msg := SUBSTR(SQLERRM, 1, 200);
      dbms_output.put_line('IMPORT job failed! Error='||v_err_msg);
END;
/
