UpdateRecord finds the named variable and sets its schema and row value.
(name string, schema sql.Schema, val sql.Row)
| 289 | |
| 290 | // UpdateRecord finds the named variable and sets its schema and row value. |
| 291 | func (is *InterpreterStack) UpdateRecord(name string, schema sql.Schema, val sql.Row) error { |
| 292 | for i := 0; i < is.stack.Len(); i++ { |
| 293 | if iv, ok := is.stack.PeekDepth(i).variables[name]; ok { |
| 294 | iv.Record = schema |
| 295 | iv.Value = val |
| 296 | return nil |
| 297 | } |
| 298 | } |
| 299 | return fmt.Errorf("record variable `%s` could not be found", name) |
| 300 | } |