我在 Oracle 中创建了一个函数,该函数将记录插入特定表中,并根据函数内发生的情况返回输出。例如(ins_rec返回编号)
如何在 Delphi 中调用该函数并查看其输出?
我收到了 sql plus 的回复(非常感谢),但我需要知道如何在 Delphi 中做到这一点
最佳答案
只需将用户定义的函数作为查询中的列名称传递即可。
示例:
Var
RetValue: Integer;
begin
Query1.Clear;
Query1.Sql.Text := 'Select MyFunction(Param1) FunRetValue from dual';
Query1.Open;
if not Query1.Eof then
begin
RetValue := Query1.FieldByName('FunRetValue').AsInteger;
end;
end;
关于oracle - 如何从 Delphi 调用 Oracle 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5127669/