Codessentials

  • Increase font size
  • Default font size
  • Decrease font size
Home Coding tips Oracle Out and InOut parameters in dynamic sql

Out and InOut parameters in dynamic sql

Here is how you can use an out parameter in dynamic sql:

declare
lCommand varchar2(256);
lSum number;
lP1 number := 10;
lP2 number := 5;
begin
lCommand := 'begin :1 := makeSum (:2, :3); end;';
execute immediate lCommand using out lSum, lP1, lP2;
end;

 Be careful with the order of the parameters:   :1 is the first parameter in the string and thus corresponds to the first parameter in the using list. Therefor "out lSum" must be first too.

And here is how you use an in-out parameter:

declare
lCommand varchar2(256);
lWord := 'mistacke';
begin
lCommand := 'begin spellCheck (:1); end;';
execute immediate lCommand using in out lWord;
end;

 

 

Bookmark

AddThis Social Bookmark Button

Related Articles


Newsflash

Yadis! Backup 1.9.8 is released!

See the new features right here!

Download this version here!