OracleScript wrong result

Hi Support,
I realized that running in a script if there is the command 'GRANT EXECUTE ON DBMS_REFRESH TO MyUSER' the result of the EXECUTE is false even on then the GRANT is assigned correctly and the Session.ReturnCote is equal to 0

Could you please verify this ?

Thanks

var AUserName := 'MyUSER';

spm := TOracleScript.create
try
spm.Session := ASession;

// spm.Lines.Add('GRANT UNLIMITED TABLESPACE TO '+AUsername+' WITH ADMIN OPTION;');
spm.Lines.Add('GRANT EXECUTE ON DBMS_REFRESH TO '+AUsername+';');

result := spm.execute // ==> result = false but ( ASession.ReturnCode = 0 )

finally
FreeAndNil( spm );
end;
 
This seems to work fine for me. Execute returns True for a successful grant, and False for a failed grant. What do you see when you add this line after execution?

ShowMessage(spm.Commands[0].ErrorMessage);

Note that you cannot use ASession.ReturnCode here. It only applies to session level functions or procedures, such as session.commit, session.rollback, and so on.
 
...ok thank you very much for the info.
I found out that on my reference database the dbms_refresh package is not 'GRANTABLE'.

ASession.ReturnCode i had only used it temporarily for this case.
Now spm.execute correctly returns the value and so all is well

Thanks for the support.
Alberto
 
Back
Top