Database Reference
In-Depth Information
/*
Purpose: Load Data
Written by: Cameron Lackpour
Modified: 11 November 2011, initial write
Notes: Parameter variables:
-- $1 = Script name
-- $2 = Application name
-- $3 = Database name
hDynSQL uses the following artifacts:
-- Essbase substitution variables:
&ASOsamp_CurYear and
&ASOsamp_CurMonth
*/
/* Turn on timestamping */
set timestamp on ;
/* Define STDOUT and STDERR outputs */
spool stdout on to "c:\\\\Tempdir\\\\MaxL\\\\Logs\\\\$1.log" ;
iferror "LogFile" ;
spool stderr on to "c:\\\\Tempdir\\\\MaxL\\\\Logs\\\\$1.err" ;
iferror "ErrorFile" ;
/* Log in to Essbase */
login admin epmtestdrive on metavero ;
iferror 'Login' ;
/* Clear out the current month's data using logical clear */
alter database $2.$3 clear data in region '{([&ASOsamp_CurMonth],
[&ASOsamp_CurYear])}' ;
iferror 'Clear' ;
/* Create a load buffer for data */
alter database $2.$3 initialize load_buffer with buffer_id 1
resource_usage .5 property ignore_missing_values, ignore_zero_
values, aggregate_sum ;
iferror 'CreateBuffer' ;
/* Load data to buffer
NB -- Even though this is a single source, use the load buffer to
sort and preagg duplicate records. */
import database $2.$3 data connect as 'hypsql' identified by 'hypsql'
using server rules_file 'dCurMth' to load_buffer with buffer_id 1 on
error write to "c:\\\\Tempdir\\\\MaxL\\\\Logs\\\\dCurMth.err" ;
iferror "DataLoadToBUffer" ;
/* Commit load buffer to Essbase */
import database $2.$3 data from load_buffer with buffer_id 1 add
values create slice ;
iferror 'LoadFromBuffer' ;
/*
Quit MaxL without a predefined error code */
exit ;
/* Create label for login errors */
define label "Login" ;
/* Quit MaxL with a 10 error code */
exit 10 ;
/*
Create label for log file errors */
Search WWH ::




Custom Search