Cmdlets for Amazon Redshift

Build 24.0.8963

Update-Redshift Cmdlet

Parameters   Output Objects  

Updates Amazon Redshift data.

Syntax

Update-Redshift [parameters]

Remarks

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

$conn = Connect-Redshift -User 'admin' -Password 'admin' -Server 'examplecluster.my.us-west-2.redshift.amazonaws.com' -Port '5439' -Database 'dev'
Update-Redshift -Connection $conn -Table "`"sales_db`".`"public`".Orders" -Columns @("ShipCity") -Values @("Raleigh") -Id "10261"
The Where parameter can also be used to specify the primary key of the table:
Update-Redshift -Connection $conn -Table "`"sales_db`".`"public`".Orders" -Columns @("ShipCity") -Values @("Raleigh") -Where "Id = '10261'"
The primary key can also be passed to the cmdlet along the pipeline:
Select-Redshift -Connection $conn -Table "sales_db"."public".Orders -Where "ShipCountry = 'USA'" | Update-Redshift -Columns @("ShipCountry") -Values @("USA 2")

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