Home » SQL & PL/SQL » SQL & PL/SQL » How to Execute a procedure (oracle 9i)
How to Execute a procedure [message #431148] Sun, 15 November 2009 23:04 Go to next message
kish_ulike
Messages: 30
Registered: June 2008
Location: chennai
Member

I have a procedure with the name procedure_1 with one in parameter that is a number type.
CREATE OR REPLACE PROCEDURE procedure_1 (n IN NUMBER)
AS
BEGIN
DBMS_OUTPUT.put_line ('Input Number is'||n);
END;

My quesitn is how to execute a procedure
I know one solution i.e

exec procudure_1(1);


Is there any chance to run a procedure using bind variables. If so any one can help me on this?


Thanks
Kishore
Re: How to Execute a procedure [message #431150 is a reply to message #431148] Sun, 15 November 2009 23:12 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
>Is there any chance to run a procedure using bind variables.
Yes

>If so any one can help me on this?
You can help yourself by Reading The Fine Manuals found at http://tahiti.oracle.com
or by searching http://asktom.oracle.com for examples
Re: How to Execute a procedure [message #431152 is a reply to message #431148] Sun, 15 November 2009 23:18 Go to previous messageGo to next message
ayush_anand
Messages: 417
Registered: November 2008
Senior Member
begin
procudure_1(1);
end;
/
Re: How to Execute a procedure [message #431165 is a reply to message #431148] Sun, 15 November 2009 23:38 Go to previous messageGo to next message
Michel Cadot
Messages: 63802
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Is there any chance to run a procedure using bind variables. If so any one can help me on this?

Yes there are ways... which depend on your client tool or language.

Regards
Michel

[Updated on: Sun, 15 November 2009 23:38]

Report message to a moderator

Re: How to Execute a procedure [message #431170 is a reply to message #431152] Sun, 15 November 2009 23:58 Go to previous messageGo to next message
kish_ulike
Messages: 30
Registered: June 2008
Location: chennai
Member

Thanks for your reply.

But i want pass 1 in variable like as follows

variable a number;

a:=1;
exec procedure_1(:a);

Like this is possible?
Re: How to Execute a procedure [message #431172 is a reply to message #431170] Mon, 16 November 2009 00:07 Go to previous messageGo to next message
ayush_anand
Messages: 417
Registered: November 2008
Senior Member
In SQl*plus
SQL> variable bv number
SQL> begin
  2  :bv := 8;
  3   end;
  4  /

PL/SQL procedure successfully completed.

SQL>  exec procedure_1(:bv);
Input Number is8

PL/SQL procedure successfully completed.


http://www.oracle.com/technology/support/tech/sql_plus/htdocs/sub_var3.html
Re: How to Execute a procedure [message #431197 is a reply to message #431172] Mon, 16 November 2009 02:39 Go to previous message
kish_ulike
Messages: 30
Registered: June 2008
Location: chennai
Member

Thank you very much!!!!! Razz Razz Razz
Previous Topic: Hot to Stop SQL Injections
Next Topic: how to check blob.....
Goto Forum:
  


Current Time: Sun Sep 25 23:14:12 CDT 2016

Total time taken to generate the page: 0.11481 seconds