Posts

Showing posts from 2015

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  ...