Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Procedure and Bind Variable

753617Mar 2 2010 — edited Mar 3 2010
I'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?

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 31 2010
Added on Mar 2 2010
4 comments
936 views