1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Small help regarding oracle forms

Discussion in 'Oracle Forms and Reports' started by TeAmEr, Dec 27, 2008.

  1. TeAmEr

    TeAmEr Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Hi everyone

    i don't know anything in oracle forms , and all what i want to do is the following :

    I have a table called 'fp_log' with 2 columns 'ID' and "UIS'
    I have another table called 'EMP' with a column 'FP' which is a 'LONG RAW' type and another column 'EMP_ID'

    i have a button and when i press the button with F11 i need to write code into it , the code should do the following :

    check if the column 'FP' in table 'EMP' has a value or is it a null when EMP_ID = x for example

    if it has a value and not a null i need to check if column 'UIS' in table 'FP_LOG' where ID in 'FP_LOG' is equal 1 is equal to 'EMP_ID' to show a message "Wrong FP" then exit the code without completing the rest of it .

    in other language :
    If (FP from EMP where EMP_ID = x) is not empty then
    -- if (UIS from FP_LOG where ID=1) != (EMP_ID) then
    -- -- message "WRONG FP"
    -- -- exit the button function without doing the rest of the code
    -- end if
    end if

    it is an easy job for who knows oracle at least a little :)

    and thanks in advance :)
     
  2. tyro

    tyro Forum Genius

    Messages:
    368
    Likes Received:
    20
    Trophy Points:
    260
    Location:
    India
    You can try the follow code:
    Code (Text):

    declare
    temp_fp long raw := null;
    temp_uis number := null;

    begin
    select fp
    into temp_fp
    from emp
    where emp_id = x;

    if temp_fp is not null then
    select uis
    into temp_uis
    from fp_log
    where id = 1;

    if temp_uis != x then
    message('wrong fp');
    message(' ',no_acknowledge);
    end if;
    end if;

    end;
     
    tell me if this is of help...

    regards
     
  3. TeAmEr

    TeAmEr Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Thanks man :-D it worked :)