Quantcast
Channel: Oracle, MySQL, Sybase, Informix and other databases
Viewing all articles
Browse latest Browse all 1350

Use plsql in asp.net c#

$
0
0

I have been trying to fill dataset from the below PL/SQL script but am having issues

set verify off
set pagesize 0
set echo off
set trims on
set lines 1000
set colsep |
set termout off
set wrap off
set feedback off
--set serveroutput on size 1000000

spool Acct_Turnover.txt

Declare

vsolid tbaadm.sol.sol_id%type;
vacctopndate tbaadm.gam.acct_opn_date%type;
vsoldesc tbaadm.sol.sol_desc%type;
vacid tbaadm.gam.acid%type;
vforacid tbaadm.gam.foracid%type;
vacctname tbaadm.gam.acct_name%type;
vvolDR tbaadm.htd.tran_amt%type;
vvolCR tbaadm.htd.tran_amt%type;
vschmcode tbaadm.gam.schm_code%type;
vbal tbaadm.gam.clr_bal_amt%type;
vrate tbaadm.eit.interest_rate%type;
vcotrate custom.ccotm.cot_code_1%type;
vcoteffdate custom.ccotm.eff_date%type;
vcotamt tbaadm.htd.tran_amt%type;
vsanlim tbaadm.gam.sanct_lim%type;
veoddatemin tbaadm.eab.eod_date%type;
veodbalmin tbaadm.eab.tran_date_bal%type;
veoddatemax tbaadm.eab.eod_date%type;
veodbalmax tbaadm.eab.tran_date_bal%type;


cursor enter is

select sol_id,acid,foracid,acct_name,acct_opn_date,schm_code,clr_bal_amt,system.int_rate_dr(foracid),sanct_lim
from tbaadm.gam
where schm_type='ODA'
and sol_id='092'
AND ACCT_OWNERSHIP <> 'O'
and acct_cls_flg='N';

Begin

custom.wema_dbms_output.PUT_LINE('Acct Num'||'|'||'Acct Name'||'|'||'Acct Opn Date'||'|'||'Sol id'||'|'||'Branch Name'||'|'||'Debit TurnOver'||'|'||'Credit TurnOver'||'|'||'Product Code'||'|'||'Clr Bal Amt');


open enter;
loop
fetch enter into vsolid,vacid,vforacid,vacctname,vacctopndate,vschmcode,vbal,vrate,vsanlim;
exit when enter%notfound;

---------Get Sol Desc
Begin
select sol_desc into vsoldesc from tbaadm.sol
where sol_id=vsolid;
End;

----------------Get Count and Volume

Begin
select sum(nvl(tran_amt,0)) into vvolCR from tbaadm.htd
where acid=vacid
and tran_date between '&&1' and '&&2'
and part_tran_type='C'
and tran_sub_type not in ('BI','IC','IP')
and pstd_flg='Y'
and del_flg='N';
exception
when no_data_found then
vvolCR:=0.00;
end;


Begin
select sum(nvl(tran_amt,0)) into vvolDR from tbaadm.htd
where acid=vacid
and tran_date between '&&1' and '&&2'
and part_tran_type='D'
and tran_sub_type not in ('BI','IC','IP')
and pstd_flg='Y'
and del_flg='N';
exception
when no_data_found then
vvolDR:=0.00;
end;

-----------Get COT Applied
Begin
select sum(tran_amt) into vcotamt
from tbaadm.htd
where acid=vacid
and tran_date between '&&1' and '&&2'
and tran_particular like 'COT%'
and pstd_flg='Y'
and del_flg='N';
exception
when no_data_found then
vcotamt:=0.00;
End;

----------Get COT Applied
Begin
select cot_code_1,eff_date into vcotrate,vcoteffdate
from custom.ccotm
where acid=vacid;
exception
when no_data_found then
null;
End;

-----------Get Lowest Balance
Begin
select min(tran_date_bal) into veodbalmin from tbaadm.eab
where acid=vacid
and eod_date between '&&1' and '&&2';
exception
when no_data_found then
null;
End;

-----------Get Highest Balance
Begin
select max(tran_date_bal) into veodbalmax from tbaadm.eab
where acid=vacid
and eod_date between '&&1' and '&&2';
exception
when no_data_found then
null;
End;


custom.wema_dbms_output.PUT_LINE(vforacid||'|'||vacctname||'|'||vsoldesc||'|'||vsanlim||'|'||vbal||'|'||vvolCR||'|'||vvolDR||'|'||vrate||'|'||vbal||'|'||vcotrate||'|'||vcoteffdate||'|'||vcotamt||'|'||veodbalmin||'|'||veodbalmax);

end loop;
close enter;
End;
/
select trim(text) from custom.wema_dbms_output_view;
spool off


Viewing all articles
Browse latest Browse all 1350

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>