I am facing an issue very randomly.
I have a table with column type Number. In my java class where i insert values into this table, I am using setBigDecimal function to bind the value.
I dont face the issue always, but at times, I am getting the below exception:
[XHUB-108] A SQLException occurred while doing a database operation ( myfunction())[java.sql.SQLException:1461:ORA-01461: can bind a LONG value only for insert into a LONG column.
I got this issue inserting a value - 493414 into the column. Where as, I was able to insert values way bigger than this into the table.
Should i use setNUMBER function to insert the values and avoid the issue?
Is this a bug in setBigDecimal funciton?
Kamal, please tell us your jdev version!
Which kind of DB do you use? Oracle?
What does myfunction() do? Is it a java function or pl/sql?
If your column type is Number and the DB is an Oracle DB you should insert the value as oracle.domain.Number type.
Thank you for your reply.
I use a very primitive version of JDev 10.1.3 as my application is in ADF UIX.
myfunction() - pasting the code from it
ps = (OraclePreparedStatement)mDBConnection.prepareStatement("<insert statement>");
myfunction() receives errorMsgTrackingNum as BigDecimal.
Please suggest the correct method.
Kamal, if your DB column is defined as Number you can't just set it as BigDecimal. You have to convert the BigDecimal to a Number either when you pass it into the statement, or inside the statement you call on the DB.