Comments (10)
my code like this
db.Exec("insert into LC_BATCHTRANS(BATCHID,AMOUNT,STATUS,FAMEBCUSNO,SUBMITTIME,SUBMITTLR,TRANSTYPE,ABS) values (?,?,?,?,?,?,?,?)", "test001", "0.01", "N", "002", time.Now(), "002", "0", "test")
but when the value of AMOUNT is less than 1,such as 0.01 or 0.10,the sql before can't take effect
from tds.
Hi,
Is your amount field a float or a numeric?
Can you give me the table's ddl?
from tds.
Hi,
Is your amount field a float or a numeric?
Can you give me the table's ddl?
decimal
from tds.
decimal
it has nothing to do with the type of field, when the sql is working,it will be stopped by the code in the 129 rows of num.go
from tds.
Indeed but I need the type of field to reproduce.
from tds.
the error info:
/usr/local/go/src/runtime/panic.go:35 (0x42afbd)
panicslice: panic(sliceError)
/var/www_edu_plugins/bank-api/src/sctek.com/edu-plugins/bank-api/vendor/github.com/thda/tds/num.go:129 (0xaadf4b)
Num.String: return string(b[:len(b)-2-int(n.scale)]) + "." + string(b[len(b)-2-int(n.scale):len(b)-2])
/var/www_edu_plugins/bank-api/src/sctek.com/edu-plugins/bank-api/vendor/github.com/thda/tds/num.go:186 (0xaae3e7)
numConverter.ConvertValue: return []byte(num.String()), err
/usr/local/go/src/database/sql/convert.go:83 (0x968fac)
ccChecker.CheckNamedValue: nv.Value, err = c.cci.ColumnConverter(index).ConvertValue(arg)
/usr/local/go/src/database/sql/convert.go:171 (0x97cb6b)
(ccChecker).CheckNamedValue-fm: checker = cc.CheckNamedValue
/usr/local/go/src/database/sql/convert.go:171 (0x97cb6b)
(ccChecker).CheckNamedValue-fm: checker = cc.CheckNamedValue
/usr/local/go/src/database/sql/convert.go:175 (0x9694b3)
driverArgsConnLocked: err = checker(nv)
/usr/local/go/src/database/sql/sql.go:2260 (0x977c8f)
resultFromStatement: dargs, err := driverArgsConnLocked(ci, ds, args)
/usr/local/go/src/database/sql/sql.go:1410 (0x97392b)
(*DB).execDC: return resultFromStatement(ctx, dc.ci, ds, args...)
/usr/local/go/src/database/sql/sql.go:1371 (0x973620)
(*DB).exec: return db.execDC(ctx, dc, dc.releaseConn, query, args)
/usr/local/go/src/database/sql/sql.go:1349 (0x973230)
(*DB).ExecContext: res, err = db.exec(ctx, query, args, cachedOrNewConn)
/usr/local/go/src/database/sql/sql.go:1363 (0x9734a4)
(*DB).Exec: return db.ExecContext(context.Background(), query, args...)
from tds.
Indeed but I need the type of field to reproduce.
the type of AMOUNT is DECIMAL (15,2)
from tds.
Thanks for the input. I should be able to provide a fix tomorrow. Will keep you updated
from tds.
I could reproduce.
I'll push an update tomorrow.
from tds.
Can you please test against Master?
from tds.
Related Issues (20)
- Infinite loop when connection unexpectedly dies HOT 5
- Does this work with sybase 16 ? HOT 17
- Batch Insert/ Batch Select HOT 2
- cannot connect to Sybase ASE 12.5.4 with charset=cp850 HOT 4
- string type : sql: converting argument $1 type: invalid type given HOT 8
- Seems like prepared statements are not working. HOT 2
- Always got connection timeout on MacOS HOT 7
- tds.Num into type *sql.RawBytes HOT 1
- Export Driver HOT 3
- DB Connection Stuck during Login HOT 4
- I can not use @ in password - Please help HOT 16
- Can't specify a dbname HOT 4
- Driver always try connecting to Default Database even if i specify DatabaseName HOT 1
- Failure handling some "real" columns on Sybase 11 HOT 2
- How to check if tds.Num represents a NULL value HOT 2
- Insert failing for columns having zero value HOT 1
- Incorrectly implemented Close() operation HOT 3
- I am Getting error while connecting to sybase server, perl code able to connect but when I'm trying to connect using golang getting following error : sql.Ping failed: netlib: unexpected EOF while reading message
- netlib: unexpected EOF while reading message
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 tds.