Delen via


STRINGTONULL - Querytaal in Cosmos DB (in Azure en Fabric)

De STRINGTONULL functie converteert een tekenreeksexpressie naar null.

Met de STRINGTONULL functie wordt een tekenreeksexpressie geconverteerd naar null in Azure Cosmos DB for NoSQL.

Syntaxis

STRINGTONULL(<string_expr>)

Arguments

Description
string_expr Een tekenreeksexpressie.

Retourtypen

Geeft als resultaat een null.

Voorbeelden

Deze sectie bevat voorbeelden van het gebruik van deze querytaalconstructie.

Tekenreeks converteren naar null

In dit voorbeeld wordt de STRINGTONULL functie gebruikt om verschillende tekenreeksexpressies te converteren naar null.

SELECT VALUE {
  parseNullString: STRINGTONULL("null"),
  parseWithPrefix: STRINGTONULL("null  "),
  parseWithSuffix: STRINGTONULL("  null"),
  parseWithWhitespace: STRINGTONULL("  null  "),
  parseUppercase: STRINGTONULL("NULL"),
  parseTitlecase: STRINGTONULL("Null"),
  parseNull: STRINGTONULL(null),
  parseUndefined: STRINGTONULL(undefined)
}
[
  {
    "parseNullString": null,
    "parseWithPrefix": null,
    "parseWithSuffix": null,
    "parseWithWhitespace": null
  }
]

Opmerkingen

  • Deze functie maakt geen gebruik van de index.
  • Als de expressie niet kan worden geconverteerd, retourneert undefinedde functie .