c# - Is this a bug in the Oracle ODP.NET -


i'm curious if bug in oracle odp.net provider. created parameterized insert statement. named 1 of parameters ':empno' , when testing gave value of '8000'. in database empno column defined varchar2(4 byte). however, insert gave error message of

ora-12899: value large column "hr"."hr_departure"."empno" (actual: 6, maximum: 4)

here code snipets:

"insert hr.hr_departure (empno) ':empno'" 

i add parameter

new oracleparameter(":empno", oracledbtype.varchar2) {value = empno ?? convert.dbnull} 

create command , add parameter (there multiple parameters array)

dbcommand cmd = connection.createcommand(); cmd.parameters.addrange(sqlparams.toarray()); 

i did research , considered things encoding , fact oracle defaults bind position (instead of bindbyname). however, none of these resolved issue. took shot in dark , changed parameter name ":empn" , got following error message:

ora-12899: value large column "hr"."hr_departure"."empno" (actual: 5, maximum: 4)

this clued me in change parameter name ":emp" @ time query worked. find odd provider enforcing database column size on parameter name in c#. database size should enforcement of value ('8000' kept same in tests).

no; problem query makes no sense.

':empno' string literal value :empno, 5 characters long.

to reference parameter, don't write string literal.


Comments

Popular posts from this blog

apache - PHP Soap issue while content length is larger -

asynchronous - Python asyncio task got bad yield -

javascript - Complete OpenIDConnect auth when requesting via Ajax -