Skip to content

Commit

Permalink
suuport for BOOLEAN
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilravuri1 committed May 10, 2019
1 parent 64aba5f commit 65246eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion error.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
package go_ibm_db

import (
"github.com/ibmdb/go_ibm_db/api"
"database/sql/driver"
"fmt"
"strings"
"unsafe"

"github.com/ibmdb/go_ibm_db/api"
)

func IsError(ret api.SQLRETURN) bool {
Expand Down
1 change: 0 additions & 1 deletion odbcstmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func (s *ODBCStmt) releaseHandle() error {
var testingIssue5 bool // used during tests

func (s *ODBCStmt) Exec(args []driver.Value) error {

if len(args) != len(s.Parameters) {
return fmt.Errorf("wrong number of arguments %d, %d expected", len(args), len(s.Parameters))
}
Expand Down
9 changes: 5 additions & 4 deletions param.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
package go_ibm_db

import (
"github.com/ibmdb/go_ibm_db/api"
"database/sql/driver"
"fmt"
"time"
"unsafe"

"github.com/ibmdb/go_ibm_db/api"
)

type Parameter struct {
Expand Down Expand Up @@ -76,14 +77,14 @@ func (p *Parameter) BindValue(h api.SQLHSTMT, idx int, v driver.Value) error {
sqltype = api.SQL_BIGINT
size = 8
case bool:
var b byte
var b int
if d {
b = 1
}
ctype = api.SQL_C_BIT
ctype = api.SQL_C_SBIGINT
p.Data = &b
buf = unsafe.Pointer(&b)
sqltype = api.SQL_BIT
sqltype = api.SQL_BIGINT
size = 1
case float64:
ctype = api.SQL_C_DOUBLE
Expand Down

0 comments on commit 65246eb

Please sign in to comment.