![]() |
VOOZH | about |
The CData Cmdlets for Oracle SCM are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Oracle SCM.
The Cmdlets are not only a PowerShell interface to Oracle SCM, but also an SQL interface; this tutorial shows how to use both to retrieve Oracle SCM data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for Oracle SCM. To access Oracle SCM data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for Oracle SCM.
Once you have acquired the necessary connection properties, accessing Oracle SCM data in PowerShell can be enabled in three steps.
The following connection properties are required to connect to Oracle SCM data.
Install the module:
Install-Module OracleSCMCmdlets
Connect:
$oraclescm = Connect-OracleSCM -Url "$Url" -User "$User" -Password "$Password"
Search for and retrieve data:
$activeflag = "false" $carriers = Select-OracleSCM -Connection $oraclescm -Table "Carriers" -Where "ActiveFlag = `'$ActiveFlag`'" $carriers
You can also use the Invoke-OracleSCM cmdlet to execute SQL commands:
$carriers = Invoke-OracleSCM -Connection $oraclescm -Query 'SELECT * FROM Carriers WHERE ActiveFlag = @ActiveFlag' -Params @{'@ActiveFlag'='false'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Oracle SCM\lib\System.Data.CData.OracleSCM.dll")
Connect to Oracle SCM:
$conn= New-Object System.Data.CData.OracleSCM.OracleSCMConnection("Url=https://myinstance.oraclecloud.com;User=user;Password=password;")
$conn.Open()
Instantiate the OracleSCMDataAdapter, execute an SQL query, and output the results:
$sql="SELECT CarrierId, CarrierName from Carriers"
$da= New-Object System.Data.CData.OracleSCM.OracleSCMDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.carrierid $_.carriername
}
Download a free trial of the Oracle SCM Data Provider to get started:
Download NowLearn more:
👁 Oracle SCM IconRapidly create and deploy powerful .NET applications that integrate with Oracle SCM.