I have simple plsql program, basically what I would like to do is to calculate the length of the name which is dynamic input to plsql and then loop based on the length.
When I give pre-defined value like v_name = 'Dex' it works but when I give v_name = &name it throws an error message saying Dex must be declared.
Appreciate if any one can shed light on this issue. Please find error and program details below:
Error report: ORA-06550: line 6, column 13: PLS-00201: identifier 'DEX' must be declared ORA-06550: line 6, column 3: PL/SQL: Statement ignored 06550. 00000 - "line %s, column %s:\n%s" *Cause: Usually a PL/SQL compilation error. *Action:
PLsql Program:
declare
v_name varchar2(30);
v_loop_count number;
v_len number;
begin
v_name := &name;
v_loop_count := 0;
v_len := length(v_name);
for v_loop_count in 0 .. v_len-1
loop
dbms_output.put_line('Entered Name is :: '||v_name);
end loop;
end;