Skip to content

Commit

Permalink
update example file
Browse files Browse the repository at this point in the history
  • Loading branch information
sijms committed Mar 22, 2023
1 parent 0e5b6ad commit f5d1fc7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions examples/TimeStamp TZ/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ func insertData(conn *sql.DB, loc string) error {
return nil
}

func queryOutputPar(conn *sql.DB) error {
t := time.Now()
//var data sql.NullTime
var data go_ora.NullTimeStampTZ
//var data go_ora.TimeStampTZ
_, err := conn.Exec(`BEGIN SELECT DATA INTO :1 FROM TEMP_TABLE_322 WHERE ID=1; END;`, go_ora.Out{Dest: &data})
if err != nil {
return err
}
//fmt.Println(data, "\tLocation: ", data.Time.Location())
//fmt.Println(time.Time(data), "\tLocation: ", time.Time(data).Location())
fmt.Println(time.Time(data.TimeStampTZ), "\tLocation: ", time.Time(data.TimeStampTZ).Location())
fmt.Println("Finish query data: ", time.Now().Sub(t))
return nil
}
func queryData(conn *sql.DB) error {
t := time.Now()
var data time.Time
Expand Down Expand Up @@ -110,4 +125,9 @@ func main() {
fmt.Println("can't query data: ", err)
return
}
err = queryOutputPar(conn)
if err != nil {
fmt.Println("can't query output: ", err)
return
}
}

0 comments on commit f5d1fc7

Please sign in to comment.