修改表名 ALTER TABLE 原表名 RENAME TO 新表名; 一句SQL语句只能修改一张表 show tables; 1. SELECT CONCAT( 'ALTER TABLE ', table_name, ' RENAME TO db_', substring(table_name, ), ';' ) FROM information_schema. TABLES WHERE table_name LIKE 'ct%'; 批量复制一下到Notepad++中,只保留sql语句,再复制…
SELECT b.sql_text, --content of SQL a.machine, --which machine run this code a.username, a.module, -- the method to run this SQL c.sofar / totalwork * 100, --conplete percent c.elapsed_seconds, --run time c.time_remaining --remain to run time FROM v$…
create or replace procedure trun_table(table_deleted in varchar2) as --创建一个存储过程,传入一个表示表名称的参数,实现清空指定的表 cur_name integer;--定义内部变量,存储打开的游标 begin cur_name := dbms_sql.open_cursor;--打开游标 dbms_sql.parse(cur_name,'truncate table'||table_deleted ||'drop stor…
SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME='Account' SELECT (case when a.colorder=1 then d.name else '' end) as 表名,--如果表名相同就返回空 a.colorder as 字段序号, a.name as 字段名, (case when COLUMNPROPERTY( a.id,a.name,'IsIdentity'…