Home>Question Details



Jayme -- Thanks for the question regarding "How to run functions wich execute DML commands ?", version 9.2.0

Submitted on 19-May-2008 18:23 Central time zone
Last updated 20-May-2008 16:07

You Asked

I am using LUA to write an application that should run some Oracle functions that need parameters, and also execute inserts or update DML commands. Is there any way of running these functions without using a select (function) command ?
I was thinking of using an anonymous procedure. I didn't find any way of declaring its parameters though.

Thank you in advance.

Jayme

and we said...

Well, I've never programmed in "LUA" (actually, this is the first I've ever heard of it...)

But, typically, one invokes a stored procedure or function by:

begin
procedure_name( :x, :y, :z );
end;


NOT by calling a function from sql (that would be the exceptional way to invoke code - it would be more normal to use begin / end)


Not knowing anything about LUA or how it 'binds to oracle', I cannot tell you how to bind to a procedure, but it should not be any different than binding to an update statement...
Reviews    
2 stars I must use function calls   May 20, 2008 - 2pm Central time zone
Reviewer: Jayme Jeffman 
Dear Sir,

I must use function calls, so I was trying to do something like :
<code>
 declare x number :=0;
 begin
   x:= function_name(p1,p2,p3);
 end;
/


How can I pass parameters to the begin/end block without creating a named procedure ?</code>

Followup   May 20, 2008 - 4pm Central time zone:

I answered that

just bind

as I demonstrated above.


answer me this, what would the code look like for:

update t set x = p1, y = p2, z = p3;


you will bind p1, p2, p3 in the same way.



3 stars Thank you very much.   May 20, 2008 - 5pm Central time zone
Reviewer: Jayme Jeffman 
Dear Tom,

Thank you very much for answering my question.
You are very kind.

Regards.


5 stars So how was it done??   May 21, 2008 - 1am Central time zone
Reviewer: Karthick from India
Jayme when i googled this thread came at the top...

http://www.google.co.in/search?hl=en&q=How+to+call+oracle+function+in+LUA&meta=

so if you can post your solution in this thread it will be more useful.

Regards,

Karthick.
http://www.karthickarp.blogspot.com/


3 stars LUA. Can't argue against "Tables [being] the most important data structure" :)   May 21, 2008 - 11am Central time zone
Reviewer: Duke Ganote from Amelia, Ohio USA
http://en.wikipedia.org/wiki/Lua_%28programming_language%29

"Tables are for Lua what lists are for Lisp: powerful data-structuring mechanisms"
http://pages.citebite.com/r5m1k5a7mcub





All information and materials provided here are provided "as-is"; Oracle disclaims all express and implied warranties, including, the implied warranties of merchantability or fitness for a particular use. Oracle shall not be liable for any damages, including, direct, indirect, incidental, special or consequential damages for loss of profits, revenue, data or data use, incurred by you or any third party in connection with the use of this information or these materials.

About Oracle | Legal Notices and Terms of Use | Privacy Statement