Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

Provide examples and test cases for lobvar insert/updates #25

Open
qqiao opened this issue Nov 10, 2014 · 3 comments
Open

Provide examples and test cases for lobvar insert/updates #25

qqiao opened this issue Nov 10, 2014 · 3 comments

Comments

@qqiao
Copy link

qqiao commented Nov 10, 2014

We currently have example for lobvar reads:

clob := dst.(*oracle.ExternalLobVar)

However, we don't have any examples or test cases for inserting/updating blob/clob columns, could these be added?

I hope I'm not missing anything obvious.

@tgulacsi
Copy link
Owner

Hi, just for heads up: I've noticed your request, but just don't have any free time these days.
I'll try to create an example, as soon as possible.

@tgulacsi
Copy link
Owner

I've added clob insertion test - see godrv/table_test.go insertClob function.
Sorry, but the shorter version (insert into ... () values() returning F_clob INTO :1) doesn't work for now - didn't have time to investigate whether it is Go's sql driver's limitation, or my fault.

@tgulacsi tgulacsi reopened this Nov 13, 2014
@qqiao
Copy link
Author

qqiao commented Nov 14, 2014

Thanks for the prompt reply.

The reason I raised this issue is because I was able to insert into CLOB columns using a normal string, for exmaple

CREATE TABLE temp (
c CLOB
)

Then in Go code:
s := "Some String"
db.Exec("INSERT INTO temp (c) VALUES (?)", a)

The above snippet is actually functional, and when I looked at ExternalLobVar, it has all the Write* functions, which is what got me nervous, the direct insertion almost felt like a fluke and I was expecting to have to use ExternalLobVar

I have not looked too deeply into the code, otherwise I'd PR test cases to the project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants