Golang SQL会话变量

code i am working on is using something like this.

tx.ExecContext(ctx, `set @value = (select id from sometable where name = ?)`, name)

I need to get that @value before i use it elsewhere in query. I am looking through docs and I do not see anywhere in package such feature documented.

How can I do that?

Thank you very much.