Non-DB Block P.K

Hi all
I have a non-Database block with col1,col1 ..ect , How I can prevent the user to insert redundant value in col1.
thanx in advance

hi,
what exactly you mean by 'redundant' value? You want it to be like a PK i.e. no dublicates? Generally if you want to check the value user entered and accept it or don't allow it to be inserted if it does not meet your criteria you can use WHEN-VALIDATE-ITEM trigger and do your checks in there and if your checks fail issue:
RAISE FORM_TRIGGER_FAILURE;
This will prevent focus to be removed from the item until user inserts a value that meets your criteria. So you can have a loop in this trigger and check if value is already inserted and if yes don't allow it.
Hope that helps
regards,
teo

Similar Messages

  • HOW TO CREATE MULTIPLE RECORDS IN A NONE DATABASE BLOCK?

    I have a Form where I have a none database block with unbound items. The block
    has 10 records. In the when-new-block instance I run a query by which I would
    like to fill up the block with data. The code fragment looks like the
    following:
    begin
    declare
    tmp_curr_rec_id number;
    begin
    -- a hibak kiolvasasa
    for c_hibak in ( select h.*, h.rowid
    from hibak h
    where 1=1 -- WF - Ide kerul a szurofeltetel
    order by bejelentes_datum asc
    ) loop
    -- bemasoljuk az adatokat az unbound item-ekbe
    :mc_adat.ub_azonosito := c_hibak.azonosito;
    :mc_adat.ub_verzio_letrehozas_datum :=
    c_hibak.verzio_letrehozas_datum;
    :mc_adat.ub_bejelento := c_hibak.bejelento;
    :mc_adat.ub_bejelentes_datum := c_hibak.bejelentes_datum;
    :mc_adat.ub_wf_verzio_csomopont :=
    c_hibak.wf_verzio_csomopont;
    :mc_adat.ub_wf_utolso_esemeny_szoveg :=
    c_hibak.wf_utolso_esemeny_szoveg;
    :mc_adat.ub_hiba_leiras := c_hibak.hiba_leiras;
    :mc_adat.ub_hiba_hely := c_hibak.hiba_hely;
    :mc_adat.ub_rekord_jelleg := 'H';
    :mc_adat.ub_rowid := c_hibak.rowid;
    -- beallitjuk a rekordot-ot olyanra, mintha semmi nem valtozott
    volna
    -- nem szeretnenk a form bezaraskor mindenfele figyelmezteteseket
    -- olvasni a kepernyon
    tmp_curr_rec_id := get_block_property( :system.current_block,
    current_record );
    set_record_property( tmp_curr_rec_id, :system.current_block,
    status, new_status );
    create_record;
    end loop;
    end;
    end;
    The block's update allowed, insert allowed, delete allowed property is set to
    true.
    The result of the code above is that only the last record fetched shows up in
    the block. The problem is - as I found out - is that aech record is fetched,
    the values are copied to the block items, but the create_record built-in
    command would not move the cursor to the next row.
    Can some one please help me with this?
    TIA,
    Tamas Szecsy

    The problem was with the following code segment:
    tmp_curr_rec_id := get_block_property( :system.current_block, current_record );
    set_record_property( tmp_curr_rec_id, :system.current_block, status, new_status );
    After omitting these two lines, the code worked properly.
    Thansk for all whoe replied.
    Regards,
    Tamas

  • How to create a relationsship between a DB Bock and Non DB Block

    Hi All,
    I am working with oracle forms 10g.
    I have created a Custom form. I have two block. One is a DB Block and another is control block(ie multi record blk).
    I tried to create a master detail relationship between these two block.
    Master block:LC_Master_BLK(DB Block).
    Detail block: LC_Detail_blk(Non DB Block).
    Form object navigator I click relation in Master Block and a pop up window opens and form there i select Detail block.
    And i give the join condition like
    LC_Master_BLK.PO_HEADER_ID=LC_Detail_blk.PO_HEADER_ID.
    I have made po_header_id as primary key in my custom table,refred in my master block.
    But it shows error as
    FRM-15004: Error while parsing the join condtion.
    Can any one tell me how to solve this.
    Thanks & Regards
    Srikkanth

    Hi Srikkanth.M
    I have two block. One is a DB Block and another is control block(ie multi record blk).this is what i call bad form design pls exchange the two blocks making ...
    Master block:LC_Master_BLK(Non DB Block).
    Detail block: LC_Detail_blk (DB Block).
    Now to link the 2 blocks then define the join condition as follows:
    :LC_Master_BLK.PO_HEADER_ID = :LC_Detail_blk.PO_HEADER_IDPls Keep in mind that the join condition specifies the relationship between items in 2 blocks db
    or
    one which is the master Non DB Block (to filter the display of data through user input to display the result output of data related in multi-records in the detail block.
    That how u can works with the relation between two blocks as urs..
    Hope this helps...
    Regards,
    Amatu Allah

  • Problem in Execute query on non-database block and database block together

    Hi All,
    In my form,i have
    1. First block is Non-database block with one non-database item.
    2. Second and third blocks are database blocks.
    Now the problem is that i want to perform execute-query for all the blocks.
    If the cursor is on the non-database item of 1st block and i clicks on the "Enter-query" then i am getting message " This function can not be performed here".
    If i click on the item of the database block and then clicks on the "Enter-query" and then "execute-query" it's working fine.
    But i don't want to do in this way.
    My cursor will be on the First block only and then it should perform execute-query.
    I am using this non-database item to copy value of this item to the item of the database block item.
    I think i make you understand about my problem.
    I am using forms 10g on Window xp.
    Please help me.

    Hi!
    Simply create a enter-query trigger on the non-database-block:
    begin
    go_block ( 'database_block' );
    enter_query;
    end;If your search criteria is in the non-database-item in the first block,
    you actually do not need the enter_query build-in.
    Just create a execute-query trigger on the first block like:
    begin
    go_block ( 'database_block' );
    execute_query;
    go_item ( :System.trigger_item );
    end;And in a pre-query trigger on the database-block copy the
    value of your seach item into the item you want to search for.
    Regards

  • Ordering a non-database block....

    Hi ,
    Is it possible to order and how a non-database block according to user's willing...????
    Thanks , a lot
    Simon

    That will work in sql*plus but to use it in a program you'll need to parameterise the Order By clause. That's why I wrote mine the way I did. It will work in sql*plus if you enter 'A' and 'B' (including the quotes) and it will work in a program if you replace the placeholders with variables.
    SQL> WITH data AS(
      2    SELECT 1 a, 9 b FROM dual UNION ALL
      3    SELECT 1 a, 1 b FROM dual UNION ALL
      4    SELECT 1 a, 8 b FROM dual UNION ALL
      5    SELECT 1 a, 2 b FROM dual UNION ALL
      6    SELECT 1 a, 7 b FROM dual UNION ALL
      7    SELECT 2 a, 8 b FROM dual UNION ALL
      8    SELECT 3 a, 7 b FROM dual UNION ALL
      9    SELECT 4 a, 6 b FROM dual UNION ALL
    10    SELECT 5 a, 5 b FROM dual UNION ALL
    11    SELECT 6 a, 4 b FROM dual UNION ALL
    12    SELECT 7 a, 3 b FROM dual UNION ALL
    13    SELECT 8 a, 2 b FROM dual UNION ALL
    14    SELECT 9 a, 1 b FROM dual
    15  )
    16  SELECT a, b FROM data
    17  ORDER BY
    18    Decode(&ordr1,'A',a,'B',b),
    19    Decode(&ordr2,'A',a,'B',b)
    20  ;
    Enter value for ordr1: 'A'
    old  18:   Decode(&ordr1,'A',a,'B',b),
    new  18:   Decode('A','A',a,'B',b),
    Enter value for ordr2: 'B'
    old  19:   Decode(&ordr2,'A',a,'B',b)
    new  19:   Decode('B','A',a,'B',b)
             A          B
             1          1
             1          2
             1          7
             1          8
             1          9
             2          8
             3          7
             4          6
             5          5
             6          4
             7          3
             8          2
             9          1
    13 rows selected.
    SQL> /
    Enter value for ordr1: 'B'
    old  18:   Decode(&ordr1,'A',a,'B',b),
    new  18:   Decode('B','A',a,'B',b),
    Enter value for ordr2: 'A'
    old  19:   Decode(&ordr2,'A',a,'B',b)
    new  19:   Decode('A','A',a,'B',b)
             A          B
             1          1
             9          1
             1          2
             8          2
             7          3
             6          4
             5          5
             4          6
             1          7
             3          7
             1          8
             2          8
             1          9
    13 rows selected.
    SQL> var ordr1 varchar2(1);
    SQL> var ordr2 varchar2(1);
    SQL> exec :ordr1 := 'A';
    PL/SQL procedure successfully completed.
    SQL> exec :ordr2 := 'B';
    PL/SQL procedure successfully completed.
    SQL> WITH data AS(
      2    SELECT 1 a, 9 b FROM dual UNION ALL
      3    SELECT 1 a, 1 b FROM dual UNION ALL
      4    SELECT 1 a, 8 b FROM dual UNION ALL
      5    SELECT 1 a, 2 b FROM dual UNION ALL
      6    SELECT 1 a, 7 b FROM dual UNION ALL
      7    SELECT 2 a, 8 b FROM dual UNION ALL
      8    SELECT 3 a, 7 b FROM dual UNION ALL
      9    SELECT 4 a, 6 b FROM dual UNION ALL
    10    SELECT 5 a, 5 b FROM dual UNION ALL
    11    SELECT 6 a, 4 b FROM dual UNION ALL
    12    SELECT 7 a, 3 b FROM dual UNION ALL
    13    SELECT 8 a, 2 b FROM dual UNION ALL
    14    SELECT 9 a, 1 b FROM dual
    15  )
    16  SELECT a, b FROM data
    17  ORDER BY
    18    Decode(:ordr1,'A',a,'B',b),
    19    Decode(:ordr2,'A',a,'B',b)
    20  ;
             A          B
             1          1
             1          2
             1          7
             1          8
             1          9
             2          8
             3          7
             4          6
             5          5
             6          4
             7          3
             8          2
             9          1
    13 rows selected.
    SQL> exec :ordr1 := 'B';
    PL/SQL procedure successfully completed.
    SQL> exec :ordr2 := 'A';
    PL/SQL procedure successfully completed.
    SQL> /
             A          B
             1          1
             9          1
             1          2
             8          2
             7          3
             6          4
             5          5
             4          6
             1          7
             3          7
             1          8
             2          8
             1          9
    13 rows selected.
    SQL>

  • Enter_query for non-database block

    Hi there,
    I have a non-database block. When I click on enter query button from toolbar, i get"this function cannot be performed here' error. I want to bring up records based on certain math calculations. I was planning to write a pre-query trigger and add those to pre-query trigger. Will it work since it is a non-database block? Or should i create a button on form to get records populated?
    Thanks

    You won't be able to use the Query-Process-triggers PRE-QUERY and POST-QUERY on a non-database-block.
    But... If you want to "simulate" the behaviour of querying, you can use the KEY-EXEQRY-trigger and put your logic there. This should also work with the standard forms-menus. To supress the error-message on entering query-mode you should additionally write as KEY-ENTQRY-trigger with code NULL;

  • Multi-Record (NON-DB) block - duplicate records

    I have a non-db block called 'EDITOR_INFO' that captures all the editor's information. The block has the following fields in it: editor_name,editor_type,address_lines1 thru4, city, state, zip, taxid_ssn_type,taxid_ssn.
    I need to check to make sure that the user is not entering the duplicate editors. How can I adapt the infamous Kevin Clarke's solution to this (if at all)? What would be my datablock, control block etc?
    Can any one pls. provide any guidance.
    Thanks,
    Chiru
    Edited by: Megastar_Chiru on Nov 8, 2010 3:55 PM
    Edited by: Megastar_Chiru on Nov 8, 2010 3:56 PM

    Chiru, if all you need is to add/query records in a block, you should consider making a data-block instead of control-block. And use POST to post the data into table which will let you check against the table if a record exists or not.
    But if you want to have it done using a control-block then follow below sample steps.
    In WHEN-VALIDATE-RECORD of your control block, you can check if entered record is already in the table or not.
    If it exists, then raise error message and stop until user corrects the data... if it does not exist, then INSERT into the table.
    For this scenario, I created a small table with two columns.
    CREATE TABLE TABLE_A (Col1 NUMBER, Col2 VARCHAR2(30));Now I created a form with a control block (BLOCK2). It has 10 records with vertical layout and two control-items on it (TEXT_ITEM4 and TEXT_ITEM5). And below is code used on WHEN-VALIDATE-RECORD.
    -- WHEN-VALIDATE-RECORD
    DECLARE
      temp VARCHAR2(1);
      CURSOR c_check_existance IS
      SELECT 'X'
        FROM table_a
       WHERE col1 = :BLOCK2.text_item4;
    BEGIN
        :GLOBAL.Valid_Records := 'N';
         IF :block2.text_item4 IS NOT NULL THEN          
              OPEN c_check_existance;
              FETCH c_check_existance INTO temp;
              IF c_check_existance%FOUND THEN
                   CLOSE c_check_existance;
                                                    :GLOBAL.Valid_Records := 'N';
                   MESSAGE('Record already exists in table');
                   RAISE FORM_TRIGGER_FAILURE;
              ELSE
                   INSERT INTO table_a (col1, col2)
                                VALUES (:block2.text_item4, :block2.text_item5);
                                                    :GLOBAL.Valid_Records := 'Y';
              END IF;
              CLOSE c_check_existance;
         END IF;
    END;Remember, when making a control block like a data block, you have to code everything yourself.

  • ADF : Non Database Block Fields Validation

    How should I add validation to "Non Database Block Fields"?
    My question is based on this example:
    see http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    "24. Passing User-Entered Data in "Non Database Block Fields" to Stored Procedure/Function"
    http://otn.oracle.com/products/jdev/tips/muench/stprocnondbblock/PassUserEnteredValuesToStoredProc.zip
    Should I add the validation to an Entity Object (where no fields are 'linked' to database fields) on which I base the "NonDBBlock" View Object?
    If this is "Entity Object abuse" (because no database involved, only validation), what would be a better approach?
    many thanks
    Jan Vervecken

    hi Steve
    If all the attributes in my Entity Object are marked as not persistent, it makes sense this Entity Object doesn't "take part" in a transaction.
    I would like to avoid the message box about Commit or Rollback when closing my Frame, because this use case isn't transaction related in any way.
    It seems to work if I override the getPostState() method like this:
    public byte getPostState()
         return EntityImpl.STATUS_UNMODIFIED;
    question :
    Are there any side effects to this approach or is there another way to mark an Entity Object as "not in any transaction"?
    thanks
    Jan

  • Execute query with non database block

    How to execute query with non database block when new form instance trigger.

    Hi Kame,
    Execute_Query not work with non database block. To do this Make a cursor and then assign values to non database block's items programmatically, see following example,
    DECLARE
    BEGIN
         FOR i IN (SELECT col1, col2 FROM Table) LOOP
                :block.item1 := i.col1;
                :block.item2 := i.col2;
                NEXT_RECORD;
         END LOOP;
    END;
    Please mark if it help you or correct
    Regards,
    Danish

  • Sorting in Non-Database Block.

    I have a form having a non-database block having different columns.
    It is required that the user can sort the data by every columns while he is entering the data.
    Please help me out.
    Thanks

    I have a form having a non-database block having different columns.
    It is required that the user can sort the data by every columns while he is entering the data.
    Please help me out.
    Thanks

  • Forms - query into non database Block

    This is the data in the table. I am querying into a non database block.Have two lines of data
    1. 1062|Sanitation and Cleaning|N|1025
    2. 1063|Eyewash|N|1025
    go_block('qc_procedures');
    first_record;
    loop
    Open C3;
    Fetch C3 into :qc_procedures.procedure_id,
    :qc_procedures.procedure_desc,
    :qc_procedures.optional,
    :qc_procedures.procedure_type_id;
    Exit when :system.last_record = 'TRUE';
    next_record;
    Close C3;
    End loop;
    I am only able to get the first line of data

    I'm not quite sure if i understand your problem.
    First, you didn't post the definition of your cursor C3.
    Second, if you want to populate the block using the cursor, you should loop over the cursor and not over the block, something like
    Open C3;
    first_record;
    loop
      Fetch C3 into :qc_procedures.procedure_id,
      :qc_procedures.procedure_desc,
      :qc_procedures.optional,
      :qc_procedures.procedure_type_id;
      Exit when C3%NOTFOUND;
      next_record;
    Close C3;Third, it would be much easier to base your block on a table or on your query (using FROM-clause-query), then there would be no need for any code.

  • SD non credit block

    our delivery document was blocked, how will I know it is blocked by credit or non-credit block, if it is non credit block, how to release the block? if it is credit block(FSCM credit management), it is based on ship to party or sold to party?

    Dear  join
    Before asking Basic questions please look into Google
    Coming to your point we can find Blocked Delivery documents due to credit limit In VKM5
    And you can release in VKM4
    But some times some users will block the customers in XD05 For not creating Delivery's
    so in this case we are unable to trace the customers which customers to  which Delivery documents  are blocked   .. not possible but we can use SQVI Report
    check this link ...Lakshimpathi sir post Delivery Block
    V.14 Sales order blocked
    VA14L Delivery blocked
    let me know for further help
    Thanks a lot
    venu

  • Patch & Non Standard block

    Hello everybody,
    1) When might one choose non-standard block sizes?
    2) Why do we need to apply patch? Just to fix bugs?
    Thanks in advance
    Regards

    992801 wrote:
    1) When might one choose non-standard block sizes? Assuming that you mean "why might I create a tablespace that uses a block size that is different than the block size of the database," the reason Oracle built that functionality was to facilitate transporting a tablespace from one database to another when they used different block sizes. That's generally the only reason this makes sense. There are a handful of cases where there might be a valid reason that it might benefit performance but it that is quite rare and changing the block size is even less frequently the best way to solve the performance problem.
    Justin

  • RM-30410: Warning: Single Record property ignored for non-control block

    Hi gurus,
    I have one block, as oracle default behavious is that when any user enters record and during that if he/she hits down arrow key then it gets to next new record, i want to prevent this behaviour.
    In other words i want that user should not enter second record and if he or she needs to enter second record after saving first then user can only do if he navigate to the form second time.
    In property pallete i put yes to single record but when i compile the form it gives me following warning
    FRM-30410: Warning: Single Record property ignored for non-control block Employees
    Created form file C:\my_forms\employees.fmxPlease seeks help that how can i sort it out.
    Thank you
    Hina

    if he/she hits down arrow key then it gets to next new record, i want to prevent this behaviour. Change the block's key-down and/or key-nxtrec trigger to
    begin
      null;
    end;(or give the user a message "Key not allowed here").

  • Query a database block based on a non-database block

    hi everybody
    can anybody help me as how to query a database block based on a non-database block, without a master-detail relationship?
    i have a block : date_input which contains a non-database item: start_date
    another database block (event_block)containing details of an event
    i have to input a date in the start_date and query the event_block
    in wich trigger should i insert the code?
    thanks

    If you are trying to query your database block (event_block) using the value from start_date in your non-database block, then you can set the Where clause in the database block using:
    SET_BLOCK_PROPERTY ('event_block', DEFAULT_WHERE, 'your where clause that includes start_date');
    Place this statement in a trigger that is executed prior to the block being queried.

