-
Notifications
You must be signed in to change notification settings - Fork 66
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
time.Time shows <nil> even if the value is present in the DB #267
Comments
What is the query? Please show us the relevant code? |
I have used below query for fetch the data. But I am facing problem in date |
Sometimes I am facing issue in fetching float64 data type |
For Float data type I am getting the error in item_id it shows i am using below query |
func GetPoLineDeatils(poheaderid float64) []POLineDeatils {
} |
Use gopkg.in/goracle.v2
It's simpler and maintained.
ATM rana/ora is abandoned.
On Fri, Sep 20, 2019 at 9:49 AM +0200, "GaganTM" <[email protected]> wrote:
func GetPoLineDeatils(poheaderid float64) []POLineDeatils {
var polinedata []POLineDeatils
env, srv, ses, err := ora.NewEnvSrvSes("test/[email protected]:1521/XE")
if err != nil {
fmt.Println(err)
return polinedata
}
defer env.Close()
defer srv.Close()
defer ses.Close()
// pohea.
stmtQry, err := ses.Prep(fmt.Sprintf(
"select po_id,po_line_id,line_num,unit_price,quantity,item_description,item_id,category_id,unit_meas_lookup_code from po_table where po_id=%v", poheaderid))
defer stmtQry.Close()
if err != nil {
// panic(err)
fmt.Println(err)
}
rset, err := stmtQry.Qry()
if err != nil {
// panic(err)
fmt.Println(err)
}
for i := 0; rset.Next(); i++ {
// fmt.Println(rset.Row[0].(float64), rset.Row[1].(float64), rset.Row[2].(string), rset.Row[3].(string), rset.Row[4].(string), rset.Row[5].(string), rset.Row[6].(string), rset.Row[7].(string), rset.Row[8].(string))
fmt.Println(rset.Row[0].(float64))
fmt.Println(rset.Row[1].(float64))
fmt.Println(rset.Row[2].(float64))
fmt.Println(rset.Row[3].(float64))
fmt.Println(rset.Row[4].(float64))
fmt.Println(rset.Row[5].(string))
fmt.Println(rset.Row[6].(float64))
fmt.Println(rset.Row[7].(float64))
fmt.Println(rset.Row[8].(string))
// if
polinedata = append(polinedata, POLineDeatils{PoHeaderID: rset.Row[0].(float64), PoLineID: rset.Row[1].(float64), LineNum: rset.Row[2].(float64), UnitPrice: rset.Row[3].(float64), Quantity: rset.Row[4].(float64), ItemDescription: rset.Row[5].(string), ItemID: rset.Row[6].(float64), CategoryID: rset.Row[7].(float64), UnitMeasLookupCode: rset.Row[8].(string)})
}
if err := rset.Err(); err != nil {
fmt.Println(err)
// panic(err)
}
return polinedata
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks for the suggestion. |
When I execute the select statement 1st time date value will be available.
When I execute the same select statement 2nd time its show value in the terminal.
The text was updated successfully, but these errors were encountered: