Code: Select all
SQL> select banner from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
PL/SQL Release 12.2.0.1.0 - Production
CORE 12.2.0.1.0 Production
TNS for Linux: Version 12.2.0.1.0 - Production
NLSRTL Version 12.2.0.1.0 - Production
SQL> create or replace procedure test_authid
2 authid current_user
3 is
4 begin
5 null;
6 end test_authid;
7 /
Procedure created
SQL>
Direct ModeDelphi 10.2 Update 3
ODAC 10.2.6
Code: Select all
uses
Ora;
procedure TForm1.b1Click(Sender: TObject);
var
OraSession: TOraSession;
OraStoredProc: TOraStoredProc;
begin
OraSession := TOraSession.Create(Self);
OraStoredProc := TOraStoredProc.Create(Self);
try
OraSession.Server := 'myOracleServer:1521:sn=myService;
OraSession.Username := 'username';
OraSession.Password := 'password';
OraSession.Options.Direct := True; // <----------
OraSession.Connect;
OraStoredProc.Session := OraSession;
OraStoredProc.StoredProcName := 'test_authid';
OraStoredProc.Prepare; // <- Exception class EDBError with message 'Unknown error 1'.
finally
FreeAndNil(OraStoredProc);
if OraSession.Connected then
OraSession.Close;
FreeAndNil(OraSession);
end;
end;
Code: Select all
uses
Ora;
procedure TForm1.b1Click(Sender: TObject);
var
OraSession: TOraSession;
OraStoredProc: TOraStoredProc;
begin
OraSession := TOraSession.Create(Self);
OraStoredProc := TOraStoredProc.Create(Self);
try
OraSession.Server := 'myOracleServer';
OraSession.Username := 'username';
OraSession.Password := 'password';
OraSession.Options.Direct := False; // <----------
OraSession.Connect;
OraStoredProc.Session := OraSession;
OraStoredProc.StoredProcName := 'test_authid';
OraStoredProc.Prepare; // <- OK!
finally
FreeAndNil(OraStoredProc);
if OraSession.Connected then
OraSession.Close;
FreeAndNil(OraSession);
end;
end;