How to modify a statement "select into" how to use a cursor

The following code fails with an exception too many lines. How can I modify statement Select Into the procedure to use a cursor?
CREATE OR REPLACE PROCEDURE Track_Asset(
   business_date IN NUMBER DEFAULT NULL,
   missing_table_name  OUT VARCHAR2) 
IS
   ln_business_date NUMBER;
    incorrectdateformat EXCEPTION;
BEGIN
   IF business_date < 0 
   THEN
      RAISE incorrectdateformat;
   ELSE
      DECLARE
        ln_business_date NUMBER;
      BEGIN
         SELECT MAX(business_date) 
         INTO ln_business_date
         FROM sproof ;
      EXCEPTION
        WHEN NO_DATA_FOUND THEN
         dbms_output.put_line('NO MATCH FOUND'); 
        WHEN OTHERS THEN
        dbms_output.put_line('ORACLE ERROR :' || SQLERRM);        
      END;
      
      DECLARE
        missedfeedfnd EXCEPTION;
      BEGIN
         SELECT 'Missing Value : ' || table_name 
         INTO missing_table_name 
         FROM ( 
            SELECT UPPER(table_name) table_name 
            FROM filespec
            WHERE data_table_name IN ('TABLE1','TABLE2','TABLE3') 
            MINUS ( 
            SELECT DISTINCT UPPER(first_table_name) 
            FROM dpca
            WHERE business_date = ln_business_date 
            AND first_table_name IN ('TABLE1','TABLE2','TABLE3') 
            GROUP BY UPPER(first_table_name) UNION 
            SELECT UPPER(first_table_name) 
            FROM dpca
            WHERE business_dt_num = TO_NUMBER( SUBSTR('201111', 1, 6) || '01' )
            AND first_table_name = 'TABLE4' 
            GROUP BY UPPER(first_table_name) ));
            
            IF missing_table_name  IS NOT NULL THEN
               dbms_output.put_line('Missing Value : '|| missing_table_name);
               RAISE missedfeedfnd;
            ELSE
              NULL;
            END IF;
      EXCEPTION
         WHEN TOO_MANY_ROWS THEN
   DBMS_OUTPUT.PUT_LINE (' SELECT INTO statement retrieved multiple rows');
          WHEN missedfeedfnd THEN 
          raise_application_error ( - 20003, 'Missed Feed');
      END;
    END IF;
      EXCEPTION
   WHEN incorrectdatevalue 
   THEN
      raise_application_error ( - 20001, 'Incorrect/Bad Date Entered');
END;

OK, try this - OUT param will be filled with the table names comma-separated list:

PROCEDURE Track_Asset(
   business_date IN NUMBER DEFAULT NULL,
   missing_table_name  OUT VARCHAR2)
...
...

cursor c_table_names is
select datatablename
from   ( select upper(datatablename) datatablename
         from   filespec
         where  data_table_name in ('TABLE1','TABLE2','TABLE3'                                 )
        MINUS
        ( select upper(first_table_name)
          from   dpca
          where  business_dt_num = [-- this date is retrieved by getting the MAX(business_date) from sproof table]
                 and fus_data_table_name in ('TABLE1','TABLE2','TABLE3'
                                            )
          group  by
                 upper(first_table_name)
         UNION
          select upper(first_table_name)
          from   dpca
          where  business_dt_num = to_number( substr('201111',1,6) || '01' )
                 and first_table_name = 'TABLE4'
          group  by
                 upper(first_table_name)
        ));

...
...
begin
   ...
   for rec in c_table_names
   loop
       missing_table_name  := missing_table_name  || rec.datatablename ||',';
   end loop;
   missing_table_name  := rtim(missing_table_name , ',');
...
...
end ;

HTH

Published by: user130038 on December 28, 2011 08:46

Tags: Database

