tags:

views:

543

answers:

1

I am calling 4-5 SQL scripts from a single SQL script. I get errors like:

Enter value for 1: MIG9

old 86: WHERE BLT.bill_id = '&1'

new 86: WHERE BLT.bill_id = 'MIG9'

SP2-0552: Bind variable "FINACLE" not declared.-----here i am calling FBA.sql file

New Rows END OF FBE insert :0

PL/SQL procedure successfully completed.

END OF FAE insert New Rows :0

PL/SQL procedure successfully completed.

New Rows :END OF TFAT insert0

PL/SQL procedure successfully completed.

New Rows :END OF FBH insert1

PL/SQL procedure successfully completed.

SP2-0734: unknown command beginning "IF MOD(COM..." - rest of line ignored.

Commit complete.

SP2-0734: unknown command beginning "DBMS_OUTPU..." - rest of line ignored.

SP2-0042: unknown command "END IF" - rest of line ignored.

Commit complete.

My calling code is as follows:

cursor
insert
        COMMIT_COUNTER := COMMIT_COUNTER +1;
    END; --}
    IF MOD(COMMIT_COUNTER, 100) = 0 THEN
        COMMIT;
            DBMS_OUTPUT.PUT_LINE('END OF FBM insert New Rows :' ||COMMIT_COUNTER);
    END IF;
START fba.sql
@fei.sql
@fbe.sql
@fae.sql
@tfat.sql
@ins_FBH.sql
/

fba.sql is as below:

DECLARE
COMMIT_COUNTER        NUMBER;

CURSOR  BLT_CURSOR IS
SELECT  BLT.sol_id,
        BLT.bill_id,
        BLT.bank_id,
        BLT.del_flg,
        BLT.ts_cnt,
        BLT.rcre_user_id,
        BLT.rcre_time,
        BLT.lchg_user_id,
        BLT.lchg_time
FROM    BLT ,BPM , BRG
WHERE   BLT.bill_id = '&1'
AND     BLT.reg_type = BPM.reg_type
AND     BLT.reg_sub_type = BPM.reg_sub_type
AND     BPM.bill_type = 'B'
AND     BLT.reg_type = BRG.reg_type
AND     BRG.inward_outward_ind = 'O';

BEGIN

    COMMIT_COUNTER := 0;
    FOR blt_rec IN BLT_CURSOR

    LOOP
    BEGIN

    --inserting the values in FBE
          INSERT INTO FBA_TEMP(
                    sol_id,
                    bill_id,
                    bank_id,
                    del_flg,
                    entity_cre_flg,
                    ts_cnt,
                    lchg_user_id,
                    lchg_time,
                    rcre_user_id,
                    rcre_time)
          VALUES(
                    blt_rec.sol_id,
                    blt_rec.bill_id,
                    blt_rec.bank_id,
                    blt_rec.del_flg,
                    'Y',
                    blt_rec.ts_cnt,
                    blt_rec.lchg_user_id,
                    blt_rec.lchg_time,
                    blt_rec.rcre_user_id,
                    blt_rec.rcre_time);

             EXCEPTION
                WHEN NO_DATA_FOUND THEN NULL;
                COMMIT_COUNTER := COMMIT_COUNTER +1;
    END; --}

    IF MOD(COMMIT_COUNTER, 100) = 0 THEN
        COMMIT;
    END IF;

    END LOOP; --}
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('New Rows END OF FBA insert :' || COMMIT_COUNTER);
END;
/

Also I need to know how do I pass the same input to all the SQL files only once at the start.

+1  A: 

This problem is now resolved.

But I still need to know how do I pass the same input to all the SQL files only once at the start.