The most important is to get a password protected role:
Code: Select all
set role my_role identified by "my_password";Code: Select all
alter session set current_schema=my_schema;
When session unexpectedly disconnects (f.e. killed), the statements above should be rerun, before next query executed (or after first error).
It would be no problem, if query wouldn't automatically recreate the session (I don't know how), or it could be handled somehow, but I cannot find an even for it.
So I made this:
Code: Select all
procedure TMyDb.MyOrasessionError(Sender: TObject; E: EDAError; var Fail: Boolean);
// handling OnError event
begin
if E is EOraError then begin
if 28 = E.ErrorCode then begin // ORA-00028: your sesson has been killed
MySessionConnect; // Sets main session parameters
end;
end;
end;If I give direct table select grant (grant select on my_schema.my_table to my_user;),
then 'select * from my_schema.my_table;' works,
but 'select * from my_table;' doesn't.
It seems required statements ran, without consequences.
I use ODAC 5.70.0.28 with Delphi7, Oracle 9.2.0.4.0.