Oracle PLSQL procedure - availability and renewal cycle -


i wants write pl sql procedure

  • check date - deployment date + 6 months <=sysdate (i.e add_months (v_evl_date, 6) <= sysdate) login enable else ask token.

  • once token validated data being updated , use next 6 months , user can work. again if next 6 months end should again ask token , data updated diff data set cycle occurs every 6 months.

  • used token not valid next cycle or reuse.

here bad try

create or replace function validate_xyz(   v_getkey in varchar2 ) return boolean    v_key      varchar2(1000):='';   v_evl_date date; begin    v_key                     :=null;   v_evl_date                :=to_date('15/05/2017','dd/mm/yyyy');    if  add_months (v_evl_date, 6) <= sysdate         dbms_random.seed (val => 17061986);      in 0 ..10     loop        v_key := dbms_random.value(low => 1, high => 10);        /*    accepted keys fixed , match against         v_key  - 2.31434246044443627721368144904075038613       v_key  - 8.90844849971977228731811693583903779363       v_key  - 1.34697945811262561589006445666020254065       v_key  - 9.58712840571811653940379331909211626142       v_key  - 7.53497637096031545968508878377437375415       v_key  - 5.51110038563370831198852549443728245139       v_key  - 1.72699584831610823611824953708750321341       v_key  - 2.80536691985350616678805352908747466606       v_key  - 5.91281811604424007124143383870390349847       v_key  - 4.15028473674054704507203594999547933188       v_key  - 6.10548946122199556568384389485681624081       */        -- dbms_output.put_line('v_getkey  - '||v_getkey);        if v_getkey = v_key      return true;      dbms_output.put_line('value matched access granted.');       else     --return false;     dbms_output.put_line('value not matched.');     --raise_application_error (-20001,'the key enter not valid license key.');      -- else      --   dbms_output.put_line('value matched');       end if;     end loop;   end if;  exception when others    raise_application_error (-20001,'the key enter not valid key.'); end; / 


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -