Crystalboy1
Programmer
HI,
I want to write a store procedure in PLSQL, in the body of the procedure, i will be inserting data into a table, then will updating other fields, when i run the script, it gives me an error dat SQL command not properly ended, if i put a ; in it then its treat ever part as a different script.
help please
insert into Reports_Loan_Periods(overFive)
values(nvl((select NVL(Sum(A.PWLB_ORIGINAL_PRINCIPAL), 0)
from ADVANCES_OPT A
WHERE (A.PWLB_ADVANCE_DATE >= 20080601 AND
A.PWLB_ADVANCE_DATE<= 20080630 and
a.pwlb_loan_period_months<=60)
),0))
update Reports_Loan_Periods set Fiveto10=
(nvl((select NVL(Sum(A.PWLB_ORIGINAL_PRINCIPAL), 0)
from ADVANCES_OPT A
WHERE (A.PWLB_ADVANCE_DATE >= 20080601 AND
A.PWLB_ADVANCE_DATE<= 20080630 and
a.pwlb_loan_period_months>60 and a.pwlb_loan_period_months<=120)
),0))
I want to write a store procedure in PLSQL, in the body of the procedure, i will be inserting data into a table, then will updating other fields, when i run the script, it gives me an error dat SQL command not properly ended, if i put a ; in it then its treat ever part as a different script.
help please
insert into Reports_Loan_Periods(overFive)
values(nvl((select NVL(Sum(A.PWLB_ORIGINAL_PRINCIPAL), 0)
from ADVANCES_OPT A
WHERE (A.PWLB_ADVANCE_DATE >= 20080601 AND
A.PWLB_ADVANCE_DATE<= 20080630 and
a.pwlb_loan_period_months<=60)
),0))
update Reports_Loan_Periods set Fiveto10=
(nvl((select NVL(Sum(A.PWLB_ORIGINAL_PRINCIPAL), 0)
from ADVANCES_OPT A
WHERE (A.PWLB_ADVANCE_DATE >= 20080601 AND
A.PWLB_ADVANCE_DATE<= 20080630 and
a.pwlb_loan_period_months>60 and a.pwlb_loan_period_months<=120)
),0))