Comments (1)
this code is working without errors
v2.7.10
go v1.18+
database 19c
package main
import (
"database/sql"
"fmt"
_ "github.com/sijms/go-ora/v2"
"os"
)
func Query(db *sql.DB) {
rows, err := db.Query(`select t1.sql_Id,t1.sql_text,t2.elapsed_time_total as elapsed_time, t2.executions_total as executions
from dba_hist_sqltext t1 inner join dba_hist_sqlstat t2 on t1.sql_id=t2.sql_id where t1.command_type=3`)
if err != nil {
panic(err)
}
var id, sql string
var et, ex int
for rows.Next() {
err := rows.Scan(&id, &sql, &et, &ex)
if err != nil {
panic(err)
}
}
if rows.Err() != nil {
panic(rows.Err())
}
}
func main() {
conn, err := sql.Open("oracle", os.Getenv("DSN"))
if err != nil {
fmt.Println(err)
return
}
defer conn.Close()
Query(conn)
}
from go-ora.
Related Issues (20)
- How to change Oracle session parameter value like NLS_TIMESTAMP_FORMAT HOT 2
- Use bulkinsert for clob type data, if the length is greater than 32767, an error will be reported: ORA-03146: invalid buffer length for TTC field HOT 1
- TTC error: received code 28 during response reading after "alter session set container=pdb1" HOT 29
- Querying fields of type NUMBER(20,0) causes ORA-03120 HOT 5
- TIMESTAMP WITH TIME ZONE not equal in 12C and 19C HOT 3
- Issue with Converting Booleans to varchar2(1) Oracle with Valuer Interface using go-ora/v2 v2.7.11 HOT 2
- Oracle Date and Timestamps scan to wrong time.Time zone or wrong time with right zone, respectively. HOT 2
- number type but got string HOT 3
- stmt.AddParam is not exported anymore HOT 2
- Falsely assuming UDT with null.String args in v2.7.* HOT 3
- How to scan RefCursor to map HOT 10
- Oracle Sequence with value over 1000000 is not getting mapped to int when using .nextval from dual HOT 8
- float64 precision error HOT 1
- rows.Next will panic when some special data HOT 4
- add ability to export default driver registered via sql.Register HOT 2
- Oracle Connector v2 Dialer inject panic HOT 5
- Upgrade to v2.7.12+ issue HOT 5
- Long running stored procedure - socket is not connected error HOT 1
- PGA memory leak with LOBs HOT 1
- get default time zone
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-ora.