oracle - PL SQL Function -


i have below error:

failure occurred in bl9stackablepromotionmodule::createpromoperiodmap. duplicate promotions found subscriber id 123 , offer id=123, offer instance 123, charge code=abc, effective date=20150707

now want fetch subscriber, offer id, offer instance, charge code, effective date only.

for have created below function:

create or replace functiongetdyna1 ( att  in varchar, attname in varchar ) return varchar      start_index integer := 0;      end_index integer := 0;      retval varchar(100);      tmpatt varchar( 4000 );      tmpattname varchar( 4000 );   begin      tmpatt := upper( att ) ;      tmpattname := upper( attname );        start_index := instr( tmpatt , tmpattname );       if( start_index = 0 )               return 'notfound';      end if;       start_index := start_index + length( tmpattname );      end_index := instr ( tmpatt , '#' , start_index  ) ;       retval := substr( att, start_index  + 1, end_index - start_index  - 1 );       return retval;   end getdyna1;  / 

i running below query

select getdyna1(error_description,'subscriber')subscriber,cycle_seq_no error ; 

but not giving me "subscriber" value.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -