当前位置: 代码迷 >> 综合 >> 数据库可视化工具-查询的数据 插入数据库
  详细解决方案

数据库可视化工具-查询的数据 插入数据库

热度:62   发布时间:2024-03-08 12:56:16.0

一、近期有这么一个需求,需要从数据库查询table表的数据,然后组装成relation 表数据存进去。

        由于数据量不是一条,所以需要loop循环 。结果如下 ,恐日后遗忘,徐记之。 

 declarecursor js_test is (select GET_UUID AS id,'111222555' as database_id,table_name as table_name,table_code as table_codefrom std_table where table_name like 'PAY%');beginfor item in js_test loop insert into std_database_table_relation(id,database_id,table_name,table_code)values (item.id,item.database_id,item.table_name,item.table_code);end loop; commit;end;

二、解释:

     1、declare在 Oracle 一般是用在函数、存储过程和块结构及简单的事务中。

  相关解决方案