Set_block_property('IM_NEW_ITEMS',default_where,where_string) ;

declare
     where_string varchar2(200):= 'COP_CODE = :GLOBAL.COP_ORDER_CODE' ;
     REC_PRE NUMBER;
BEGIN
     SELECT COUNT(*) INTO REC_PRE FROM IM_NEW_ITEMS
WHERE COP_CODE = :GLOBAL.COP_ORDER_CODE ;
if NVL(REC_PRE,0) != 0 then
     set_block_property('IM_NEW_ITEMS',default_where,where_string) ;
     go_block('IM_NEW_ITEMS');
     execute_query;
     LAST_RECORD;
     set_block_property('IM_NEW_ITEMS',default_where,'') ;
     NEXT_RECORD;
SHOW_MESSAGE(':SYSTEM.RECORD_STATUS'||' '||:SYSTEM.RECORD_STATUS);
:IM_NEW_ITEMS.ITEM_CLASS := :GLOBAL.CLASS_CODE;
REC_PRE := 0;
end if;
end ;
my problem is appear when I want to insert a new record it does not insert
the new record in the current form.
So how to change the set_block_property to the insert mode , so that the records
will be inserted in the in the current form.
Best regards
Jamil Alshaibani

Hi
No I do not want to insert the same set of record after populating data from the same table,
I am using the following script
LAST_RECORD;
set_block_property('IM_NEW_ITEMS',default_where,'') ;
NEXT_RECORD;
To create a new record, so what I want to insert is the new created record only,not the retrieved records.
Thank a lot for your cooperation .
Best regards
Jamil

