OracleScript

Warlock

Member
How use this component in Delphi 6?
I set variables :
SetVariable('var1','111')
SetVariable('var2','111')

Execute, but function GetVariable('result')
return blank string.

Example:

declare
var1 integer;
var2 integer;
result varchar2(100);
begin
result:=my_func_in_oracle(var1,var2);
end;
 
You'll need a bind variable for the result and or inputs instead of locally declared variables whose contents are not available outside the scope of the PL/SQL.
 
The TOracleScript component is not very well suited to return information from stored program units. You should probably use a TOracleQuery.

You can however use the AfterCommand event in combination with the Query property to access information about executed SQL or PL/SQL commands.

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
The TOracleScript component is not very well suited to return information from stored program units. You should probably use a TOracleQuery.

You can however use the AfterCommand event in combination with the Query property to access information about executed SQL or PL/SQL commands.


But my Oracle function change records in 2 tables, insert record into 1 table and return id this record...
 
Maybe you can use a single PL/SQL Block instead?
Code:
declare
  result varchar2(100);
begin
  result := my_func_in_oracle(...);
  update ...
     set id = result
   where ...;
end;
/

------------------
Marco Kalter
Allround Automations
 
Back
Top