Procedure and Bind Variable
753617Mar 2 2010 — edited Mar 3 2010I'm trying to write a procedure for an exercise I'm working on. I got an error that I needed to use a "Bind Variable," so now I'm trying to pass a bind variable to the procedure. I am supposed to get user input.
CREATE OR REPLACE PROCEDURE insert_glaccount
(
account_num_pram general_ledger_accounts.account_number%TYPE,
account_desc_pram general_ledger_accounts.account_description%TYPE
)
AS
BEGIN
INSERT INTO general_ledger_accounts
VALUES (account_num_pram, account_desc_pram);
/*Error handling to coming soon*/
END;
/
VARIABLE account_num_var general_ledger_accounts.account_number%TYPE;
VARIABLE account_desc_var general_ledger_accounts.account_description%TYPE;
BEGIN
:account_num_var := &account_num;
:account_desc_var := &account_desc;
CALL insert_glaccount(:account_num_var, :account_desc_var);
END;
Now I'm getting an error: "Bind Variable "account_num_var" is NOT DECLARED"
Can someone please explain how I'm messing this up?