Cmdlets for DB2

Build 23.0.8839

Update-DB2 Cmdlet

Parameters   Output Objects  

Updates DB2 data.

Syntax

Update-DB2 [parameters]

Remarks

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

$conn = 
Update-DB2 -Connection $conn -Table "`"Sample`".`"DB2INST1`".Books" -Columns @("Author") -Values @("Jon Doe") -Id "22"
The Where parameter can also be used to specify the primary key of the table:
Update-DB2 -Connection $conn -Table "`"Sample`".`"DB2INST1`".Books" -Columns @("Author") -Values @("Jon Doe") -Where "Id = '22'"
The primary key can also be passed to the cmdlet along the pipeline:
Select-DB2 -Connection $conn -Table "Sample"."DB2INST1".Books -Where "Category = 'US'" | Update-DB2 -Columns @("Category") -Values @("US 2")

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