EssUpdateFileEx

Sends an update specification to the active database from a file, capturing any data load errors in ppMbrError.

Syntax

ESS_FUNC_M EssUpdateFileEx (hDestCtx, hSrcCtx, AppName, DbName, FileName, Store, Unlock, ppMbrError);
ParameterData TypeDescription

hDestCtx

ESS_HCTX_T

API context handle of the target databae on the server.

hSrcCtx

ESS_HCTX_T

API context handle for update file location. The update file can reside on the client or on the same server as the target database.

AppName

ESS_STR_T

Application name for update file location.

DbName

ESS_STR_T

Database name for update file location.

FileName

ESS_STR_T

Name of update specification file.

Store

ESS_BOOL_T

Controls storage of data. If TRUE, data is stored in the server; if FALSE, no data is stored.

Unlock

ESS_BOOL_T

Controls unlocking of data blocks. If TRUE, all relevant blocks which are locked will be unlocked (after data is stored, if necessary). If FALSE, no blocks are unlocked.

ppMbrError

ESS_PPMBRERR_T

Pointer to linked list of errors contained in ESS_MBRERR_T. Possible errors are:

  • AD_MSGDL_ERRORLOAD—Unable to do dataload at Item/Record [number].

  • ESS_MBRERR_BADDATA—Invalid member [membername] in data column.

  • ESS_MBRERR_DBACCESS—You have insufficient access privilege to perform a lock on this database.

  • ESS_MBRERR_DUPLICATE—Duplicate members from the same dimension on data record, [number] records completed.

  • ESS_MBRERR_UNKNOWN—Unknown member [membername] in dataload, [number] records returned.

Notes

Return Value

Returns zero if successful; otherwise, returns an error code and the records that caused the error.

Access

This function requires the caller to have write privilege (ESS_PRIV_WRITE) to the active database.

Example

void TestUpdateFileEx()
{
	ESS_STS_T sts = ESS_STS_NOERR;
	ESS_HCTX_T hSrcCtx;
	ESS_BOOL_T isStore;
	ESS_BOOL_T isUnlock;
	ESS_STR_T FileName;
	ESS_PMBRERR_T pMbrError;

	hSrcCtx  = hCtx; 
	FileName = "apgebso1.txt";
	isStore  = ESS_TRUE;
	isUnlock = ESS_FALSE;

	sts = EssUpdateFileEx (hCtx, hSrcCtx, AppName, DbName, FileName, isStore, isUnlock, &pMbrError);
	printf("EssUpdateFileEx sts: %ld\n",sts);
	if(!sts)
	{	
		printf("\nVerify data:\n");
		VerifyDataload("'Jan' 'New York' 'Actual' 'Sales' <IDESC '100'!");

		printf("\nMember Error Info:\n");
		if(pMbrError)
			DisplayError(pMbrError);
		else
			printf("\tError structure is empty.\n");
	}

	if(pMbrError)
		EssFree(hInst, pMbrError);
}

See Also