Execute fnd_global.apps_initializ to set context in a SQL Optimizer session

exec fnd_global.apps_initialize(13424, 51194,222);

Of course I can run this within TOAD without issue, but I was hoping to be able to do the same within the SQL Optimizer for Oracle utility as well.

If anyone has any suggestions, they would be greatly appreciated.

Does anyone know of a way to set the application context in an Oracle E-Business Suite instance within a Quest SQL Optimizer (8.0.0.1551) for Oracle session? I’m basically trying to run the following syntax, in order to get an accurate runtime for my given query:

Hi Lewis,

SQL Optimizer allows users to run a script after connected to database so you can use this function to set the application context. To do so,

  1. Click on Options to open the Options window
  2. Under the General | Options node, check the “Execute Login Script” and then specify a file where you put your command to run.
  3. Click OK to finish

Note that you should set it before connecting to the database.

Let me know if you have other questions.

Thanks,
Alex

Excellent!

I’ve created a login script and defined it within the Quest SQL Optimizer application as you specified. The only strange thing is now, it appears that it’s having some sort of syntax issue with the parser within the Quest utility. When I try to initiate a database connection with the utility and thus run the script, it is kicking out an “ORA-00900: invalid SQL statement” error.

The only line in my Quest_SQL_Optimizer_login_script.sql script is as follows:
exec fnd_global.apps_initialize(13424, 51194,222);

And when I run this same script from SQL*Plus (from within my 10g Oracle client home, it works fine. I’m a little baffled as to why the Quest utility can’t execute this script.

After doing some research on the web, I think I’ve got it via a slight tweak. I basically changed my existing syntax to the following:
begin
fnd_global.apps_initialize(13424, 51194,222);
end;

This seems to execute successfully and work without issue.

Thanks for the assistance.