Similar Questions

  • How to use a cursor to turn on or turn off the lights

    Hi guys. I'm quite familiar with Labview now, but can't seen to get my head around this problem. I have a slider that is numbered from 1 to 10. under the cursor, I inserted 10 LED lights. My sister in order to use the slider to turn off the lights and. for an example, when I set the cursor to one, at the far left light should go. When I put the cursor at 2, the first witness should go second light next to him, and the model continues. I thought to use the number of table boolean, but it doesn't seem to do the trick. could you please help me. I join the basic layout how I wanted things to be arranged

    Kind regards

    Joe

    Maybe something like that?

  • How to store select statements in a procedure and use it as a parameter

    I need to enter below the select statements in a stored procedure with an input parameter, business_dt_num. This parameter must be the result under the statement select and placed inside the procedure...
    select max(business_dt_num)
    from invent.dp_ca 
    If a select statement fails he must get out of the execution of the procedure and is not engaged in the next select statement. How can I cancel the execution of the procedure, if a select statement fails?
    select max(business_dt_num)
    from invent.dp_ca 
    /
    Select count (1)
    of invent.dp_ca
    where BUSINESS_DT_NUM = YYYYMMDD
    and product_id! = 0 ;
    -above and below sql account must match
    Select count (1)
    invent.dp_ca d, e invent.dp_ca_proof
    where d.BUSINESS_DT_NUM = YYYYMMDD
    and d.KEY_ID = e.KEY_ID;
    /
    exec pk_proof.pr_PopulateTaggingWorkTable_CA (yyyymmdd);
    /
    SELECT count (distinct univ_key_id) of invent.dp_ca_proof
    where business_dt_num = YYYYMMDD and proof_status! = « A » ;
    -above and below sql account must match
    Select count (0) in the invent.dp_ca_work where business_dt_num = YYYYMMDD.
    Thanks,
    Steve
    
    Edited by: steve2312 on Dec 22, 2011 12:32 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    declare
       dp_ca_count1 number;
       dp_ca_count2 number;
    begin
       select count(1) into dp_ca_count1
       from invent.dp_ca
       where BUSINESS_DT_NUM = trunc(sysdate)
       and product_id != 0;
    
       select count(1) into dp_ca_count2
       from invent.dp_ca d, invent.dp_ca_proof e
       where d.BUSINESS_DT_NUM = trunc(sysdate)
       and d.KEY_ID = e.KEY_ID;
    
       if dp_ca_count1 != dp_ca_count2 then
               raise_application_error (-20001, 'Counts do not match.');
       end if;
    end;
    /
    
  • How to use the Type of Oracle Table values in the Select statement.

    Hello

    I get the initial set of values in the Table of Type Records of the Oracle and want to use the list of values in the Select statement.

    For example, try something like the following:

    TYPE t_record () IS RENDERING
    ID TABLEA.ID%type,
    NO TABLEA.NO%type

    );
    v_record t_record;
    T_table TYPE IS the v_record TABLE % TYPE;
    v_table t_table;

    -Code to fill the values of v_table here.

    SELECT ID, NO, COLLECT in BULK IN < some other table variabes here > FROM TABLEA
    WHERE ID IN (i) v_table USER.USER;

    I want to know how to use the Type of Oracle Table values in the Select statement.

    Something like this:

    create or replace type t_record as  object (
    id number,
    no number
    )
    /
    
    CREATE or replace type t_table AS TABLE OF t_record;
    /
    
    set serveroutput on
    declare
    
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    
    begin
    
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
    
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
    
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
    
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /
    

    No test!

    P;

    Published by: bluefrog on March 5, 2010 17:08

  • How to store the output of a statement select * statement in a file?

    How to store the output of a statement select * / statement of dsc in a file?

    As user sys:

    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    /
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /
    

    As myuser:

    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      --
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    

    This allows the header line and the data to write into files separate if necessary.

    for example

    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    
    PL/SQL procedure successfully completed.
    

    Output.txt file contains:

    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
    

    The procedure allows for the header and the data to separate files if necessary. Just by specifying the file name "header" will put the header and the data in a single file.

  • using the function - how to use the values of the input variables on the table select statement names

    Hello community, I have a problem when creating a function. The purpose of this function is to check the table of weather gave yesterday or not. We must check this on different tables on different sachems. We are creating a function with input variables.

    CREATE OR REPLACE FUNCTION IN_SCHEMA.IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    )

    RETURNS INTEGER

    AS

    -Declaring variables

    v_is_true INTEGER.

    BEGIN

    SELECT

    CASE

    WHEN MAX (in_datefield) = TRUNC(SYSDATE-1)

    THEN 1

    ON THE OTHER

    0

    END

    IN

    v_is_true

    Of

    in_schema.in_tablename

    ;

    RETURN v_is_true;

    END;

    /

    When creating, I got error: [error] ORA-00942 (44:19): PL/SQL: ORA-00942: table or view does not exist

    How to use the values of the input variables on the table select statement names?

    Hello

    Here's a way you can use dynamic SQL statements for this task:

    CREATE OR REPLACE FUNCTION IS_YDAYDATA_TO_TABLE

    (

    in_schema IN VARCHAR2,

    in_tablename IN VARCHAR2,

    in_datefield IN VARCHAR2,

    in_first_date DATE DEFAULT SYSDATE - 1,.

    in_last_date DATE by DEFAULT NULL

    )

    RETURNS INTEGER

    AS

    -IS_YDAYDATA_TO_TABLE returns 1 if in_schema.in_tablename.in_datefield

    -contains all the dates in the in_first_date of the range through included in_last_date

    - and it returns 0 if there is no such lines.

    -If in_last_date is omitted, the search only the data on in_first_date.

    -If in_first_date is omitted, it defaults to yesterday.

    -Time parts of the in_first_date and in_last_date are ignored.

    -Declaring variables

    sql_txt VARCHAR2 (1000);

    v_is_true INTEGER.

    BEGIN

    sql_txt: = 'SELECT COUNT (*).

    || 'FROM ' | in_schema | '.' || in_tablename

    || 'WHERE ' | in_datefield | ' > =: d1'

    || «AND» | in_datefield | '< >

    || 'AND ROWNUM = 1';

    dbms_output.put_line (sql_txt |) '= sql_txt in IS_YDAYDATA_TO_TABLE");  -For debugging

    Sql_txt EXECUTE IMMEDIATE

    IN v_is_true

    With the HELP of TRUNC (in_first_date) - d1

    TRUNC (NVL (in_last_date

    in_first_date

    )

    ) + 1                -- d2

    ;

    RETURN v_is_true;

    END is_ydaydata_to_table;

    /

    DISPLAY ERRORS

    If you must use dynamic SQL statements, put all the SQL statement in a single string variable, such as sql_txt in the example above.  In this way, you can easily see exactly what will be executed.  Comment out the call to dbms_output under test is completed.

    Try to write functions that will address not only the question that you have now, but similar questions that you may have in the future.  For example, now that interest you only to the verification of the data of yesterday, but later, you might want to check another day or range of days.  The above function combines the convenience of a function simple (looks like yesterday data if you don't tell him otherwise) with the power of a more complex function (you can use the same function to check any day or range of days).

  • How to create a cursor on a statement select union?

    Hello
    Using Oracle 10 g RAC + ASM (VERSION 1002000300)
    What is the right way to create a cursor on a statement select union?
    Is this possible?

    lines, results in code error PLS-00201: sT: = crsR.STATUS; sS: = crsR.TIME;

    Procedure below:
    -----
    CREATE OR REPLACE PROCEDURE BUILD_SUMMARY IS

    CsrO CURSOR IS
    SELECT
    STATUS,
    TIME
    DE)
    SELECT
    STATUS OF SUBSTR (DESCRIPTION, 1, 50),
    To_char (TIMESTAMP, "MM/DD/YY hh12:mi:ss'") TIMES
    OF GLOBALSALES. CUBE_STATUS
    UNION ALL
    SELECT
    "BUILD TOTAL TIME."
    TO_CHAR (TO_DATE('00:00:00','HH24:MI:SS') + (MAX (TIMESTAMP) - MIN (TIMESTAMP)), 'HH24:MI:SS')
    OF GLOBALSALES. CUBE_STATUS);
    Scrr csrO % ROWTYPE;
    sT LONG: = ";
    sS LONG: = ";
    BEGIN
    FOR Scrr IN csrO
    LOOP
    sT: = crsR.STATUS;
    sS: = crsR.TIME;
    DBMS_OUTPUT. Put_line(St ||) ' ' || sS);
    END LOOP;
    END;
    /

    The results of changes in the same PLS-00201 error messages stating the: identifier ' CRSR. STATUS must be declared
    and the identifier ' CRSR. STATUS must be declared
    ...
    FOR Scrr IN csrO
    LOOP
    sT: = crsR.STATUS;
    sS: = crsR.TIME;
    DBMS_OUTPUT. Put_line(St ||) ' ' || sS);
    END LOOP;

    You are not running what I posted here.

    Please replace this line here:

    FOR csrR IN csrO 
    

    to do this:

    FOR crsR IN csrO 
    

    It helps if you name your variables and objects after something more meaningful and less complicated, for example:

    FOR cur_rec IN csrO
    LOOP
      sT := cur_rec.STATUS;
      sS := cur_rec.TIME;
      DBMS_OUTPUT.PUT_LINE(sT || ' ' || sS);
    END LOOP;
    
  • How to insert image from mysql into the table using php and create the checkbox in the table?

    How can I insert image from mysql into the table using php and create the checkbox for each data as a vote? Here is my code...

    WELCOME

    connect_error) {die ("connection failed:".)} $conn-> connect_error); } $sql = "SELECT no, Calon, ID, of course, the Image OF THE candidates." $result = $conn-> Query; If ($resultat-> num_rows > 0) {echo ' '; export data of each line while ($row = $result-> fetch_assoc()) {"echo"}}
    NO Candidate INFO Vote
    " . $row ["no"]. "-" . $row ["Calon"]. "
    -" . $row ['ID']. "
    -" . $row ['class']. "
    "; } ECHO ' ' ;} else {echo '0 results' ;} $conn-> close();?} >

    hope someone can help me because I am a newbie in this program... need to finish this project... Thank you.

    If you have saved the file name in the database, it's pretty simple.

    echo '' . $row['description'] . '';
    

    Is the same for the box:

    echo '';
    

    If you have saved the image file in the database, it is much more complicated. I recommend you store only the file name in the database.

  • How to split a PDF into smaller files using Acrobat XI

    How to split a PDF into smaller files using Acrobat XI?

    Hi laforcej

    Open the PDF in Acrobat...

    Go to tools-> Pages-> extract

    Now, select the Page number, you want to extract and save

  • How to insert data into the database using smartview

    Hello
    I am trying to insert data into the database using * "Send data" * button on the Ribbon of Essbase.
    My database is empty.

    I opened an ad hoc network, it returns * "#missing" * in all cells
    I have modified the cells and provided data in the cells that I want to. Now, I supported on * "Send data" * button.
    It just reloaded the adhoc grid instead of submit data, I rechecked the data through data console Administrative Service are not inserted.

    I am following the right way to insert data? If not, could you please suggest me how (Populate) insert default data in the database?

    --
    VINET

    You go about it the right way, once you have submitted if you réactualisiez then data values should be there, if you POV is against members of dynamic calc and then data not written to the database, you need to check the Member properties of your POV.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to use the escape character in the update statement.

    Hi all

    I'm trying to update using the following table update statement in sql, but whenever he asks me to enter the value 'and' below sql.
    UPDATE xyz_xyz
       SET NAME = 'ABC & PQR'
     WHERE ID = (SELECT ID
                   FROM abc_abc
                  WHERE NAME = 'C & PQR');
    Please let me know how to use escape character syntax or let me know if there is no alternative.

    Thank you
    Vishwas

    If you use SQL * more then use SET DEFINE OFF.

    Also, you can do something like this

    UPDATE xyz_xyz
       SET NAME = 'ABC' ||'&' || 'PQR'
     WHERE ID = (SELECT ID
                   FROM abc_abc
                  WHERE NAME = 'C' ||'&' ||'PQR');
    
  • My iphone 5 has been bought from the United States. However, I would use it in Nigeria, and I need to unlock it. All technicians of the phone I have met demand expensive prices. Can I tell how to do it myself?

    My iphone 5 has been shopping in the United States. However, I would use it in Nigeria, and I need to unlock it. All technicians of the phone I have met demand expensive prices. Can I tell how to do it myself?

    5 64 GB IPhone.

    As always, only the provider of cellular origin can legitimately to unlock iPhone. Contact them to determine their release policy, and if YOU are eligible.

  • How to recover a selection of the screen using the tool of cross hatching? S worked on the old pc to control...

    I used to be able to select a piece of the screen using Ctrl-S, how I got a cross-hatch tool (it looks like the Selection tool in Photoshop)

    Please help - lost without this feature!

    Maybe your version of Vista has the Snipping Tool...

    Windows Vista - activate the Vista Snipping Tool
    http://www.PCWorld.com/article/137099/activate_vistas_snipping_tool.html

    Use capture tool to capture screenshots
    http://Windows.Microsoft.com/en-us/Windows-Vista/use-Snipping-Tool-to-capture-screen-shots

    Vista tutorial - How to use the tool captures of Vista
    http://www.Vistax64.com/tutorials/148532-how-use-Snipping-Tool-Vista.html

  • How to use PL/SQL to create dynamic action to set the value of a selection by another list?

    Hello

    I would like to know how to use PL/SQL to create dynamic action to set the value of a list of selection by another selection list.

    1.PNG

    I wish can create dynamic action to manage the two above the Room select list (: P9_ROOM) and building (: P8_BUILDING).

    When you select "1074" in the bathroom, building highlights like "BRM BLD 5"

    When you select 'Area of the black box' in the room, building must assign the value "7 BLD BRM"

    When the room is Null, building should also be Null.

    I thank you,

    Alice

    I forgot to mention, for the PL/SQL Code, because you are working with items in the selection list, the return values are different from the display on your LOV values, you must instead use the return values.

    Thank you

    Erick

  • How to disable/enable inputtextfileld on select of another radiobutton using adf12.1.3

    Hello

    How to disable/enable inputtextfileld on select of another radiobutton using adf12.1.3

    Can anyone provide a few points on that.

    I did it like below on my listner valuechange radiobutoon method but does not work

    {} public void onRadiobuttonVCE (ValueChangeEvent valueChangeEvent)

    Add the code in the event here...

    log.info ("GCONF1001Bean onRadiobuttonVCE() started:::"+valueChangeEvent.getNewValue()); ")

    concentratorMode = valueChangeEvent.getNewValue (m:System.NET.SocketAddress.ToString ());

    concentratorMode is the value of the selected radiobutton

    RichInputText r = findComponentInRoot ("it2") (RichInputText);

    log.info ("value of r GCONF1001Bean onRadiobuttonVCE:" + r);

    {if (concentratorMode.Equals("1"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 1st if :::"); ")

    r.setDisabled (false);

    log.info ("GCONF1001Bean onRadiobuttonVCE() after 1st if :::"); ")

    }

    {if (concentratorMode.Equals("2"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 2nd if :::"); ")

    r.setDisabled (true);

    log.info ("' GCONF1001Bean onRadiobuttonVCE (after if 2nd): '");

    }

    {if (concentratorMode.Equals("3"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 3rd if :::"); ")

    r.setDisabled (true);

    log.info ("GCONF1001Bean onRadiobuttonVCE() after the 3rd if :::"); ")

    }

    }

    --

    JS

    You can set a variable bean said "textBeanDisabled" and set the value of this 'Y' or 'n', based on your health status.

    Then set the disabled property

    Just copy - paste your logic to the above post:

    String textBeanDisabled = "N";

    {} public void onRadiobuttonVCE (ValueChangeEvent valueChangeEvent)

    Add the code in the event here...

    log.info ("GCONF1001Bean onRadiobuttonVCE() started:::"+valueChangeEvent.getNewValue()); ")

    concentratorMode = valueChangeEvent.getNewValue (m:System.NET.SocketAddress.ToString ());

    concentratorMode is the value of the selected radiobutton

    RichInputText r = findComponentInRoot ("it2") (RichInputText);

    log.info ("value of r GCONF1001Bean onRadiobuttonVCE:" + r);

    {if (concentratorMode.Equals("1"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 1st if :::"); ")

    r.setDisabled (false);

    textBeanDisabled = "N";

    log.info ("GCONF1001Bean onRadiobuttonVCE() after 1st if :::"); ")

    }

    {if (concentratorMode.Equals("2"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 2nd if :::"); ")

    r.setDisabled (true);

    textBeanDisabled = 'Y ';

    log.info ("' GCONF1001Bean onRadiobuttonVCE (after if 2nd): '");

    }

    {if (concentratorMode.Equals("3"))}

    log.info ("GCONF1001Bean onRadiobuttonVCE() inside the 3rd if :::"); ")

    r.setDisabled (true);

    textBeanDisabled = 'Y ';

    log.info ("GCONF1001Bean onRadiobuttonVCE() after the 3rd if :::"); ")

    }

    }

    See you soon

    AJ

Maybe you are looking for