how do u call in & out parameters for stored procedures?
Answers were Sorted based on User's Feedback
Answer / sudhir kumar singh
procedure_name(a in number,b out varchar)
(
script of execution;
)
exec procedure_name(first_parameter,second_parameter);
Is This Answer Correct ? | 16 Yes | 3 No |
Answer / soujanya
See the example below...
create or replace procedure addn(a in number,b in number, c
out number)
is
begin
c:=a+b;
dbms_output.put_line(c);
end addn;
Now we can call the in and out parameters as
declare a variable for the out parameter as
var n number;
exec addn(5,10,:n);
print n;
Is This Answer Correct ? | 9 Yes | 1 No |
Answer / mohana sundaram
create or replace procedure p_name(p_no in out number)
is begin
{
executable statement
}
end p_name;
/
Is This Answer Correct ? | 8 Yes | 4 No |
Answer / sangeetha
create or replace procedure <pocedure_name>(x in number,y
out varchar) is begin
{
executable statements;
}
end <procedure_name>;
exec <procedure_name>(first_parameter,second_parameter);
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / susila
create or replace procedure <pocedure_name>(x in number,y
out number) is begin
{
executable statements;
}
end <procedure_name>;
exec <procedure_name>(10,y);
Is This Answer Correct ? | 5 Yes | 2 No |
Answer / sangeetha
<procedure_name>(in_parameter_value,
out_parameter_variable);
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / madhav
create or replace procedure proc_in_out
(p_empno in number,p_ename out varchar2)
as
begin
.......
.......
end;
execute proc_in_out(7369,p_ename)--out parameter can't
like this
declare
v_ename varchar2(10);
begin
proc_in_out(7369,v_ename);
end;
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / rajasekar.g
matrial purchase is in and matrial sales is out for stored
procedure
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ajit
create or replace procedure P_io ( I_num1 number,
o_num2 out number,
io_num3 in out number
)
is
begin
io_num3 := io_num3 + i_num1;
o_num2 := io_num3;
end;
/
Call this store procedure
--------------------------
declare
a number := 3;
b number;
c number := 7;
begin
P_io ( a, b, c);
dbms_output.put_line ( a||' '||b||' '||c);
end;
/
Is This Answer Correct ? | 0 Yes | 0 No |
How many sql are there?
What Is a Trigger? How Do You Use It?
How do you use collections in procedure to return the resultset?
7. Where would you look for errors from the database design?
What is a procedure in pl sql?
Lookups are a key component in sql server integration services (ssis). Explain its purpose?
using comand prompt how can import table data and table space with example
why should required nested tables, Object types, partition tables and varying arrays. what is the difference between these are all. give me example with explanation.
Hi Guys, I have a situation where I need to access the column values from rowtype variable. However, the column names are dynamic. below is sample code: declare Cursor c1 is select * from emp; Cursor c2 is select column_name from xyztable; v_c2 c2%rowtype; v_str varchar2 v_value varchar2(200); begin for rec in c1 loop open c2;---this cursor has column names like EMPLOYEE_ID, FIRST_NAME, LAST_NAME etc. loop fetch c2 into v_c2; exit when c2%notfound; /* now lets say i want to access value of LAST_NAME from cursor c1, so I am writing below code, however it does not work as expected */ v_str:= 'rec.'|| v_c2.column_name; -- this will give me string like "rec.EMPLOYEE_ID" v_value:=v_str; end loop; end loop; end; / Plz help ASAP.Thanks.
Does inner join return duplicate rows?
How many levels can subqueries be nested in a FROM clause?
Which command is used to call a stored procedure?