gpt4 book ai didi

sql - 更改后如何知道列的先前长度

转载 作者:行者123 更新时间:2023-12-02 09:11:05 25 4
gpt4 key购买 nike

我已经在Oracle中更改了列的大小,现在我想获取该列的上一个大小,因此无论如何我们都可以获取该列的上一个大小。

谢谢。

最佳答案

您可以在flashback上使用user_tab_columns:

SQL> conn <your_schema>
SQL> create table tab( str varchar2(20) );
SQL> alter table tab modify str VARCHAR2(30);
SQL> conn / as sysdba
SQL> grant flashback on user_tab_columns to <your_schema>;
SQL> conn <your_schema>
SQL> select *
from user_tab_columns
as of timestamp systimestamp - interval '1' minute c
where c.column_name = 'STR'
and c.table_name = 'TAB';
-- the period depends on your latency of issuing the commands
-- "'1' minute" may be replaced with "'10' second" as an example.

关于sql - 更改后如何知道列的先前长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52178478/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com