directExec

command
v0.0.0-...-e06baaf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

This example shows how to utilize the DirectExecer interface to receive both the driver.Rows and driver.Result of a SQL query.

go-ase offers two methods on go-ase connections - GenericExec and DirectExec. They are functionally identical as DirectExec is a wrapper around GenericExec and takes interface{}s als values for the placeholders within an SQL statement, rather than driver.Values.

E.g.:

if rows, result, err := conn.GenericExec(ctx, "select * from table where a = ?", driver.Value{5}); err != nil {
  return err
}

if rows, result, err := conn.DirectExec(ctx, "select * from table where a = ?", 5); err != nil {
  return err
}

These methods are primarily useful when using stored procedures which may return both rows and the number of affected rows.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL