Tuesday 11 April 2017

Call PL/SQL procedure from URL in Oracle APEX

Here are few simple steps to follow before calling procedure from browser-


  • Provide access on your procedure to "ANONYMOUS" user by executing-


grant execute on SCHEMA_NAME.PROCEDURE_NAME to ANONYMOUS;

  • modifying the APEX function wwv_flow_epg_include_mod_local by  executing below code

CREATE OR REPLACE function APEX_050100.wwv_flow_epg_include_mod_local(
    procedure_name in varchar2)
return boolean
is
begin     
    if upper(procedure_name) in (
          'SCHEMA_NAME.PROCEDURE_NAME') then
        return TRUE;
    else
        return FALSE;
    end if;
end wwv_flow_epg_include_mod_local;
/

Apex schema name will vary based on version like for APEX_050100,APEX_050000,APEX_040100... etc.

Note: login with SYSTEM account to execute above code.

Sunday 18 November 2012

String Tokenizer

Uses StringTokennizer to split a string by “space” and “comma” delimiter, and iterate the StringTokenizer elements and print it out one by one.


import java.util.StringTokenizer;
 
public class App {
 public static void main(String[] args) {
 
  String str = "This is String , split by StringTokenizer, created by Himanshu";
  StringTokenizer st = new StringTokenizer(str);
 
  System.out.println("---- Split by space ------");
  while (st.hasMoreElements()) {
   System.out.println(st.nextElement());
  }
 
  System.out.println("---- Split by comma ',' ------");
  StringTokenizer st2 = new StringTokenizer(str, ",");
 
  while (st2.hasMoreElements()) {
   System.out.println(st2.nextElement());
  }
 }
}