Rem
Rem $Header: exp_all.sql 25-jun-2003.16:50:57 gtang Exp $
Rem
Rem exp_all.sql
Rem
Rem Copyright (c) 2003, Oracle Corporation.  All rights reserved.  
Rem
Rem    NAME
Rem      exp_all.sql - Data Mining model export demo
Rem
Rem    DESCRIPTION
Rem      This script demonstrates the use of export_model(),
Rem      to export all models in the user schema
Rem
Rem    NOTES
Rem     Prerequisits:
Rem     - directory object 'DM_DUMP' is already creaed
Rem     - the user has WRITE priviledge on 'DM_DUMP'
Rem     - at least 1 model has been created in the user schema
Rem
Rem    MODIFIED   (MM/DD/YY) 
Rem    gtang       06/25/03 - gtang_txn107754
Rem    gtang       06/24/03 - Creation
Rem

DECLARE
  file_name VARCHAR2(30) := 'SAMP1';
  v_err_msg VARCHAR2(200);
BEGIN 
  dmsys.dbms_data_mining.export_model(filename=>file_name,
                                      directory=>'DM_DUMP');
  
  EXCEPTION
    WHEN OTHERS THEN 
      v_err_msg := SUBSTR(SQLERRM, 1, 200);
      dbms_output.put_line('EXPORT Sample failed! Error='||v_err_msg);

END;
/