Oracle stored procedures combined with my company code 1

Source: Internet
Author: User


1. Framework.queryinfo info1 = new Framework.queryinfo ();
String Sql = Holworth.Utility.Utility.EntityRowMapper.getSql ("//data//valueatriskcalculationservice//nonequery2 ");
Info. Customsql = SQL;
Info1. Namedquery = "P_tran_simulation1";
Info1. Parameters.Add ("V_computedate1", DateTime.Parse ("2015/3/9"));
Info1. Parameters.Add ("V_computedate2", DateTime.Parse ("2015/6/9"));
Dao.executenonquery (INFO1);

2.

Create or replace procedure P_tran_simulation1
(
V_computedate1 in Date,
V_computedate2 in Date
) is
Begin
DECLARE cashflowpositive number:=0;
Cashflownegative number:=0;
Cursor Mycur is
SELECT *
From Tran_cash_flow
where as_of_date = V_computedate1
and Payment_date >=v_computedate1
and Payment_date < V_computedate2;
Cashflowrow Tran_cash_flow%rowtype;
Begin
Open mycur; --Open cursor
Loop
Fetch mycur into Cashflowrow; --Place the record indicated by the cursor in the variable
Exit when (Mycur%notfound); --Exits the loop when the cursor does not point to a row
If Cashflowrow.cashflow_value>0 Then
Cashflowpositive:=cashflowpositive+cashflowrow.cashflow_value;
Else
Cashflownegative:=cashflownegative+cashflowrow.cashflow_value;
End If;
End Loop;
--Dbms_output.put_line (cashflowpositive);

Close mycur; --Close cursor
INSERT into TBL values (cashflowpositive,cashflowpositive);
End





End P_tran_simulation1;

Oracle stored procedures combined with my company code 1

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.