Cmdlets for DB2

Build 23.0.8839

QueryResults Output Object (Select-DB2 Cmdlet)

The results of the query.


PSObject QueryResults


When executing a search, the results will be returned to the pipeline in a PSObject for each row, one row at a time. Each row object contains the columns of the table with their corresponding values. The row object also contains the table and the connection, which makes it easy to input these values to other cmdlets through a pipeline. Below is an example of a row object in JSON form:

PS C:\> $conn  = 
PS C:\> $row = Select-DB2 -Connection $conn -Table "`"Sample`".`"DB2INST1`".Books" -Columns (Id, Author)  -Where "Category = 'US'" | select -first 1
PS C:\> $row | ConvertTo-Json
  "Connection":  {

    "Table":  "`"Sample`".`"DB2INST1`".Books",
    "Columns":  [

    "Id":  "MyId",
    "Author":  "MyAuthor"

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