05 2022 档案

摘要:在使用Oracle数据库更新数据的时候,有两种查询方式可以修改编辑数据: select t.*,t.rowid from table t select * from table for update 在使用第二种方式的时候如果卡住或意外退出,会导致这个表锁住,之后无法被修改。 使用以下方法处理锁表 阅读全文
posted @ 2022-05-24 15:13 苏道羲 阅读(2024) 评论(0) 推荐(0)
摘要:记录一个之前没用过的方法,可以在联级查询的时候查询查询根节点及其所有子节点。 代码简化为: select ... from tablename start with col='' connect by prior col=parent_col where ...; start with以col字段为 阅读全文
posted @ 2022-05-23 15:23 苏道羲 阅读(92) 评论(0) 推荐(0)
摘要:场景是oracle存量的字段长度为varchar字段长度,超过之后报value too large for column错误,于是更改为clob。 直接修改会报错数据无法转换,所以使用一个新字段来中转。 具体代码如下: alter table XXX add a_new clob; update X 阅读全文
posted @ 2022-05-09 10:30 苏道羲 阅读(104) 评论(0) 推荐(0)