PL/SQL Stored procedures-China power load data storage function-for reference only

Source: Internet
Author: User
Tags cos

CREATE OR REPLACEPackage BODY SSL as  PROCEDUREInsert_ssl (SinchSsl_array) asV_monthvarchar2( -); V_sqlvarchar2( the); V_result Number; V_status Number; BEGIN  Delete  fromE_tmp_mp_ssl_curve; SelectTo_char (S (s.first). Data_time,'yyyymm') intoV_month fromdual; V_result:=-Ten;  forIinchs.first. S.last LOOPBEGIN        INSERT  intoE_tmp_mp_ssl_curve (Mped_id,data_time,ps_flag,p,pa,pb,pc,q,qa,qb,qc,ua,ub,uc,ia,ib,ic,COS, Cosa,cosb,cosc,paia,paib,paic,paua,paub,pauc,savedatetime,p_coef,q_coef,v_coef,c_coef,area_code,factor_ COEF)VALUES(S (i). mped_id, S (i). Data_time, S (i). Ps_flag, S (i). P, S (i). Pa,s (i). Pb,s (i). PC, S (i). Q, S (i). Qa,s (i). Qb,s (i). QC, S (i). Ua,s (i). Ub,s (i). Uc,s (i). Ia,s (i). Ib,s (i). IC, S (i) .Cos, S (i). Cosa,s (i). Cosb,s (i). Cosc,s (i). Paia,s ( i). Paib,s (i). Paic,s (i). Paua,s (i). Paub,s (i). Pauc, Sysdate,1,1,1,1, S (i). Area_code,s (i).      FACTOR_COEF); END; ENDLOOP; V_result:=- -; V_sql:= 'Delete from E_mp_ssl_curve_'||V_month||'A where exists (select 1 from e_tmp_mp_ssl_curve b where a.mped_id = b.mped_id and A.data_time = B.data_time and A.P S_flag = B.ps_flag)'; Executeimmediate v_sql; V_result:=- -; V_sql:= 'INSERT INTO E_mp_ssl_curve_'||V_month||'(mped_id, Data_time, Ps_flag, UA, UB, UC, IA, IB, IC, I0, p, PA, Pb, PC, Q, QA, QB, QC, cos, Cosa, COSB, Cosc, SP, SP A, SPB, SPC, FN, Paia, Paib, Paic, Paua, Paub, Pauc, Temple, AVGP, Avgq, P_coef, Q_coef, V_coef, C_coef, Factor_coef, save datetime, Area_code) SELECT * FROM E_tmp_mp_ssl_curve'; Executeimmediate v_sql;Commit; EXCEPTION whenOTHERS Then      begin        ROLLBACK; V_status:=Error_log (V_result, SQLCODE, SQLERRM,'Insert_ssl'); End; ENDInsert_ssl;ENDSsl

PL/SQL Stored procedures-China power load data storage function-for reference only

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.