Binding a variable to a input parameter in procedure

98 views Asked by At

I have a procedure which gets 2 String as its parameter. I want to bind a variable to one of the parameter string but its not working properly as i do as below explanation. Your help would be highly appreciated.

DECLARE 
    customer_id Varchar2(100);

BEGIN 
     custmer_id := '100';
     Customer.Error ('CustomerEntity','Customer has already availalble for :custmer_id  ');
END;
1

There are 1 answers

0
Popeye On BEST ANSWER

Use concatanation operator (||) as follows as I think there is no way to bind the variable in assignment to another string.:

DECLARE 
    customer_id Varchar2(100);

BEGIN 
     custmer_id := '100';
     Customer.Error ('CustomerEntity','Customer has already availalble for ' || custmer_id);
END;

Bind variables are mostly used in dynamic query execution.

Cheers!!