netbeans
netbeans copied to clipboard
Database update table bug
Apache NetBeans version
Apache NetBeans 25
What happened
table alias error
UPDATE "isms"."TSOSOA1 t"
Language / Project Type / NetBeans Component
No response
How to reproduce
excute "select * from table t where t.aaa='xxxx' " modify some data click commit records button will show the error and the update sql will be : update "table t" the correct sql is : update table ,no t
Did this work correctly in an earlier version?
No / Don't know
Operating System
windows11
JDK
jdk1.8
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No
What JDBC driver and DBMS was used?
What JDBC driver and DBMS was used?
ojdbc6.jar, Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage
there has other problems,
i must delete the double quotation marks to use:
update xsms.tvava07
or it will show an error
What JDBC driver and DBMS was used?
I know the problem. The scheme and table name must be uppercase
The problem is, that the statement generator has to guess what is the right thing to do for identifiers. What happens here is:
- NetBeans tries to extract the catalog, schema and table name from the resultset
- Oracle does not provide that data
- NetBeans now guesses the data from the SQL
- NetBeans then checks if the identifier needs to be quoted and in this case based on difference between identifier casing and "should" casing, decides to quote
- Oracle does not like the quoted value and errors out
Quite frankly: Every non-trivial query/update with this will fail on Oracle, but that should be discussed with oracle. They could fix the metadata for a resultset. I'll let this stay open, but don't plan to further work on this.