Maybe you are looking for

  • Problem with SystemTray on FC5 KDE

    Hello! I'm trying to use new Java6 feature - SystemTray. There is problem with it on my Fedora Core 5 in KDE - system tray icon simply goes crazy (it appears and disappears, mainly disappears :( , sometimes it is moving on system tray in random direc

  • Instant client 64 bit

    HI, I have a new compiuter that I am setting up. It was origionally installed as a 32 bit. However, a problem resulted in a re-build and OS 64 bit was installed. Now I am trying to install the ODBC 64 bit version and connect to Visual Studio. I have

  • Authorization control of PR creation from maintenance order

    Hi, I want to control creation of PR through maintenance order (Service as well as material PR) for only some users with the use of authorization object control.PR should not be created for this users. Can anyone suggest me which authorization object

  • Manage my alerts and reminders not showing in personal settings in project server 2013

    I as an administrator can see the Manage my alerts and reminders in personal setting in the server setting page. Other than administrators, no body else can view this option. For example, a user who is assigned to the team members group with the My t

  • DLL files not supported on soundbooth CS4

    Hi there, I use soundbooth CS4 and downloaded some plugins, After the plugins are downloaded i open the downloads folder on my computer there is the plugin and a read me file. i click on the plugin and soundbooth opens. but when its done loading i ge