Similar Messages

  • Set_block_property and Default_where

    Hi All,
    I'm trying to set the default clause at runtime,for that i'm using set_block_properties.
    Here is my cde:
    Set_block_property('RECIPIENT_VIEW',DEFAULT_WHERE,'RECIPIENT_NAME LIKE '||''''||:RECIPIENT_NAME ||'%'||'''');
    I'm NOT getting if i use this in KEY-EXEQRY or PRE-QUERY triggers(I'm getting it, when i use this in button).
    How can solve this problem in KEY-EXEQRY or PRE-QUERY triggers ?
    Please help me.
    Thanks
    P

    Because form default enter-query, execute-query buttons look your input format:
    1) if you type in A in the field, then form constructs the default where by appending additional RECIPIENT_NAME ='A';
    2) If you type in A% in the field, then form constructs it by appending the additional RECIPIENT_NAME LIKE 'A%';
    That's to say, if you SET_BLOCK_PROPERTY('blockname',
    DEFAULT_WHERE,
    'RECIPIENT_NAME LIKE '''||:RECIPIENT_NAME ||'%'||''') in the PRE-QUERY trigger of forms6i, then the block where condition becomes the below format,
    for 1) input:
    RECIPIENT_NAME LIKE 'A%' AND RECIPIENT_NAME ='A'
    for 2) input:
    RECIPIENT_NAME LIKE 'A%' AND RECIPIENT_NAME ='A%'
    Therefore, for input 'A%' it will work for you, for input 'A', it will have no much chance to get the record unless you make record 'A', then it will get you the data.
    Remember, after you type in something, the block where clause changed if you use the default menu enter/execute-query buttons.
    you will see it if you check the :system.last_query.

  • Set_block_property('emp',default_where,...) with variables

    db and dev 10g rel2 ,
    i am trying to learn about this built-in with variables and the equal(=) operator , i can not use it with variables , so show me please how to use it with number , charachter and date variables .
    1- working with number variables .
    - i have the block 'scott.emp' , and a button 'search' .
    - my variable 'v' holds the value 7788 , and i want to display the data based on this number of the 'empno' column .
    how to do it with set_block_property ?
    thanks in advance
    Edited by: newbi_egy on Apr 5, 2013 3:11 PM
    Edited by: newbi_egy on Apr 6, 2013 2:55 PM

    newbi_egy wrote:
    this is so correct HamidHelal , but what i want to ask about is ,
    i know that the part after "default_where" of the set_block_property built-in should reside between two single quotes like so
    set_block_property('emp',default_where,' ') ;
    but your letters does not reside between these single quotes ' ' , what resides is just this ('empno=') , and if the whole sentence should reside between single quotes , it should be like so
    ('''empno='||v'') as the two quotes at the beginning of the sentence and at the end are in fact one quote (one at the beginning and one at the end . -- these are which enclude the whole sentence which is ('empno=') .should not it work like so ? -- sure it is not working , but i want to understand why is not it working ? Ok. working statement is
    SET_BLOCK_PROPERTY('emp', DEFAULT_WHERE, 'empno = '|| V);where 'empno = ' is fixed string. variable value of V is concatenate.
    Following statement also work. and meets set_block_property('emp',default_where,' ') ;
    SET_BLOCK_PROPERTY('emp', DEFAULT_WHERE, 'empno =7788 ');What is the difference ?
    Difference is, in the first statement we set the empno value dynamically where second one is fixed.
    Hope it's clear..
    Hamid

  • Set_block_property(' ',default_where,' ') built-in

    db and dev 10g rel2 , xp
    hi all,
    if anyone could demonstrate this built-in to me , when using it with number and charachter or date text_fields ,
    specially with (= and like) operators .
    because i have a problem with using quotes with it . i do not know the roles for using quotes with it .
    for in stance , i have the table emp , and two text items , one to execute the query on the block by the deptno column , and the other with date or charachter column like hiredate or ename , i think the two are the same .
    if you could give me an example and demonstrate it please .
    thanks in advance

    If you are using forms items/parameters you can actually use them in the default where like bind variables and not care about quotes at all. Let's say you have a block with one number, one date and one char item (all non-basetable). You'd simply could
    set_block_property('basetable_block', default_where, 'where num_col = :blk.num_item or char_col = :blk.char_item or date_col = :blk.date_item');as you can see no quote escaping no matter of the data type.
    It get's a little bit harder when you are using PL/SQL variables as you cannot bind them like you can with items or parameters
    set_block_property('basetable_block', default_where, 'where num_col = '||num_val||' or char_col = '''||char_val||'''');it get's worse with dates:
    set_block_property('basetable_block', default_where, 'where date_col = to_date('''||to_char(date_val,'dd.mm.yyyy')||''',''dd.mm.yyyy'')');To demonstrate how escaping actually works we'll translate the where clauses the way they get sent to the database; assuming num_val has a value of 3, char_val has a value 'ABCD' and date_val has a value of 01.01.2013.
    where num_col = '||num_val|| or char_col = '''||char_val||'''would be
    where num_col = 3 or char_col = 'ABCD'
    where date_col = to_date('''||to_char(date_val,'dd.mm.yyyy')||''',''dd.mm.yyyy'')would be
    where date_col = to_date('01.01.2013','dd.mm.yyyy')If in doubt with escaping simply output the string to e.g. a file, and when it contains valid SQL you did everything right with the escaping.
    cheers
    EDIT: this is actually pen-and-paper writing of code; I didn't compile anything of the above so it might be that some of the ' are missing, but I guess you should get the point.
    Edited by: christian erlinger on 27.02.2013 05:25

  • Set_block_property default_where problem

    Dear proffessionals,
    during setting the set_block_property value for database block i'm facing next problem:
    1. Query select cr_pjid from acc_users where username='ACCBTPS121' give result
    CR_PJID 
    '26','63'2. Query select * from acc_accbtp_nova_view where ed_id=2 and to_char(pj_id) in ('26','63'); return 186 rows.
    3. Query: select * from acc_accbtp_nova_view where ed_id=2 and
                  to_char(pj_id) in (select cr_pjid
                  from acc_users
                  where username='ACCBTPS121'); doesn't return any row... :(
    So, set_block_property('acc_accbtp_nova_view',default_where,'ed_id = '||':global.org_dio_id and to_char(pj_id) in (select to_char(cr_pjid) from acc_users where username=user)'); doesn't work...
    Could anyone help me ?
    Thx in advance,
    Adnan
    Edited by: adnanBIH on Nov 20, 2010 10:25 AM

    and like this?
    DECLARE
      vStr acc_users.cr_pjid%TYPE;
    BEGIN
      SELECT cr_pjid
      INTO vStr
      FROM acc_users
      WHERE username=user;
      SET_BLOCK_PROPERTY('acc_accbtp_nova_view',DEFAULT_WHERE,'ed_id = :global.org_dio_id and to_char(pj_id) in ('||vStr||')');
    END;-Ammad

  • Re Set Set_Block_Property DEFAULT_WHERE value

    I have a Tabular form which have the invoice details with below two Buttons
    BTN_QUERY (WHEN-BUTTON_PRESSED) TRIGGER
    go_block('BLFRT');
    execute_query;BTN_UNRECEIPT (WHEN-BUTTON_PRESSED) TRIGGER
    if :system.mode like 'NORMAL' then
    go_block('BLFRT');
    Set_Block_Property('BLFRT',DEFAULT_WHERE,' BL_REC_FLAG IS NULL');
    execute_query;
    end if;As soon i click BTN_QUERY i get the data in the grid and also when i click BTN_UNRECEIPT also works fine.
    the problem is after clicking BTN_UNRECEIPT if i click BTN_QUERY it shows the filtered records and not all the records. i can understand it's because the value is set with BL_REC_FLAG IS NULL. how to clear this and show all records IN BLFRT when i click BTN_QUERY

    Hi,
    Try to use PRE-QUERY trigger and use
    Set_Block_Property('BLFRT',DEFAULT_WHERE,' BL_REC_FLAG IS NULL');
    on conditional bases
    Regards,
    Uzair Hasan Nizami

  • How can I display records quickly in order, using set_block_property

    Hi all,
    I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
    I have written the following code in when-button-pressed trigger:
    begin
    if get_block_property('block_name',default_where) = 'column_name ASC' then
    set_block_property('block_name', default_where,'column_name DESC');
    else
    set_block_property('block_name',default_where, 'column_name ASC');
    end if;
    end;
    How can I get the result quickly can anyone please give me an idea to solve this.
    Thanks in advance.

    Hi user;
    I want to display records in order when I click on button corresponding to that filed.I'm getting result by using set_block_property..but it is displaying records slowly,if number of records are more then it's taking more time to sort the records.
    I have written the following code in when-button-pressed trigger:
    begin
    if get_block_property('block_name',default_where) = 'column_name ASC' then
    set_block_property('block_name', default_where,'column_name DESC');
    else
    set_block_property('block_name',default_where, 'column_name ASC');
    end if;
    end;
    How can I get the result quickly can anyone please give me an idea to solve this.Did you try to use index for related column? Also did you try to use order_by instead of default_where
    If its not help, I also suggest post your issue on :Forum Home » Developer Tools » Forms
    Hope it helps
    Regard
    Helios

  • Set_block_property with Like and Between and function

    Hellow All
    I need to find out record where Column Name between
    :Text_item1 and :Text_item2 with Default_where
    For example Manu guide me to find out record with
    SET_BLOCK_PROPERTY('Block53', DEFAULT_WHERE, 'name like ''' || :block70.text || '%''');
    go_block('block53');
    EXECUTE_QUERY;
    Now i need
    To find our Record where name between :block70.Text1 and :Block70.text2 with Like Function
    For example
    I have one Column :NAME
    I want to find out record in name Column with Default Where option where name between Text1 and Text2
    I Hope you guys understand my requirement
    Regards
    Shahzaib ismail

    Hai,
    Try
    SET_BLOCK_PROPERTY('BLOCK53', DEFAULT_WHERE, 'NAME BETWEEN ''' || :BLOCK70.TEXT1 || ''' AND ''' || :BLOCK70.TEXT2 || '''');
    GO_BLOCK('BLOCK53');
    EXECUTE_QUERY;and when you are using BETWEEN for character fields, then LIKE will be there.
    Example, your NAME field have,
    1) Abcde
    2) Asdf
    3) Awer
    And if your condition is NAME BETWEEN 'A' AND 'Z' then you will get all daya.
    And if your condition is NAME BETWEEN 'Ad' AND 'Z' then you will get 2 and 3. like that.
    Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

  • In clause with default_where

    hi all,
    i am using forms6i.
    i have to query a data block with in clause query
    Go_Block('EMPLOYEE_MASTER');
    Set_Block_Property('EMPLOYEE_MASTER',Default_Where,'emp_dept IN ('''||:dept||''''||')');
    Execute_Query;in my code 'dept ' is the field where i input the value. the problem is if pass multiple department then i have to passit like
    it','accounts. that means quotes are required before and after comma.
    is this is the way to input multiple valule sepeated by comma, or do we have any alternative way to input a multiple string.
    Please advice.
    Thanks..

    Hi GD,
    Set_Block_Property('EMPLOYEE_MASTER',Default_Where,'emp_dept IN ('''||:dept||''''||')');If :dept has numeric values like 1,2,3,4 then the above line will work.
    If so, this means there is a reference to a single value, not a list of values. Can the user enter a list in the :DEPT field (eg: A,B,C,etc...)?yes, right now i am giving input to :DEPT like a,b,c. But the way i am input the data is wrong?If :DEPT field (eg: A,B,C,etc...)? has such non-numeric values then it will not work because the IN clause in such a scenario will be looking for something like:
    emp_dept in ('A', 'B', 'C')Hope this helps
    Best Regards
    Arif Khadas

  • Change the Default_Where in 9iDS

    I want to execute this code in the trigger "WHEN-BUTTON-PRESSED":
    DECLARE
         item_value varchar2(30);
         where_clause varchar2(30);
    BEGIN
         item_value:='12';
         where_clause := 'where type='''||item_value||'''';
              set_block_property('bookinformation',default_where,where_clause);
              go_block('bookinformation');
              execute_query;
    END;
    ...but when I press the button I obtain the error message "FRM-40505".-
    What is wrong?

    Call DISPLAY_ERROR and see the query string that has been generated - usually there is simply a problem with the number of quotes

  • Set_block_property does not called the query from the where clause

    Hi all,
    I have two blocks in the Oracle form 6i. Master link with the detail. Because of the data is quite huge if I have the auto query when the form is loaded hence I have two enter parameter created of From_date and To_date together with button to execute the query when that two parameter is being filled.
    I have the following quotes in the button of when-button-pressed :-
    BEGIN
    set_block_property('act_vw_sale_comm', default_where, 'invh_dt >='''|| to_date(:act_vw_sale_comm.fdate,'dd/mm/yyyy') ||''' and invh_dt <= ''' || to_date(:act_vw_sale_comm.tdate,'dd/mm/yyyy')||'');
    go_block('act_vw_sale_comm');
    execute_query;
    set_block_property('act_vw_sale_comm', default_where, '');
    END;
    However, nothing being displayed when I click on the button. Anything wrong on the above statement ? Please help me. thanks.
    Rgds
    Lim

    BEGIN
    go_block('act_vw_sale_comm');
    set_block_property('act_vw_sale_comm', default_where, 'invh_dt >= '''|| :FDATE ||''''' AND invh_dt <= '''|| :TDATE ||'''');
    execute_query;
    --set_block_property('act_vw_sale_comm', default_where, '');
    END;
    Now, I have the above statement, but still the same when try to execute the query, this time, the screen execute but does not show anything and close my form straight away. Why!
    Anyone can help me?
    Thanks
    Lim

  • Order_by in set_block_property returns ORA-01785

    Hello.
    We have a problem with using function in set_block_property with order by when using union sentence.
    Our code looks like:
    set_block_property('block', default_where, 'id = '||:item||'
    UNION ALL
    SELECT ROWID,column1,column2,column3,... FROM table WHERE
    id = '||:item);
    set_block_property('block', order_by, 'function(column1), column2');
    Form returns error: ORA -01785 : ORDER BY item must be the number of a SELECT-list expression
    We know, that with union we should use numbers in order by instead of column names. But it doesn't work.
    If we do not use UNION, then order_by with function works.
    How can we solve this problem?
    Thanks.
    Edited by: DejanH on Sep 10, 2008 8:03 AM

    Not sure you can ever get Forms to handle that complicated a query using default block processing.
    Since it looks like your block is display-only, I would create a record group with the query and order by, populate it, and then step through the record group row-by-row moving the values to the block (which would then be a control-block rather than a base-table block). Of course, if your query selects more than a few hundred rows, this is not a good solution.

  • Conflict between DEFAULT_WHERE and ONETIME_WHERE block properties

    Hi all,
    I have a master detail form.
    I noticed a very strange behaviour :
    the following syntax freezes the form :
    Set_Block_Property('JOURHEAD',DEFAULT_WHERE,' IDENT= '||FV.V_IDENT);
    Set_Block_Property('JOURHEAD',ONETIME_WHERE,'VOCH_NO='||''''||V_PREV_record||'''');
    Execute_query;
    However the following syntax doesn't freeze the form :
    Set_Block_Property('JOURHEAD',ONETIME_WHERE,'VOCH_NO'||'='||''''||V_PREV_record||''''||' AND IDENT='||FV.V_IDENT);
    Execute_query;
    Aren't the two syntax the same ??
    Please help

    Hi Gerd;
    Thank you for your response
    Gerd, We shouldn't put the 'AND' in the onetime_where, It will be generated automatically.
    This is from the online help :
    For an Emp/Dept form with a default-where clause for the Emp block set to 'empno > 7800' and a push button, do the following: When-Button-Pressed:Set_Block_Property('emp', ONETIME_WHERE, 'deptno <= :dept.deptno'); If a query is performed after pushing the button, the generated query would like the following using the :SYSTEM.LAST_QUERY: Select empno, ename, ... From Emp Where empno> 7800 And depnto <= 10 (in this case the deptno of the DEPT block is 10).
    Regards
    Mostafa

  • Pre-query set_block_property Default Where

    I need some information regarding
    SET_BLOCK_PROPERTY , DEFAULT_WHERE
    How it works
    I am using this code
    SET_BLOCK_PROPERTY('bank_recon',
         DEFAULT_WHERE, 'v_bankcode= ''' || :button.bankcode     || ''' and ' || 'v_chq= ''' || :button.chq_no ||
           '''');   but when I add one another condition not work
    SET_BLOCK_PROPERTY('bank_recon',
         DEFAULT_WHERE, 'v_bankcode= ''' || :button.bankcode     || ''' and ' || 'v_chq= ''' || :button.chq_no ||
                                                                                                                                                 ''' and ' || 'recon is null'||
           '''');   Please guide me and inform me how it is work... how to use its *' '*

    try
    DECLARE
        v_sql VARCHAR2(300);
    BEGIN
        v_sql := 'v_bankcode= ' || '''' || :button.bankcode || '''' || ' and v_chq= '  || :button.chq_no || ' and recon is null';
        SET_BLOCK_PROPERTY('bank_recon', DEFAULT_WHERE, v_sql);
    END;if you have doubt about the syntax, you can check it by showing a message like
    message('sql=' ||  v_sql);PAUSE;

  • SET_BLOCK_PROPERTY

    Hi,
    I'm trying to set where caluse dynamically, but it is giving me error.
    SET_BLOCK_PROPERTY ('emp', DEFAULT_WHERE, 'where deptno in ||'''('''select deptno from dept''')'');
    How to set the "(" in the where caluse ?
    Thanks in advance.

    It is like this
    l_where := 'where deptno in (select deptno from dept)';
    set_block_property('emp',default_where,l_where);
    Thanks

Maybe you are looking for

  • FDM- Loading Multiple Amount Column

    Hi All, Can anyone help me in building the logic of an import format script to get the below output file from the input file shown below. Thank you so much in advance. Input file Production Rate Quantity Jan CC Region Prj1 FY12 44880.00 68.00 660.00

  • Cubes or DSO related to FI AP and FI GL datasources

    Hi Experts , I need to Install Standard reports related FI Module and that too related to Financial Accounting: Vendors ( FI AP ) and         Financial Accounting: General Ledger (  FI GL ). For FI AP - I have replicated the following datasources . 0

  • Photoshop Elements 11 Autoanalyzer

    I have installed Elements 11 on 3 machines: One machine is a Windows Vista 64-bit machine, One machine is a Windows 7 32-bit machine and one machine is a Windows 8 machine. The Windows 8 machine will successfully run autoanalyzer on all of my photos

  • Audigy 4 - low DVD playback vol

    Hi guys, I need help in a simple matter. During DVD Movie playback with PowerDVD 6, I get very low volume when using the built-in Dolby Digital decoder the soundcard has. Voices have particularly very low volume levels. Maxing out the speaker volume

  • Joining Existing Wireless Network

    I have a Verizon Router. I want to connect my itunes to a stereo in the other room. I cant get the network to recognize the airport express unless it is plugged into the ethernet. Can anyone help me figure this out?