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

regarding alter session commands and set define off #412

Closed
crbsram opened this issue Jul 25, 2023 · 2 comments
Closed

regarding alter session commands and set define off #412

crbsram opened this issue Jul 25, 2023 · 2 comments
Labels

Comments

@crbsram
Copy link

crbsram commented Jul 25, 2023

Hi Team

Want to know how to add these
alter session set current_schema = user
set define off

during the connection initialization similar to onInit in godror.
So that entire connection usage these will be inherited.

Pls let us know this is possible.

@crbsram
Copy link
Author

crbsram commented Jul 25, 2023

Update:
_, err := conn.Query("set define off")
if err !=nil {
fmt.Println("error in setdefine off")
}

_, err := conn.Query(" select name from user where name = 'test & test'")
if err != nil {
fmt.Println("error in executing the query")
}

while writing this code received error from Oracle like given below:

ORA-00922: missing or invalid option

Let me know if I am missing anything.

Thanks
C.R.Bala

@sijms
Copy link
Owner

sijms commented Jul 29, 2023

hi @crbsram
SET DEFINE ON/OFF is an option of SQL Plus not oracle
so your code

_, err := conn.Query(" select name from user where name = 'test & test'")
if err != nil {
    fmt.Println("error in executing the query")
}

will work without SET DEFINE OFF

@sijms sijms added the fixed label Jul 30, 2023
@sijms sijms closed this as completed Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants