Oracle stored procedures, SQL statement execution time

Source: Internet
Author: User

Create or Replace procedure Sum_info is I integer;temp1 varchar2 (100) temp2 varchar2 T1 DATE;T2 ); v_sqm varchar2 (+); U_name t_temp.u_name%type;t_name t_temp.t_name%type;c_name t_temp.c_name%type;cursor tb_list Is select U_name,t_name,c_name from T_temp;beginopen tb_list; Loopt1:=sysdate;fetch tb_list into u_name,t_name,c_name;v_sql:= ' select min (' | | c_name| | ') From ' | | u_name| | '. ' | | t_name;v_sqm:= ' select Max (' | | c_name| | ') From ' | | u_name| | '. ' | | T_name;--dbms_output.put_line (V_sql); Execute immediate v_sql into Temp1;execute immediate v_sqm into temp2;t2:=sysdate ; I=round (To_number (T2-T1) *24*60*60); insert into T_ret values (u_name,t_name,c_name,temp1,temp2,i); Commit;exit when Tb_list%notfound;end Loop;close Tb_list;end;

  

Oracle stored procedure deferred execution Dbms_lock. SLEEP (60);

Oracle stored procedures, SQL statement execution time

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.