Posts

Showing posts with the label package

Compiling Oracle code from Atom text editor

Image
Just yesterday I was watching a webinar titled: "Fill the Glass: Measuring Software Performance" which featured Jorge Rimblas. You can check out the video on Vimeo at the following URL:  https://vimeo.com/140068961 . It's just giving an insight into a project Jorge is working on, giving various tips here and there - so if you have a minute (rather, an hour) to spare, go and check it out. One of the sections that particularly caught my attention was the fact Jorge was able to compile packages from his editor of choice (which is Sublime text editor) (this happens at around the 18:20 mark). Because I like free (and open source) software, I actually use Atom text editor. Being centred around a plugin ecosystem, I was curious how he was able to do this - and if in fact I'd be able to accomplish the same, in Atom. So, first of all I did some hunting to see how it was done in Sublime. This led me to this great post by Tim St. Hilaire -  http://wphilltech.com/sublime-text...

Identifying functions and procedures without arguments

I wanted to find a report on all procedures in my schema, that accepted zero arguments. There are two views that are useful here: USER_PROCEDURES USER_ARGUMENTS With USER_PROCEDURES, if the row is referring to a subprogram in a packaged, object_name is the package name, and procedure_name is the name of the subprogram. With any other subprogram out of the context of a package, the object_name is the name of the subprogram and procedure_name returns NULL. With user_argument, object_name becomes the name of the subprogram, with package_name being NULL when you are not dealing with a package's subprogram.  In the case of subprograms out of the package context, no rows are returned in the user_arguments  view. That differs from a subprogram in a package - you get a row, but argument_name is set to NULL. You will never get a NULL argument if there is at least one argument. In the case of functions, you will get an additional argument with argument_name set to NU...

APEX 5 API changes

Based on the current beta API docs:  https://docs.oracle.com/cd/E59726_01/doc.50/e39149/toc.htm , here is what's changed. APEX_APPLICATION_INSTALL Function GET_AUTO_INSTALL_SUP_OBJ added  Procedure SET_AUTO_INSTALL_SUP_OBJ added APEX_CUSTOM_AUTH LOGOUT procedure deprecated APEX_ESCAPE Function JSON added Function REGEXP added APEX_INSTANCE_ADMIN Procedure CREATE_SCHEMA_EXCEPTION added Procedure FREE_WORKSPACE_APP_IDS added Function GET_WORKSPACE_PARAMETER added Procedure REMOVE_SCHEMA_EXCEPTION added Procedure REMOVE_SCHEMA_EXCEPTIONS added Procedure REMOVE_WORKSPACE_EXCEPTIONS added Procedure RESERVE_WORKSPACE_APP_IDS added Procedure RESTRICT_SCHEMA added Procedure SET_WORKSPACE_PARAMETER added Procedure UNRESTRICT_SCHEMA added APEX_IR Procedure CHANGE_SUBSCRIPTION_EMAIL added Procedure CHANGE_REPORT_OWNER added APEX_LDAP Function SEARCH added APEX_PLUGIN_UTIL Function GET_ATTRIBUTE_AS_NUMBER added APEX_UTIL Procedure CLOSE_O...

Logging in without user intervention

For this, I set up an authentication plugin and behind the scenes it's using a web service to check if the client is valid or not. To automate the login process, you need to make use of the sentry function that gets called every time you access a page in the application. This is what the item help says: Enter the name of the PL/SQL function the plug-in can use to perform the session sentry verification. It can reference a function of the anonymous PL/SQL code block, a package function or a stand alone function in the database. For example: check_ldap_session_sentry When referencing a database PL/SQL package or stand alone function, you can use the #OWNER# substitution string to reference the parsing schema of the current application. For example: #OWNER#.check_ldap_session_sentry There is however one caveat with this. It doesn't run on whatever you have defined as the login page (User interface attributes --> Desktop --> Login URL) - which is reasonable enough. ...

Debugging parameterised views outside of apex

Recently I've been working on a project that had some views that needed to reference some session state information, which uses the ever too familiar v function: select * from some_table where some_item = v('P1_SOME_ITEM') Since I work extensively in SQL Developer, when I'm debugging, it becomes a bit more difficult, because we are outside the context of your apex session, our views data comes back empty. One solution I've come up with to help with this is using some un-documented procedures to create an apex session outside the apex scope. Actually, I can't take the credit, I stole the code from  @martindsouza 's blog  with a few minor adjustments. create or replace package apex_session_utl as procedure re_init_session( p_session_id in apex_workspace_sessions.apex_session_id%type); function get_session_username( p_session_id in apex_workspace_sessions.apex_session_id%type) return apex_workspace_sessions.user_name...