Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    1

    Unanswered: plz help me to convert dis code to mysql

    CREATE PROCEDURE GETINTAMT (
    REGISTERNO VARCHAR(20),
    ASONDTE DATE
    ) RETURNS (
    PRDUE DOUBLE PRECISION,
    INTAMT DOUBLE PRECISION,
    PENAMT DOUBLE PRECISION,
    NODAYS DOUBLE PRECISION
    ) AS
    declare variable OPEND TIMESTAMP;
    declare variable ENDdte TIMESTAMP;
    declare variable EFFDT TIMESTAMP;
    declare variable LSTINT TIMESTAMP;
    declare variable penrec TIMESTAMP;
    declare variable LSTINTp TIMESTAMP;
    declare variable LASTINTS TIMESTAMP;
    declare variable Master Varchar(20);
    declare variable OpInt DOUBLE PRECISION;
    declare variable OpPen DOUBLE PRECISION;
    declare variable Rate DOUBLE PRECISION;
    declare variable IntCr DOUBLE PRECISION;
    declare variable IntDr DOUBLE PRECISION;
    declare variable Bal DOUBLE PRECISION;
    declare variable MST_MASTERID VARCHAR(10);
    declare variable MST_INTOPTION VARCHAR(10);
    declare variable intdate date;
    declare variable intdDte date;
    declare variable intdDte1 date;
    declare variable sdate date;
    declare variable penaldate date;
    declare variable initdep DOUBLE PRECISION;
    declare variable PENBAL DOUBLE PRECISION;
    declare variable PENRATE DOUBLE PRECISION;
    declare variable MST_GROUP VARCHAR(5) ;
    BEGIN

    NODAYS = 0;
    /* @ MUDAKKUZHA ALL LOANS HAVE MST_INTOPTION ='KCC'
    SO GIVE MST_GROUP =1 FOR KCC
    AND OTHER VALUE(2,3,4... ) FOR OTHER LOANS..*/


    SELECT REG_DATEOPENED,REG_DATEEFFECTIVE,REG_LASTINTREC,
    REG_MASTERTYPE,REG_curintbal,REG_OPPENALBAL ,reg_lastpenrec,REG_MASTERID,reg_initdeposit FROM REGISTER
    WHERE REG_REGISTERNO = :REGISTERNO INTO :OPEND,:EFFDT,:LSTINT,:Master,:OpInt,:OpPen,: penrec,:MST_MASTERID ,:initdep;
    SELECT MST_INTOPTION,MST_GROUP
    FROM MASTER WHERE MST_MASTERID =:MST_MASTERID INTO MST_INTOPTION,:MST_GROUP ;

    LSTINTp=:LSTINT;
    if (MST_GROUP is null) then MST_GROUP ='0';
    if (LSTINT is null) then LSTINT ='01/01/1900';
    if (:LSTINT < :OPEND) then LSTINTp = :OPEND;
    if (:LSTINTp < :EFFDT) then LSTINTp = :EFFDT;
    if (:LSTINTp < :LSTINT) then LSTINTp = :LSTINT ;
    if (:LSTINTp <=:OPEND) then LSTINTp = :LSTINTP ;
    IF (:OpInt IS NULL )THEN OPINT =0;
    prdue = 0 ; penamt =0;
    IF ( :Master ='LOAN') THEN BEGIN
    IF (:MST_GROUP ='1') THEN
    SELECT PRDUE,INTAMT,PENAMT,NODAYS
    FROM GETINTAMTKCC (:REGISTERNO,:ASONDTE) INTO
    :PRDUE,:INTAMT,:PENAMT,:NODAYS;
    IF (:MST_GROUP <> '1' ) THEN begin
    SELECT PRDUE , INTAMT , PENAMT , NODAYS
    FROM GETINTAMTLOANS(:REGISTERNO,:ASONDTE) INTO
    :PRDUE , :INTAMT , :PENAMT , :NODAYS;
    select SUM(prdue),SUM(penal) from getprdue (:REGISTERNO,:ASONDTE) into
    : prdue,: penamt;
    end
    END
    INTAMT = :OpInt + :INTAMT;
    IF (:PRDUE IS NULL) THEN PRDUE =0;
    IF (:INTAMT IS NULL) THEN INTAMT =0;
    IF (:PENAMT IS NULL) THEN PENAMT =0;
    IF (:NODAYS IS NULL) THEN NODAYS =0;
    if (NODAYS < 0 ) then NODAYS = 0;
    if (intamt<0) then intamt = 0;
    SUSPEND;
    END
    Last edited by remyakrn; 05-28-13 at 07:34.

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    What database language is this one?
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •