Home » SQL & PL/SQL » SQL & PL/SQL » updating a table via a function wich is called by sql statements
updating a table via a function wich is called by sql statements [message #39118] Tue, 18 June 2002 05:36 Go to next message
Titia765
Messages: 1
Registered: June 2002
Junior Member
Hi!

I'm working on a project using JBuilder and Oracle. I
need to update a table and I want to do it in PLSQL
for speed reasons.
But I can't call this function with sql statement as
SELECT package.function(parameters) FROM dual.
because we can't use a dml statement in a querry .
error ORA-14551.

What can I do????
Re: updating a table via a function wich is called by sql statements [message #39123 is a reply to message #39118] Tue, 18 June 2002 09:37 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Execute the function using an anonymous block using bind variables:

begin
  :x := pkg.function_name(:p1, :p2);
end;


I don't know the exact object or method in JBuilder, but in Delphi, this block would go in a TQuery object and would then be executed with the ExecSQL method.
Previous Topic: index on view
Next Topic: Formating/Converting Words to numbers
Goto Forum:
  


Current Time: Fri Apr 26 06:03:51 CDT 2024