Find the first row whose named column equals a value.

SolidGroundUX DocumentationSolidGroundUX
NL

fn: sgnd_dt_find_first

Purpose

Find the first row whose named column equals a value.

Arguments

  • $1 — Schema.
  • $2 — Name of table array.
  • $3 — Column name.
  • $4 — Value to match exactly.

Output

Prints the zero-based row index of the first match.

Returns

  • 0 when a row matches; 1 if no match or the column is invalid.

Usage

  rows=("Ada|admin")
  sgnd_dt_find_first "name|role" rows role admin