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

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

  • 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;

  • 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

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

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

  • Date query in non database block

    Hi Experts
    I am doing query in a database via a non data base block.The field in which i want to query is join(DD-MON-YYYY hh24:MI:SS) and my non database block is join.
    I want that i shall give the date in the join field like DD-MON-YYYY format and the related datafrom the database will come out.
    So In the KEY-EXEQRY i have written
    IF :system.mode = 'ENTER-QUERY' THEN
    IF :EMP.JOIN_DATE is not null then
    TRUNC(:EMP.JOIN_DATE):=to_date(:EMP.JOIN,'DD-MON-YYYY');
    END IF;
    END IF;
    EXECUTE_QUERY;
    It is showing compilation error.
    The construct is not allowed as the origin of an assignment
    Can you please tell me what is wrong with it.
    detail of join is -
    data type -char
    Regards
    Rajat

    To restrict a query to something based on a non-database-block you need a different approach:
    1. Do nothing in the KEX-EXEQRY-trigger
    2. Create a PRE-QUERY-trigger with the following logic:
    IF :CTRL.JOIN_DATE is not null then
      SET_BLOCK_PROPERTY('EMP', ONETIME_WHERE, 'TRUNC(JOIN_DATE)=TRUNC(:CTRL.JOIN_DATE)');
    END IF;I assumed the following:
    - CTRL is the name of your non-database-block and EMP is your database-block
    - There is an item JOIN_DATE of datatype DATE in your CTRL-block
    - There is a database-column named JOIN_DATE in yourt EMP-table.
    - You are using Forms 10g, if not use DEFAULT_WHERE instead of ONETIME_WHERE
    If one of these is not TRUE, adjust the code i provided to match your object-names.

  • Sort a non database item

    I have one datablock (ma_erz) in my forms based on the table test1.
    Datase-Items of table test1:
    :ma_erz.MAE_ID,
    :ma_erz.MAE_SYSART
    Non-Database-Items:
    :ma_erz.L_KM_USERNAME
    My problem is, that I could not sort the records of a non-database-item.
    Does anybody know a workaround? I would like to sort the records to username.
    I am saving the username in :MA_ERZ.L_KM_USERNAME in Post-Query
    of datablock ma_erz:
    /* CGFK$QRY_LOOKUP_DATA */
    /* Query lookup data for the foreign key(s) */
    BEGIN
    IF (
            (name_in('MA_ERZ.MAE_SYSART') IS NOT NULL)
      THEN
        BEGIN
          CGFK$QRY_MA_ERZ_MA_ERZ_SYS_ERZ(
            :MA_ERZ.L_ERZSYS_ERZ_BEZEICHNUNG,    /* OUT: Value in item :MA_ERZ.L_ERZSYS_ERZ_BEZEICHNUNG */
            :MA_ERZ.MAE_SYSART);                 /* IN : Value in item :MA_ERZ.MAE_SYSART */
        EXCEPTION
          WHEN NO_DATA_FOUND THEN
            MESSAGE('Fehler : Sys Art does not exist');
          WHEN OTHERS THEN
            CGTE$OTHER_EXCEPTIONS;
        END;
        SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_RECORD, 'MA_ERZ', STATUS , QUERY_STATUS);
      END IF;
      IF (
            (name_in('MA_ERZ.MAE_ID') IS NOT NULL)
      THEN
        BEGIN
          CGFK$QRY_MA_ERZ_MA_ERZ_SYS_KM_(
            :MA_ERZ.L_KM_VORNAME,    /* OUT: Value in item :MA_ERZ.L_KM_VORNAME */
            :MA_ERZ.L_KM_NAME,       /* OUT: Value in item :MA_ERZ.L_KM_NAME */
            :MA_ERZ.L_KM_USERNAME,   /* OUT: Value in item :MA_ERZ.L_KM_USERNAME */
            :MA_ERZ.MAE_ID);         /* IN : Value in item :MA_ERZ.MAE_ID */
        EXCEPTION
          WHEN NO_DATA_FOUND THEN
            MESSAGE('Error :  does not exist');
          WHEN OTHERS THEN
            CGTE$OTHER_EXCEPTIONS;
        END;
        SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_RECORD, 'MA_ERZ', STATUS , QUERY_STATUS);
      END IF;
    END;
    /* CGFK$RESET_BLOCK_WHERE_CLAUSE */
    BEGIN
      IF (CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE <> 'first_time') OR
        CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE IS NULL THEN
        set_block_property('MA_ERZ', DEFAULT_WHERE, CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE);
        CG$PROTOTYP_MA_ERZ_V01_GLOBALS.MA_ERZ_WHERE := 'first_time';
      END IF;
    END;

    Or, even simpler, put the following in your order by:
    ORDER BY (SELECT THELOOKUPCOLUMN
                FROM THELOOKUPTABLE X
               WHERE X.MAE_ID=Y.MAE_ID)Additionally, set the ALIAS of the block to Y
    p.s. you could even skip the "ORDER BY" itself.

  • Sorting on non database fields

    Hi,
    I have a Master-Detail form ( query only form). The detail block has 10 DB fields and 2 NON DB fields (check boxes) . I have implemented Sorting functionality in such a way that, I have buttons on the top of each field and if the button is pressed on , let us say for Eg. Emp Name, sorting should be done on Emp Name and followed by other fields.
    Order by clause after pressing Emp Name looks as follows:
    Order by empname, empno, sal,......
    But can we implement the sorting functionality for check boxes also ? ( Check boxes are non DB Fields )
    These check boxes are populated with cursor in POST-QUERY trigger at block level ( check boxes are in Detail block.)
    how to implement soring on these two check boxes?
    Cheers
    Ram Kanala

    Thanks Every one,
    We can have 2 approaches:
    1. Since my block is based on the view, i have to change my view, to include
    the Non- DB check box values. I can get the check box values using a function.
    2. Another approach is , write a SELECT statement to select all the
    coumns from the view along with the two NON-DB fields, (using function )
    and use this SELECT clause in the QUERY SOURCE property of the block.
    Thanks a lot for your help.
    Cheers
    Ram Kanala

  • Non database block

    i have a non data base datablock to view the date and the use(i ssign them at the when new form instance trigger),but the problem that if i make clear all for the form the date and the user will be cleared,so i write the code at when new block instence trigger for the first navigetable data block it works but i think that it is no effient any suggestion???

    All our forms have both a control block with basic data (form-name, lookup keys), and a standard clear-all procedure, Whenever user presses the key-clrfrm key, or whenever we re-display all blocks on the form, we first call the U01_Clear_Screen procedure.
    U01_Clear_SCreen saves all values in the fields we don't want cleared on the control block into pl/sql variables, then does a:      CLEAR_FORM(NO_VALIDATE,FULL_ROLLBACK);It then replaces the saved values into the control-block items.
    The Clear_Screen procedure is common to every form, and includes more code if necessary if there are other things that need to be saved/replaced when the screen is cleared.

  • Shorting on non database table

    Hi experts,
    Currently my form contains a non database block. It is populated by a cursor loop. Now the requirement is there should be a button which should short a perticular column of the non data base table . The related information should be also changed.
    For example
    If there are three columns in the non database block table ( empno,ename,sal).
    Now user want to short the empno column . When the empno will be shorted the other two column data will be also rearranged accordingly.
    Could you please help me.
    Regards
    Rajat

    I agree with Christian, rather than manually populate your block if you convert your process to a From Clause query (see My Oracle Support document: How to use From Clause Query in Forms [ID: 69884.1]) or Forms: How to Base a block on a From Clause Query) you will be able to easily modify the ORDER_BY clause of the block to sort the data rather than have to programatically sort the data.
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • How to display records from a query into non-database field

    Hi
    I a have a problem:
    I have a query with many tables and 6 column(select a,b,c,d,e,f from x,y,z,t,s,g where conditions) and I use 3 parameters.
    I create 3 parameters :datai,:dataf and :partener and a button with a trigger when button is pressed.
    Then a create a manualy block with six field non-database a1,b1,c1,d1,e1,f1.
    Now I want to display all the records from my query into a1,b1,c1,d1,e1,f1 where a1=a,b1=b,etc. and all the records (if I have 20 record, it will display 20 records in non-database field) when I press the button.
    How I made:
    I create a cursor with query then
    begin open cursor
    loop
    fetch cursor into :a1,:b1,:c1,:d1,:e1,:f1;
    end loop;
    close cursor;
    end;
    It display one record in a1,b1,c1 only and it have to display 100 records and are date for all the fields.
    Can somebody help me in this problem?
    Thanks.
    Edited by: 928437 on Oct 1, 2012 2:55 AM

    Creating a view, and querying that into a database block is an excellent solution.
    To use the non-database block:
    You're missing the all-important Next_Record; command.
    <pre> Begin
    Go_block('X'); -- block X is the non-database block
    Clear_Block(No_Validate);
    open cursor X1;
    loop
    If :System.Record_status != 'NEW' then
    Next_Record;
    End if;
    fetch X1 into :a1,:b1,:c1,:d1,:e1,:f1;
    Exit when X1%NOTFOUND;
    end loop;
    close X1;
    end;</pre>

Maybe you are looking for

  • How do I configure my firewall to accept nmblookup data?

    I'd like to have my firewall allow nmblookup data so that I can view the systems in my domain located in the Shared section of Finder. Currently I'm forced to disable the Firewall which doesn't protect my machine by default when it leaves our corpora

  • Passing context parameter as Subject to GP Mail template

    Hi , I am using NW 7.0 SP14. I am using GP mail notifications to send out mails and I am successful sending context parameter values in the  body of mail template. Is there any way I can change the mail subject line dynamically by passing context par

  • Job Check database structure in a MaxDB

    Good night, I would ask if it is normal that the process of check data structure in a MaxDB database of 220 GB more than 12 hours later to finish? what function does this job? Thank you very much

  • Many Menu items on 4.1 is not working.

    Hi All, I have an application on 4.0.2 which has many menu items. (around 500 items with sub menus = which is a kind of conversion from other application) This application was running ok on ver 4.0.2 but when i installed ver 4.1 it and I run the appl

  • Mg6120 and photoshop elements work together? How?

    I am having many issues trying to get the printed photo have the same colors as the screen on my Dell Laptop. Anyone have solved this in the past?