Hello
there is a handy script (file login.sql) used to run a script whenever a command-window is opened.
It would by nice if the same functionality exists for SQL-Window , as we can not run SQL statement inside SQL-window, for example, we want to update the data in SQL-Window from the grid directly, we select the rows, open the lock, but when pressing commit, an error raise from the table API because this update is illegal (violate some business-rules), but I (as an administrator) want to update the data and bypass the API checks, this situation can not be done in the same session inside this SQL-Window unless there is a way to run some SQL commands (or PL-SQL) before the actual SELECT:
exec package_name.do_something; -- a procedure to set some session-specific variables in the table api package
select t.*, t.rowid from table_name t where ...
the first line wont execute , throwing an error.
So if we managed to put this line in a new tab in SQL-Window (call it for example "Before Run Script") , in this case the problem will be solved because it runs in the same session.
It is more appropriate and more dynamic that if there is a dedicated file (like login.sql) specialized for SQL-Window , to be executed (load the script into the "Before Run Script" tab) every time we open a new SQL-Window. By default this file is empty.
thank you.
				
			there is a handy script (file login.sql) used to run a script whenever a command-window is opened.
It would by nice if the same functionality exists for SQL-Window , as we can not run SQL statement inside SQL-window, for example, we want to update the data in SQL-Window from the grid directly, we select the rows, open the lock, but when pressing commit, an error raise from the table API because this update is illegal (violate some business-rules), but I (as an administrator) want to update the data and bypass the API checks, this situation can not be done in the same session inside this SQL-Window unless there is a way to run some SQL commands (or PL-SQL) before the actual SELECT:
exec package_name.do_something; -- a procedure to set some session-specific variables in the table api package
select t.*, t.rowid from table_name t where ...
the first line wont execute , throwing an error.
So if we managed to put this line in a new tab in SQL-Window (call it for example "Before Run Script") , in this case the problem will be solved because it runs in the same session.
It is more appropriate and more dynamic that if there is a dedicated file (like login.sql) specialized for SQL-Window , to be executed (load the script into the "Before Run Script" tab) every time we open a new SQL-Window. By default this file is empty.
thank you.
 
 
		 
 
		