Cmdlets for AlloyDB

Build 24.0.9060

Update-AlloyDB Cmdlet

Parameters   Output Objects  

Updates AlloyDB data.

Syntax

Update-AlloyDB [parameters]

Remarks

The Update-AlloyDB cmdlet allows you to use a syntax similar to SQL UPDATE statements to update AlloyDB data.

$conn = Connect-AlloyDB -User 'alloydb' -Password 'admin' -Server '127.0.0.1' -Port '5432' -Database 'alloydb'
Update-AlloyDB -Connection $conn -Table "`"alloydb`".`"schema01`".Orders" -Columns @("ShipCity") -Values @("Raleigh") -Id "10261"
The Where parameter can also be used to specify the primary key of the table:
Update-AlloyDB -Connection $conn -Table "`"alloydb`".`"schema01`".Orders" -Columns @("ShipCity") -Values @("Raleigh") -Where "Id = '10261'"
The primary key can also be passed to the cmdlet along the pipeline:
Select-AlloyDB -Connection $conn -Table "alloydb"."schema01".Orders -Where "ShipCountry = 'USA'" | Update-AlloyDB -Columns @("ShipCountry") -Values @("USA 2")

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