Skip to content

Problem with INSERT ... RETURNING query on getting back the value of string type #703

@hsa-online

Description

@hsa-online

There is a problem with INSERT ... RETURNING query on getting back the value of string type.

`

queryText := "INSERT INTO test(test_id, name, created_at) VALUES(:1, :2, :3) RETURNING test_id, name INTO :4, :5"

var test_id int64
var name string

_, err = r.db.ExecContext(
	r.ctx,
	queryText,
	nil,
	"TestTest",
	nil,
	sql.Out{Dest: &test_id},
	sql.Out{Dest: &name})      // This causes "main.Insert: failed on db.ExecContext: driver: bad connection"

`

All works if the last line is changed to:

go_ora.Out{Dest: &name, Size:100}) // This works

There is no go_ora.Out in docs.
Is the size in bytes, runes, etc. ?

Complete example is here:
main.go.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions