Cmdlets for SAP ERP

Build 24.0.9060

CacheProvider Parameter (Connect-SAPERP Cmdlet)

The name of the provider to be used to cache data.

Syntax

Connect-SAPERP -CacheProvider string

Data Type

cstr

Default Value

""

Remarks

You can cache to any database for which you have an ADO.NET provider. The caching database is determined based on the CacheProvider and CacheConnection properties.

The following sections show connection examples and address other requirements for several popular database drivers. Refer to CacheConnection for more information on typical connection properties.

Loading the Caching Database's Driver

The CacheProvider property specifies the name of the DbProviderFactory used to cache data. You can find the provider factories available to you in your machine.config.

SQLite

You can use the Microsoft ADO.NET Provider for SQLite to cache to SQLite databases.

CacheProvider=Microsoft.Data.Sqlite;CacheConnection='DataSource=C:\\Users\\Public\\cache.db;'Host=sap.mydomain.com;User=EXT90033;Password=xxx;Client=800;System Number=09;ConnectionType=Classic;
You can persist the results of your queries while online for later use while offline: Set the AutoCache parameter in the Connect-SAPERP cmdlet and invoke the Select-SAPERP cmdlet, as shown in the following example:
Connect-SAPERP -Host 'sap.mydomain.com' -User 'EXT90033' -Password 'xxx' -Client '800' -SystemNumber '09' -ConnectionType 'Classic' -CacheProvider 'Microsoft.Data.Sqlite' -CacheConnection 'DataSource=C:\\Users\\Public\\cache.db;' -AutoCache | Select-SAPERP -Table "MARA" -Where "ERNAM = 'BEHRMANN'"

MySQL

To cache to MySQL, you can use the included CData ADO.NET Provider for MySQL:
Cache Provider=System.Data.CData.MySQL;Cache Connection='Server=localhost;Port=3306;Database=cache;User=root;Password=123456';User=myUser;Password=myPassword;Security Token=myToken;
You can persist the results of your queries while online for later use while offline: Set the AutoCache parameter in the Connect-SAPERP cmdlet and invoke the Select-SAPERP cmdlet:
Connect-SAPERP -Host 'sap.mydomain.com' -User 'EXT90033' -Password 'xxx' -Client '800' -SystemNumber '09' -ConnectionType 'Classic' -CacheProvider 'System.Data.CData.MySQL' -CacheConnection 'Server=localhost;Port=3306;Database=cache;User=root;Password=123456' -AutoCache | Select-SAPERP -Table "MARA" 

SQL Server

You can use the Microsoft .NET Framework Provider for SQL Server, included in the .NET Framework, to cache to SQL Server:

Cache Provider=System.Data.SqlClient;Cache Connection="Server=MyMACHINE\MyInstance;Database=SQLCACHE;User Id=root;Password=admin";Host=sap.mydomain.com;User=EXT90033;Password=xxx;Client=800;System Number=09;ConnectionType=Classic;
You can persist the results of your queries while online for later use while offline: Set the AutoCache parameter in the Connect-SAPERP cmdlet and invoke the Select-SAPERP cmdlet:
Connect-SAPERP -Host 'sap.mydomain.com' -User 'EXT90033' -Password 'xxx' -Client '800' -SystemNumber '09' -ConnectionType 'Classic' -CacheProvider 'System.Data.SqlClient' -CacheConnection 'Server=MyMACHINE\MyInstance;Database=SQLCACHE;User Id=root;Password=admin' -AutoCache | Select-SAPERP -Table "MARA" 

Oracle

To cache to Oracle, you can use the Oracle Data Provider for .NET, as shown in the following example:

Cache Provider=Oracle.DataAccess.Client;Cache Connection='User Id=scott;Password=tiger;Data Source=ORCL';Host=sap.mydomain.com;User=EXT90033;Password=xxx;Client=800;System Number=09;ConnectionType=Classic;

The Oracle Data Provider for .NET also requires the Oracle Database Client. When you download the Oracle Database Client, ensure that the bitness matches the the bitness of your machine. When you install select either the Runtime or Administrator installation type;, the Instant Client is not sufficient. You can persist the results of your queries while online for later use while offline: Set the AutoCache parameter in the Connect-SAPERP cmdlet and invoke the Select-SAPERP cmdlet, as shown in the following example:

Connect-SAPERP -Host 'sap.mydomain.com' -User 'EXT90033' -Password 'xxx' -Client '800' -SystemNumber '09' -ConnectionType 'Classic' -CacheProvider 'Oracle.DataAccess.Client' -CacheConnection "User Id=scott;Password=tiger;Data Source=ORCL" -AutoCache | Select-SAPERP -Table "MARA"

PostgreSQL

To cache to PostgreSQL, you can use the included CData ADO.NET Provider for PostgreSQL:
Cache Provider=System.Data.CData.PostgreSQL;Cache Connection='Server=localhost;Port=5432;Database=cache;User=postgres;Password=123456';User=myUser;Password=myPassword;Security Token=myToken;
You can persist the results of your queries while online for later use while offline: Set the AutoCache parameter in the Connect-SAPERP cmdlet and invoke the Select-SAPERP cmdlet:
Connect-SAPERP -Host 'sap.mydomain.com' -User 'EXT90033' -Password 'xxx' -Client '800' -SystemNumber '09' -ConnectionType 'Classic' -CacheProvider 'System.Data.CData.PostgreSQL' -CacheConnection 'Server=localhost;Port=5432;Database=cache;User=root;Password=123456' -AutoCache | Select-SAPERP -Table "MARA" 

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060