Skip to content

Commit

Permalink
update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
sijms committed Nov 11, 2023
1 parent 6ba10ae commit 486e221
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,32 @@ complete code for mapping refcursor to sql.Rows is found in [example/refcursor_t
// rest of your code
```

* ### Session Parameters
* you can update session parameter after connection as follow
```golang
db, err := sql.Open("oracle", connStr)
if err != nil {
// error handling
}
// pass database, key, value
err = go_ora.AddSessionParameter(db, "nls_language", "english")
if err != nil {
// error handling
}
```
[//]: # (### Go and Oracle type mapping + special types)

[//]: # ()
[//]: # (### Supported DBMS features)
### releases
<details>

### version 2.7.20
* fix time not in timezone issue specially with oracle 19c
* add function to set value for session parameters that will be applied for subsequent connections
* fix issue #461
* bug fixes and improvements

### version 2.7.18
* Add 2 function `go_ora.NewDriver` and `go_ora.NewConnector`
* Add new function `go_ora.SetStringConverter` which accept custom converter for unsupported charset and nCharset
Expand Down
2 changes: 1 addition & 1 deletion v2/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (driver *OracleDriver) init(conn *Connection) error {
// update session parameters
var err error
for key, value := range driver.sessionParam {
_, err = conn.Exec(fmt.Sprintf("alter session set %s=:1", key), value)
_, err = conn.Exec(fmt.Sprintf("alter session set %s='%s'", key, value))
if err != nil {
return err
}
Expand Down

0 comments on commit 486e221

Please sign in to comment.