Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

database/sql: way to execute the SQL directly without prepare for IBM/DB2 #37014

Closed
akhilravuri1 opened this issue Feb 4, 2020 · 6 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@akhilravuri1
Copy link

akhilravuri1 commented Feb 4, 2020

What version of Go are you using (go version)?

$ go version
go version go1.13.4 windows/amd64

Does this issue reproduce with the latest release?

NO

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\rakhil\AppData\Local\go-build
set GOENV=C:\Users\rakhil\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\rakhil\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\rakhil\AppData\Local\Temp\go-build747585790=/tmp/go-build -gno-record-gcc-switches

What did you do?

I was trying to create a view in the BIGSQL database by IBM using the go_ibm_db package which is based on your database/sql package but it was not created because your database/sql uses prepare and query API's even if we call exec. But for creating a view and altering table BIGSQL throws an error if we use prepare and query instead of execdirect.

What did you expect to see?

view is created and the table is altered successfully.

What did you see instead?

BIGSQL returns statement not supported.

Do you have any plans for supporting ExecDirect api?

Thanks,
Akhil

@agnivade
Copy link
Contributor

agnivade commented Feb 4, 2020

Hello @akhilravuri1 - could you please fill the issue template entirely explaining what is it that you are trying to do ? A self-contained independant code sample is preferred.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 4, 2020
@akhilravuri1
Copy link
Author

Hi @agnivade

Sorry, I have modified my comment.

Thanks,
Akhil

@agnivade agnivade changed the title way to execute the SQL directly without prepare database/sql: way to execute the SQL directly without prepare for IBM/DB2 Feb 5, 2020
@agnivade agnivade added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Feb 5, 2020
@agnivade
Copy link
Contributor

agnivade commented Feb 5, 2020

@kardianos

@kardianos
Copy link
Contributor

Looking at https://github.com/ibmdb/go_ibm_db it looks like the driver doesn't implement the driver.Queryer interface. Once that is implemented, it will operate as desired.

@kardianos
Copy link
Contributor

It looks like that above driver uses ODBC3 to implement connections. There may be a limitation there. Furthermore, it looks like it has a dedicated API call to create or drop tables.

The issue isn't with database/sql, but likely with your driver.

@akhilravuri1
Copy link
Author

Hi @kardianos
Thanks for the information about the driver.Queryer interface.

Akhil.

@golang golang locked and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants