Posts

Dynamically Switch Theme on change Module

1.) Create an Application Item with name MODULE_TYPE 2.) Create an Application Process e.g. SET_THEME_STYLE at point On Load: Before Header DECLARE l_current_theme_number number; l_new_theme_style_id number; BEGIN select theme_number into l_current_theme_number from apex_application_themes where application_id = :app_id and ui_type_name = ‘DESKTOP’ and is_current = ‘Yes’; if :MODULE_TYPE is not null then if :MODULE_TYPE = ‘KARIANA’ then apex_theme.set_session_style ( p_theme_number => l_current_theme_number, p_name => ‘Vita’ ); elsif :MODULE_TYPE = ‘FOOD’ then apex_theme.set_session_style ( p_theme_number => l_current_theme_number, p_name => ‘Vita – Dark’ ); elsif :MODULE_TYPE = ‘MEDICAL’ then apex_theme.set_session_style ( p_theme_number => l_current_theme_number, p_name => ‘Vita – Red’ ); elsif :MODULE_TYPE = ‘AGRICULTURE’ then apex_theme.set_session_style ( p_theme_number => l_current_theme_number, p_name => ‘Vita – Slate’...

Load image in base64 formate in database column from directory reference filename stored in table

11.)     First create base64encode function   CREATE OR REPLACE FUNCTION base64encode(p_blob IN BLOB)   RETURN CLOB -- ----------------------------------------------------------------------------------- -- File Name     : https://oracle-base.com/dba/miscellaneous/base64encode.sql -- Author        : Tim Hall -- Description   : Encodes a BLOB into a Base64 CLOB. -- Last Modified: 09/11/2011 -- ----------------------------------------------------------------------------------- IS   l_clob CLOB;   l_step PLS_INTEGER := 12000; -- make sure you set a multiple of 3 not higher than 24573 BEGIN   FOR i IN 0 .. TRUNC((DBMS_LOB.getlength(p_blob) - 1 )/l_step) LOOP     l_clob := l_clob || UTL_RAW.cast_to_varchar2(UTL_ENCODE.base64_encode(DBMS_LOB.substr(p_blob, l_step, i * l_step + 1)));   END LOOP;   RETURN l_clob; END; / 2.) Then create ...

Parsing json using webservice url

firstly you should install json parsing package. you will find it at http://sourceforge.net/projects/pljson/ or https://github.com/pljson/pljson declare l_http_request   UTL_HTTP.req; l_http_response  UTL_HTTP.resp; l_response_text  CLOB; acd VARCHAR2(32767); buf VARCHAR2(32767); l_list json_list; empno           number; ename         VARCHAR2(100); job        VARCHAR2(100); mgr         number; hiredate         VARCHAR2(100); sal         number; comm         varchar2(200); deptno     number; obj json; --get json from url begin l_http_request := UTL_HTTP.begin_request('http://127.0.0.1:9000/ords/anuj/anuj/emp/', 'GET'               , 'HTTP/1.1'               ); l_http_response := UTL_HTTP.get_response(l_http_request); B...

Read text file from specified range usins pl/sql

This blogs will helps you to read text file from the specified range. you have a text file like this: 103  smith     20   32000     new jersy 105  Anderson  30   32000     new jersy 108  jack      40   37000     capetown 107  jackie    30   24000     melborn 128  saudi     20   17000     auckland 131  ramesh    40   30000     ghaziabad 123  kalki     50   20000     noida   153  ashish    50   20000     noida   First of you should create directory: CREATE OR REPLACE DIRECTORY DATA_FETCH AS '/usr/bin/bfile_dir'; then provide grant previllage to user: GRANT read, write ON DIRECTORY  DATA_FETCH  TO user; then use following source code: DECLARE    l_fileID_r  ...