.... becoz of the fact that out parameters are write only ... we only can assign values to out parameters but we can't assign out parameters value to any variable inside the procedure or function....but in my case I had created a simple procedure and used out parameters in it let give me the example of the code first ....>create or replace procedure test_out_parameter(out_parameter out number) isv_temp number;beginv_temp := out_parameter;out_parameter :=10 ;dbms_output.put_line (out_parameter);end ;here i read the value of out parameter (out_parameter) in the variable v_temp but this procedure was created sucessfully and throws no error..... and also run sucessfully with no error or warnings... i want to know where i m doing the mistake ...thanks

Questions by lalit4untl   answers by lalit4untl

Showing Answers 1 - 9 of 9 Answers

Hi ..... we can assign the value of  the out parameter to any variable inside the module... we can do assignment, we can do calculations with the out parameters......so the procedure you wrote has no problem.......

Thanks,

Brajesh

  Was this answer useful?  Yes

xyz

  • May 7th, 2007
 

It is limited only for in parameter..
You can only read in parameters, we cannot assign any value to in parameter.
if you try to do so, it wont even allow you to compile your code.

Thanks
xyz

  Was this answer useful?  Yes

Yes..I am totally agree with what XYZ replied.
There is such kinda restriction only for IN parameter..
that means if you are trying to assign value to IN parameter, then that procedure won't get compiled. But, for OUT parameters there is no such restriction.You can assign as well as read value from OUT parameter.This is provided for flexibility(If I am not wrong).But surely your procedure will get compiled.The precision that we can read value from out parameter lets us save the number of variables that we'll be required to do intermediate calculations...yes,this is very true in case u write some lengthy and calculatory code
Regards
Rahul G

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions