Rem
Rem $Header: exp_est.sql 25-jun-2003.16:50:58 gtang Exp $
Rem
Rem exp_est.sql
Rem
Rem Copyright (c) 2003, Oracle Corporation.  All rights reserved.  
Rem
Rem    NAME
Rem      exp_est.sql - Data Mining model export demo
Rem
Rem    DESCRIPTION
Rem      This script demonstrates the use of export_model(),
Rem      to estimate disk space required for exporting all
Rem      user models
Rem
Rem    NOTES
Rem     Prerequisits:
Rem     - directory object 'DM_DUMP' is already creaed
Rem     - the user has WRITE priviledge on 'DM_DUMP'
Rem
Rem    MODIFIED   (MM/DD/YY) 
Rem    gtang       06/25/03 - gtang_txn107754
Rem    gtang       06/24/03 - Creation
Rem

DECLARE
  job_name  VARCHAR2(30) := 'estimat1';
  v_err_msg  VARCHAR2(200);
BEGIN 
  dmsys.dbms_data_mining.export_model (filename=>job_name,
                                       directory=>'DM_DUMP',
                                       operation=>'ESTIMATE',
                                       jobname=>job_name);
  
  EXCEPTION
    WHEN OTHERS THEN 
      v_err_msg := SUBSTR(SQLERRM, 1, 200);
      dbms_output.put_line('EXPORT TEST failed! Error='||v_err_msg);

END;
/