在执行更新SQL语句之后,SmallInt在sybase中保持无效
DB是sybase
。我执行了更新SQL语句喜欢
UPDATE table_name SET smallint_col = 0,
datetime_col = CONVERT(datetime, '1999-09-09') WHERE some_col = 'sth';
将null SmallInt
属性设置为非null值。
我通过JDBC在更新语句之后与Select语句一起检查了更新结果。
属性保持为空。只有DateTime属性已更新为预期值。
另外,这是我尝试过的:
- 将目标值设置为大于0的非null值。仍然与上述结果相同。
- 在中添加
和SmallInt_Col为null
子句。这次,两个属性的更新都失败了。
我的更新SQL语句有什么问题吗?
这可能是什么原因?
是否有可能将表格的某个属性更新受到限制?
顺便说一句,我只能与JDBC访问DB,我正在尝试避免与DBA交谈。
The DB was Sybase
. I executed update SQL statement like
UPDATE table_name SET smallint_col = 0,
datetime_col = CONVERT(datetime, '1999-09-09') WHERE some_col = 'sth';
to set a null smallint
attribute into a nonnull value.
I checked the update result with select statement right after the update statement via JDBC.
The attribute stayed null. Only the datetime attribute have been updated to intended value.
Also, here are what I have tried:
- Set the target value to a nonnull value larger than 0. Still same result as above.
- Added
and smallint_col IS NULL
in theWHERE
clause. This time the update of both attributes failed.
Is there anything wrong with my update SQL statement?
What could be a possible reason for this?
Is there any possibility that the update of a certain attribute of a table is restricted?
Btw, I can only access to the DB with JDBC and I am trying to avoid talking to the DBA.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是在Sybase ASE数据库下的整个SQL语句下方检查了下面,更新操作没有问题。
如果您使用的是JDBC调用,则可以获取更新SQL执行的返回计数。检查受影响的计数。
请仔细检查您的表定义。它与上面相同吗?
I just checked below whole SQL statements under Sybase ASE database, there is no problem on the update operation.
If you are using JDBC call, you can get the return count of the update SQL execution. to check the affected count.
Please double check your table definition. Is it the same as the above?