The assignment of value to the block multi-record in Oracle's 10 g

Hi all

I'm new to form of Oracle 10 g.

I have a block of several recording that does not rely on the database. I need to assign the value to this block multi-record dynamically the ref cursor.

I'm trying to set the value as below, but its does not work. Please help me on this.

loop
     fetch cur Into screenval_rec ;
      exit when cur%notfound ;
      first_record;
   
  :BLOCK1.COL1:= screenval_rec.value1;
    :BLOCK1.COL2 := screenval_rec.value2;
    :BLOCK1.COL3:= screenval_rec.valu3;
  
     next_record;
End loop;

Kind regards

REDA

Hi Craig,.

Thank you for your information.

But I found the exact cause of this "Invalid cursor error' (ORA-01001) in Oracle forms. It is because of the unique enclosed in quotes the select statement of the REF cursor. I found in the paragraphs below Oracle.

Note 170881.1 - ORA-1001 calling a stored procedure that contains a REF Cursor Oracle Forms

Once I deleted the quotes, it's working properly now.

Thanks again for your help.

Kind regards

REDA

Tags: Oracle Development

Similar Questions

  • navigation block multi-record question

    Hello

    I have a block multi-record with 4 fields in each record. Each field has a LOV attached to it. When I select a value from the LOV to the 1st field, the 'control' should go to the next field (ie., the slider should move to the 2nd field).

    How can I do this?

    Thank you
    Chiru

    No need for any trigger, set the automatic 'Skip' property for the LoV to 'yes '.

  • 'Image' of block multi-record element type

    If I have a block of several record with a type of picture element, is it possible to load only / display an image for some of the records on a datablock? It seems that "READ_IMAGE_FILE" still applies to the whole element, which is responsible for the image for all records in the block... I can't find anything that will load only the image of a certain recording that I said... Something as sort of 'SET_ITEM_INSTANCE_PROPERTY' where I can put the record number I want the image to display on. Such a thing exists?

    Thank you!

    If the item of the Image is based on a BLOB column, you can escape to the population of the order of the day. I see no work around. It's like you ask a record, but do not want to display the content of the column.

    François

  • Block multi Record

    Hello

    I have a block of several record and under certain conditions, I would disable lines that statisfies the condition

    I will check that the trigger in a TIMES NEW BLOCK INSTANCE.

    The problem is SET_ITEM_INSTANCE_PROPERTY it is an attribute of current_record, but do not know how to assign the condition current_record as the condition returns some value can only turn off the lines.

    Could someone help?

    Concerning

    Transfer your logic of an once - instance trigger new - block to a trigger after query on your block "block":

    IF: block.item = "SAVE" THEN
    SET_ITEM_INSTANCE_PROPERTY ('block.deptno', CURRENT_RECORD, INSERT_ALLOWED, PROPERTY_FALSE);
    ON THE OTHER
    SET_ITEM_INSTANCE_PROPERTY ('block.deptno', CURRENT_RECORD, INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;

    But INSERT_ALLOWED no sense that the record exists, perhaps you mean UPDATE_ALLOWED?

  • Querying a multi-record in my form block

    I have a form where I perform validations of items entered on my main block. I compare the value of the item entered an expected value and if they are different then an exception record must be created in a separate block, several recording in my application. A record on my main block can end up with several different recordings of exception in the block of multi-record. As a result, my validation must include determining if the user has already created an exception record for the article I'm validating in the block of multi-record.

    Is it possible for me to query and uncomitted, block multi-record in my form? Help would be greatly appreciated!

    That's what I meant with "loop on the block."

    Write a function, lets call it FK_CHECK_FOR_EXCEPTION, give in the code and the name of the element as parameters and let it returns TRUE if the exception exists, false otherwise:

    FUNCTION FK_CHECK_FOR_EXCEPTION(i_vcItem IN VARCHAR2, i_vcCode IN VARCHAR2)
    RETURN BOOLEAN IS
      bFound BOOLEAN:=FALSE;
    BEGIN
      GO_BLOCK('BLOCK_B');
      FIRST_RECORD;
      LOOP
        EXIT WHEN :SYSTEM.RECORD_STATUS='TRUE';
        IF     :BLOCK_B.ITEM=i_vcItem
           AND :BLOCK_B.CODE=i_vcCode THEN
          bFound:=TRUE;
          EXIT;
        END IF;
        EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
        NEXT_RECORD;
      END LOOP;
      RETURN bFound;
    END;
    

    Then, in your VALIDATION KEY, you can something like:

    IF =FALSE THEN
      IF NOT FK_CHECK_FOR_EXCEPTION('ITEM1', 'THECODE') THEN
        RAISE FORM_TRIGGER_FAILURE;
      END IF;
    END IF;
    
  • How to check the values in multi-record block. ?

    Hello

    I'm new to forms. I have the field titled "Comments" in the block of multi-record. I have a button called "reject". Reject button is in the control block. If I press the button reject, field comments must be entered in one of the record. Otherwise, he should tell message. How to check the multi-record block. ?

    Pl.Help.

    Thanks in advance.
    Mano

    Mano,

    Add NEXT_RECORD just before the END of the LOOP.

         GO_BLOCK('');
         FIRST_RECORD;
         LOOP
              IF NVL(:., ' ' ) = ' ' THEN
                   MESSAGE('');
                   RAISE FORMS_TRIGGER_FAILURE;
              END IF;
              EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
              NEXT_RECORD;
         END LOOP;
    

    Kind regards

    Manu.

    If my response or response from another person was helpful, please mark accordingly

  • check the entry of duplicate data in the block record multi, which is a required field

    Hi all
    I have a situation where I have to check duplicate data entry (on a domain, which is a field, i.e. mandatory. it cannot be ignored by the user without entering a value) in key-in data in a Multi Record block.

    With regard to the reference I used logic, such as
    1 > trigger in a when-validate-Record of this block I assign the value of the current element in the variable of type array (collection type)
    as this trigger every time I leave this record, so its by assigning the value of the current time. And this process continues

    then
    2 > wrote in a when-validate-item trigger of the corresponding element (i.e., the relaxation is at the element level), where he compares the value of the current item and the value stored in the variable of type table trigger when-validate-Record (type of collection). If the value of the current element is mapped to a value stored in the variable of type table I shows following message ("Duplicate Record") raise_form_trigger default


    This code works very well for the double value of this record multi field check

    The problem is that if the user enters the value of this field and then go to the next field, enter the value in this field, and then press 'Enter Query' icon, Validate bolt trigger fires. As a result first when - validate record fires, that stores this value, and then when-validate-point fire, so it shows message duplicate record


    Please give me a code or a logical sense to solve this problem



    Any other logic to solve this problem is also welcome

    If you query the data and it shows two unique values in the block, then it should work as expected. But if you don't ask and just open form and try to insert the record and then for the first record it does not display this message of duplication. For this, you can write your own query to check the duplication of table.

    For the image of the form, you can use any image download site. A search on google.

    -Clément

  • How to do the validation to the record level in multi record block.

    Hello
    I use form 10g. I have a doubt in form 10g. Look, I got multi-record block (10 records).
    In this block, I have a few items of text
    (1) S_NO
    Account_number 2)
    withdraw_amt 3)
    Deposit_amt 4)
    (5) balance_amt.

    These are the fields and sample data that I posted in forms.
    S. n ACC_No - WITHDRAW_AMT - DEPOSIT_AMT - BALANCE_AMT
    1-250 - 1000.00 - 1000.00
    2.------250-----------500.00-------------------------------------------500.00
    3-250 - 2000.00 - 2500.00


    Now, I entered the data manually in all areas...
    But what I need is if I entered the field of deposit in the amount it will add to the old balance and if I add the amount to remove the field that he removed from the old balance automatically.
    Pls tell me what are the possible ways to implement this form...


    Eliane.

    For the calculation of the fields there are some properties, you can define and then let the calculation forms. The WHEN-VALIDATE-POINT-approach will not work, because it increases your balance_amount whenever you change the value.

    But what exactly is the logic for your calculation. It's just: BALANCE_AMT =: DEPOSIT_AMT-: WITHDRAW_AMT?

    If so, create a new database item not in the block, assign Calcaulation-mode of 'Formula', a formula to something like

    NVL(:BLOCK.DEPOSIT_AMT,0)-NVL(:BLOCK.WITHDRAW_AMT)
    

    Then whenever you change DEPOSIT_AMT or WITHDRAW_AMT, the BALANCE_AMT will be calculated again.

  • Assign a value of "dynamically created the sequence" to a variable

    in my procedure I am creating a sequence on the fly, I prepare the name with some parameters passes as below

    .
    .
    v_seq_name: = "seq_". loadid | v_table_name;
    run immediately 'CREATE SEQUENCE'. v_seq_name | "MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment of 1 hiding 20';
    .
    .

    and now after doing some operations I need to assign the current value of the sequence to a variable number, I tried but does not subsequently

    (1) v_curr_value: = v_seq_name.currval;
    (2) select v_seq_name |'. nextval' in double v_curr_value;

    can you please suggest me how can I get the value in plsql block.

    And what is - this?

    v_curr_value: = v_seq_name.currval;

    Of course, it will fail. If you want to get currval in a sequence whose name is stored in a variable, you must use dynamic SQL:

    SQL> declare
      2      v_seq_name varchar2(30);
      3      loadid number := 1;
      4      v_table_name varchar2(10) := 'tbl';
      5      v_curr_value number;
      6  begin
      7      v_seq_name := 'seq_' || loadid || v_table_name;
      8      execute immediate 'CREATE SEQUENCE ' || v_seq_name ||
      9                        ' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment
    by 1 cache 20';
     10      for i in 1..5 loop
     11        execute immediate 'select ' || v_seq_name || '.nextval from dual'into v_curr_value;
     12        dbms_output.put_line(v_curr_value);
     13      end loop;
     14  end;
     15  /
    1
    2
    3
    4
    5
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • The assignment of value to APEX PAGE ELEMENT

    Hi all

    In Javascript I have value assigned to an element on the page P2_NAMES
    $("#P2_NAMES").val(Names);               //(Names is a variable used int he script)                   
    console.log($("#P2_NAMES").val());      //(to print in console of firebug)
                        
    The problem is that the console shows correct but to my surprise, the page output has passed an empty value on the next page during validation.

    When I click on the button 'Session' (Apex bar at the bottom of the screen) after I run the page - I don't see the values reported in the table of elements of page apex. Which means that the assignment of the value was not held, but the console displays the output.

    I also made sure that the Source "used" to the page apex element "Always, replace the value that exists in the session state»

    Masters, Help!

    Hey Shiva,

    There is also a feature in the APEX_UTIL package that will help you to define the session state of
    an Element of Page or an element of the application :

    http://download.Oracle.com/docs/CD/E17556_01/doc/apirefs.40/e15519/apex_util.htm#CHDBGEEC

    But you must write a PL/SQL process to define the session state:

    BEGIN
        APEX_UTIL.SET_SESSION_STATE('my_item','myvalue');
    END;
    

    If through JavaScript, you can get through: AJAX.

    If default page layout then: dynamic Action advanced type run the PL/SQL Code runs above code block

    I hope that helps!
    Kind regards
    Kiran

  • How to fill out (display) values for several blocks in which there is no relationship between the blocks (tables).

    Hello.

    Is it possible to fill in the values (execute_query) several blocks where there is absolutely no relationship between the tables in the same form?

    There is no relationship between the tables. All are separate tables with different columns. None of the names of columns match

    & also the values of the columns do not match. I created blocks for all tables. When I click on run, only the first block of values (first picture) is filled.

    other values of block did not get filled. Is it possible to fill in the values for all of the blocks where there is not relationship, or when there is no master block?

    Is there something I can do for this? It is mandatory for me to put all the blocks in a single form.

    Help me, please. Please do not respond.

    Thank you.

    Create a key-EXEQRY-trigger on the block where 'throw you' the quers. In it, put something like

    GO_BLOCK ('BLOCK1');

    EXECUTE_QUERY;

    GO_BLOCK ('BLOCK2');

    EXECUTE_QUERY;

    ...

  • Assign dynamic statement declaring the block or block start

    Hi all

    For code below, if I attribute the select statement in the section declare for the corresponding variable, it will improve performance.

    For cust_veh_id we have another block cursor to declare, only partial code is provided.


    What I wanted to.
    declare
    v_addr_chg_stmt                 varchar2(2000) := 'select ''Y''
    FROM cust_addrs addrs
    WHERE customer_id = :v_customer_id
    AND updated_date >:p_end_date
    and rownum = 1';
    Actaul
    ---------
    declare
    p_end_date                      date;
    v_addr_chg_stmt                 varchar2(2000);
    v_mileage_stmt                 varchar2(2000);
    begin
    
    select updated_date into p_end_date
    from process_log_rfsh
    where tran_code ='CAP';
    
    v_addr_chg_stmt :=
    'select ''Y''
    FROM cust_addrs addrs
    WHERE customer_id = :v_customer_id
    AND updated_date >:p_end_date
    and rownum = 1'
    ;
    
    v_mileage_stmt :=
    'SELECT ''Y'' FROM cust_vehicles_audit
    WHERE cust_veh_id=:v_cust_veh_id
    AND field_name =''LAST_MILEAGE''
    AND added_date > :p_end_date
    and audit_date >= trunc(:p_end_date)
    and rownum=1'
    ;
           begin
                     execute immediate v_addr_chg_stmt
                        into v_addr_change_flag
                        using v_customer_id,  p_end_date;
                 exception
              when no_data_found then
                     v_addr_change_flag:='N';
                 end;
            begin
                   execute immediate v_mileage_stmt
                     into v_mileage_change_flag
                    using v_cust_veh_id,  p_end_date, p_end_date;
               exception
             when no_data_found then
                   v_mileage_change_flag:='N';
               end;
    end;
    Thank you
    Rambeau

    Published by: Raghu on January 18, 2013 13:13

    Rambeau wrote:
    This code is already running in production for a few years.

    Not a reason to justify using dynamic SQL.

    YOU NEED a JUSTIFICATION FOR the USE of DYNAMIC CODE. In any language.

    Once again: WHAT is your justification? If you can't provide that, so why you use code Dynamics?

    If you must use dynamic sql statements, performance definition wise to declare the block or start will be better.

    No difference - as no method doesn't change the actual SQL cursor run. Nor did the resulting cursor read faster data blocks.

    PL/SQL also does not care where the variable assignment happens. The difference is so small and so small, it is not relevant to the performance:

    SQL> declare
      2          t1      timestamp;
      3  begin
      4          --// test 1
      5          t1 := systimestamp;
      6          for i in 1..10000 loop
      7                  declare
      8                          num     number;
      9                  begin
     10                          num := 1;
     11                  end;
     12          end loop;
     13          dbms_output.put_line( 'Test 1. '||to_char(systimestamp-t1) );
     14
     15          --// test 2
     16          t1 := systimestamp;
     17          for i in 1..10000 loop
     18                  declare
     19                          num     number := 1;
     20                  begin
     21                          null;
     22                  end;
     23          end loop;
     24          dbms_output.put_line( 'Test 2. '||to_char(systimestamp-t1) );
     25
     26  end;
     27  /
    Test 1. +000000000 00:00:00.000040000
    Test 2. +000000000 00:00:00.000024000
    
    PL/SQL procedure successfully completed.
    
    SQL>
    
  • The assignment of value to an element of Application via JS

    Hi guys,.

    I am trying to assign a value to an element of application using javascript. But I can't do that when I try to view with alarm the result is empty. You have an idea how can I assign a value to an element of the application using javascript?

    Another yew (action is "ASSIGN")
    {
    var moname = $(el).children("td[headers='SOURCE']").text ();
    $s ('F10_SELECTED_OBJ', moname);
    Alert ($v ('F10_SELECTED_OBJ'));
    }

    Thank you

    You cannot reference elements of apex in javascript application because they are not rendered in the HTML DOM.

    See what {message identifier: = 10343221}

  • activation and deactivation of the button in the block record multi

    Hi all
    I use
    Forms [32 bit] Version 6.0.8.24.1 (Production)
    Oracle Database 10g Release 10.2.0.1.0 - Production
    I have a multi record block each block contains a button (the button is to approve the record in terms of change of status)
    I have elements such as the date, remarks and button
    the button should be enabled if the remarks is not null in the case otherwise it should be disabled.
    I wrote to this effect in the pre-record trigger
    if :record is null then
       set_item_property('button',enabled,property_false);
    else
          set_item_property('button',enabled,property_false);
    end if;
    What problem is enable and disable has repercussions on all the buttons in the block. in other words, if the remarks of the first record is null then all records button is disabled. If the observations of the first record column is not null, then all the records in the column of buttons is enabled.
    I have to enable and disable the button for the corresponding record.that ways if the remarks of the first record column is not null not so only records first button should be activated and others should be disabled.

    Thank you...

    Hello

    but I'm not able to do.

    You can find the current record Y_POS 
    

    This means that whatever the user record navigates according to whether the button position gets her past set.but not.
    for example the user navigates up to the fourth record that will settle the position of the button but if user navigates back to the first record. the position of the button is going to the fifth record?

    V_ITEM_Y_POS: = GET_ITEM_PROPERTY ("NOM_ELEMENT", Y_POS);

    Please note that do not use the button element to get the Y_POS.
    This should be another element in the block, then button as a buttons position will continue to change on
    What you are to get the Y_POS of button which is the fourth position of the record for the first time so, it is fair,
    second time you set Y_POS button which is 4th record + first recording which is the fifth album,.
    you need to find is the Y_POS from a fixed point in the block.

    in your description what do you mean by top_record. Why I ask, is because it is multi record block(showing_10_records).so will appear every 10. no record may be hiding.

    Top of page record is the first record in the block.
    For example, in a record 10 block, if there are 20 records then if you navigate the records, if you go to the 11th, 12th, 13th, 14th... the other then your TOP_RECORD be record No 2, 3, 4,... is the first record that is displayed in the block that is not always 1, and will be 1 only for the first 10 rcords.
    If we use: system.cursor_record we will not be able to get the Y_POS exact numbers of superior record then 10 which will put the button located under the last (10th) record, which is not what we want, so need to find the TOP_RECORD.

    Best regards

    Arif Khadas

  • assign a value to a text element using the PL/SQL function body

    Hello

    I want to assign a value to a text element using PL/SQL function body option in the Source elements. But the below error when I try to apply it.

    Source code:

    declare
    name varchar2 (100);
    Start
    If v ("P3_CREHIDD") = 'Edit' then
    Select ename in the name of cpy_emp where empno = v('P3_EMPNO2');

    end if;
    end;


    ERR-1904 unable to calculate the default item: type = computation_type = function body declare name varchar2 (100); so start v ('P3_CREHIDD') = 'Edit' and then select ename in the name of cpy_emp where empno = v('P3_EMPNO2'); end if; end;.

    Thank you
    David.

    Hello

    Your body of the function doesn't return anything.
    Maybe it works

    declare
      l_name varchar2(100);
    begin
      if v('P3_CREHIDD') = 'Edit' then
        select ename
        into l_name
        from cpy_emp
        where empno = v('P3_EMPNO2');
      end if;
      RETURN l_name;
    end;
    

    BR, Jari

Maybe you are looking for