wwv_flow. Debug

Hello

I recently read that wwv_flow.debug had been integrated in the APEX by a built-in command.


Anyone happen to know the name / the new command for that I can't find it anywhere.

II.

Hello

You mean the APEX_DEBUG_MESSAGE package
http://docs.Oracle.com/CD/E23903_01/doc/doc.41/e21676/apex_debug.htm#CEGGIAIF

Or APEX_APPLICATION. G_DEBUG
http://docs.Oracle.com/CD/E23903_01/doc/doc.41/e21676/apex_app.htm#CHDDADIE
http://docs.Oracle.com/CD/E23903_01/doc/doc.41/e21674/concept_sub.htm#sthref171

Or something else?

Kind regards
Jari

-----
My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai

Tags: Database

Similar Questions

  • apex_debug.message vs wwv_flow.debug

    Hi all:

    What is the difference between the procedure apex_debug.message () and wwv_flow.debug ()? It seems to me that both can be used to connect the debugging. When should I use each of them?

    Thank you!

    Kevin

    Hey Kevin,

    wwv_flow. Debug is an older version, and apex_debug.message is the most recent version (with more features). Better use apex_debug, its official documented:

    https://docs.Oracle.com/database/121/AEAPI/apex_debug.htm#AEAPI29228

    Concerning

    Sebastian

  • Debug mode does not

    Hello

    We are in the process of migration of the APEX v3.2.1 on the database 10 g to v4.2.1 on database 11 g. APEX APEX is installed fresh on 11g. I was testing imported and exported of v3.2.1 application in v4.2.1. I was not able to activate the debug mode in the developer bar when the application runs. The url changes, but no debug information appears as was the case in v3.2.1. I see a partial set of debugging information when I open then see the debug window in the bar of developer. This show of debugging is incomplete. By that I mean I don't see not session state change and I don't see any information in the function "wwv_flow.debug".

    I read in a thread for an earlier version 4, toggle the debug field in edit application properties and apply, but that no longer works. Something to note is that when the debug field in edit application properties was set to NO, I don't have the error "Debugging is not enabled for this application" when you turn on the debug mode.

    I created a zero of application form and debug mode does not work either.

    There is a global setting in administration somewhere I should activate to get debug information in the page as in v3.2.1?

    dominiquefortin wrote:

    We are in the process of migration of the APEX v3.2.1 on the database 10 g to v4.2.1 on database 11 g. APEX APEX is installed fresh on 11g. I was testing imported and exported of v3.2.1 application in v4.2.1. I was not able to activate the debug mode in the developer bar when the application runs. The url changes, but no debug information appears as was the case in v3.2.1.

    No debug information appears online in the APEX 4.x page. All of this appears in the debug window.

    I see a partial set of debugging information when I open then see the debug window in the bar of developer. This show of debugging is incomplete. By that I mean I don't see not session state change and I don't see any information in the function "wwv_flow.debug".

    Note that the debug window contains an interactive report that applies a default filter for the last visited page. You might not see the report of the desired page. Remove the filter from the page to see all the currently available debug reports. There are also separate reports for each page show/accept, then make sure that you select the correct phase.

    I read in a thread for an earlier version 4, toggle the debug field in edit application properties and apply, but that no longer works. Something to note is that when the debug field in edit application properties was set to NO, I don't have the error "Debugging is not enabled for this application" when you turn on the debug mode.

    I think maybe I saw a bug for this, but I can't find a reference at the moment.

    There is a global setting in administration somewhere I should activate to get debug information in the page as in v3.2.1?

    N ° all debugging information are now displayed in the debug window.

  • Tips to debug / find the source of the problem?

    Hello

    I have a problem with an ApEx application that is a little large and complex.
    Anyone has any suggestions or tips to find where a bug in the program data that happens?

    My version of the ApEx is 3.2.1.00.12

    Tips for debugging / tracing are greatly appreciated!


    Details of the problem:
    Somewhere, the values in the ApEx APEX_APPLICATION collection. G_F33 get set of duplicates.
    In a process Page:
    FOR i in 1..APEX_APPLICATION.G_F33.COUNT LOOP
    -- This code is running too many times
    END LOOP;

    In very general terms, here under the name of debugging tips:

    1. (this is a sine qua non btw - stop what you are doing and do this first): see the documentation of the APEX for a debugging guide. There are references to the "window of Session' and 'Debug Mode' - making use of these views can give you a lot of detailed information on the current status of your application and what happens during the loading of the page.

    2 make use of the

    wwv_flow.debug
    

    function of output messages, which can be seen in the denunciation of "Debug" (see above) - it's kind of equivalent to the use of the former

     DBMS_OUTPUT
    

    in the world of PL/SQL.

    3. in the more complex application logic/code, try save information using a kind of framework for logging - either something about measurement or using a solution "on shelf".

    I would say that under option 3, especially for capturing information about errors/exceptions. I used to use my own custom logging package/table combination, but I moved to the use of APEX Logger of Tyler Muth *, which helped improve the debugging/alpha test of my applications without end.

    It is very easy to install, simply require some relatively minor privileges database and executing a single SQL script (of course if you do not have the relevant privileges, talk with your local administrator own - bring beer/chocolate/candy / [bribe choices] to facilitate).

    While writing the application code, you can insert calls to the relevant Recorder function in areas requiring an observation. These entries can then be queried via built-in views. In addition, you can capture complete session Apex information with a simple function call, which allows you to examine the State of the whole application at a point of run (particularly useful for situations where there is a reference to several pages or elements of application).

    Once you have finished your debugging phase, you also have the option to change the logging levels so that (for example when you move to a production environment) you can turn off logging completely or leave it to report errors only.

    (*) I have no affiliation with Tyler Muth or recorder of APEX is said by the way

  • custom layout and update the page elements

    Hello

    I'm working on an APEX application, I need a page to view issues and alternative options, such as only choose radio group or mutiple shoose by box. The user will then check the answers. After the answer questions, send the page to get the score.

    The presentation must be: separate regions by the kind of question. in each region, the question in the first line; the four options in the second line, the checkbox or a radio Fund; in the bottom of the page, there is a button "submit".

    The tables are designed as follows,
    create the table RULE_QA_SHEETS
    (
    SHEET_ID NUMBER of non-null,--ID for the answer of the question sheet
    Category NUMBER not null, - use a tmplate to build the leaf, for example, numbers of gender issue, easy or difficult
    PERSON_ID NUMBER not null,-the user who was answering questions
    DATE OF ANSWER_DATE,
    NOTE VARCHAR2 (4000 TANK)
    )

    create the table RULE_QA_SHEET_ITEMS
    (
    ITEM_ID NUMBER not null,--ID for the question in this form.
    SHEET_ID NUMBER not null,--master id of the table.
    QUESTION_ID NUMBER not null,--ID for the issue in the inventory.
    MEET VARCHAR2(30 CHAR) - the answer the user checked, will be compared to the inventory. Once the user to submit the page, this column will be updated.
    )

    I've not found a good report APEX model, and I can use dynamic content plsql to generate the layout but no idea how to upgrade the right answers.

    Everyone has the same experience, or give me a help, that would be great!

    Thank you!

    Chongwu says:
    Here is the connection info.
    Workspace: CHONGWU
    User: dev1
    Password: 1qaz2wsx
    Answers and the Question of enforcement 42990

    Could you please give me an example of this? page 15, pls help to control dynamic pl/sql region that generates the page layout.

    See page 150 in your application. I started with a copy of your page 15 and brought some changes in regions of dynamic PL/SQL to produce more semantic HTML by using ordered lists and labels. Labels provide also bigger clickable/tangible goals by answering the questions.

    declare
    
      i number := 1;
    
    begin
    
      htp.p('
      '); for q in ( select q.qa_id , q.question , q.answer_a , q.answer_b , q.answer_c , q.answer_d from rule_qa q where q.question_type = 'S') loop htp.p('
    1. ' || q.question || '
        '); htp.p('
      1. ' || apex_item.radiogroup(i, 'A', null, p_item_id => 'q-' || i || '-a', p_item_label => q.answer_a) || ''); htp.p('
      2. ' || apex_item.radiogroup(i, 'B', null, p_item_id => 'q-' || i || '-b', p_item_label => q.answer_b) || ''); htp.p('
      3. ' || apex_item.radiogroup(i, 'C', null, p_item_id => 'q-' || i || '-c', p_item_label => q.answer_c) || ''); htp.p('
      4. ' || apex_item.radiogroup(i, 'D', null, p_item_id => 'q-' || i || '-d', p_item_label => q.answer_d) || ''); htp.p('
      '); i := i + 1; end loop; htp.p('
    '); end;

    Some CSS is required for formatting required and to get the labels actually appear:

    ol.questions>li {
      margin-bottom: 1em;
      font-weight: 600;
    }
    ol.answers {
      margin: 0.5em 2em;
      list-style: lower-alpha outside;
    }
      ol.answers>li {
        clear: left;
        margin: 0.5em 0;
        font-weight: 400;
      }
      ol.answers>li span {
        display: inline-block;
      }
      ol.answers>li label.hideMeButHearMe {
        position: static;
        top: auto;
      }
      ol.answers>li input {
        float: left;
        margin: 0 0.5em 0 0;
        padding: 0;
        vertical-align: middle;
      }
    

    Finally, there is a simple process that records the answers in a collection of the APEX. Collections are frequently used apps Q & A and survey to store responses temporarily before their final transformation:

    declare
    
      answer varchar2(32767);
    
    begin
    
      /*
        Create or empty the APEX collection used to temporarily store the user
        responses.
      */
      apex_collection.create_or_truncate_collection('ANSWERS');
    
      for i in 1..50
      loop
        /*
          Dynamically capture the contents of each apex_application array...
        */
        execute immediate '
            begin
              :1 := apex_util.table_to_string(apex_application.g_f' || to_char(i, 'fm09') || ');
            end;'
          using out answer;
    
        wwv_flow.debug('apex_application.g_f' || to_char(i, 'fm09') || ' = ' || answer);
    
        /*
          ...and if there's a response then record it in the collection.
        */
        if answer is not null
        then
          apex_collection.add_member(
              p_collection_name => 'ANSWERS'
            , p_n001 => i
            , p_c001 => answer);
        end if;
    
      end loop;
    
    end;
    

    It appeals to a rather horrible dynamic assessment of the apex_application tables. As Howard points out, there is only 50 of these paintings, which can be limited if you plan to have more than 50 questions. A common way to avoid these two problems is to present only one question at a time (turn-off to back on the same page in a sort of Pseudo-Assistant until all questions are answered), so you only need to refer to a single table, known.

    Note, however, that I am not keen on this model of single table. You can consider using a more flexible and extensible model as in This example.

  • Have mutiple e-mail addresses in the Apex messaging features

    Hello

    I would like to be able to use a multiple selection box or the shuttle that will fill the e-mail for thought email Apex addressess.
    I use 10g and Apex 3.2. I am able to send email through the application with an e-mail address. Please let me know if this is possible, as I couldn't find anything for this.


    Thank you
    Mary

    If we put aside the actual sending of mail temporarily, let's see what we produce here:. If you don't mind, can you try this?

    If you can reproduce this code snippet (either by commenting on relevant information or simply create a new one pulled by the same button (whilist by disabling the first).)

    declare
          v_sql varchar2(4000);
    
       begin
           v_sql  := replace(:p4_slct_eml,':', ', ');
    
           wwv_flow.debug('email string [ '||v_sql||' ]');       
    
    end;
    

    Switch to debug mode, choose the email addresses that you want to test in your multselect article and click on the appropriate button. Chain of HRT being passed in the parameter of email address should appear in square brackets. Once you have done this, let us know the result.

  • apex_application.g_f0X - no data found?

    All,

    We are running in a sporadic error (don't you hate those?) save a form in a table where up an error "no data found". We use a custom PL/SQL record the process which makes a loop through all the fields in g_f0X to save the data of the user. Through the liberal use of the debug messages, I found that the error occurs in these two lines:
    nmin := apex_application.g_f04(i);
    nmax := apex_application.g_f05(i);
    Here is the HTML code for the appropriate line (in this case, I have is 22), just before hitting the Save button and get the error:
    <td headers="NEW_MIN" class="data">
         <label for="f04_0022" class="hideMe508">NEW_MIN</label>
         <input type="text" name="f04" size="6" maxlength="2000" value="11" data_field="new_min" id="f04_0022"/>
    </td>
    <td headers="NEW_MAX" class="data">
         <label for="f05_0022" class="hideMe508">NEW_MAX</label>
         <input type="text" name="f05" size="6" maxlength="2000" value="17" data_field="new_max" id="f05_0022"/>
    </td>
    No idea what's happening, and how can I solve this problem?

    Thank you
    -David

  • Is there some JS code disabled a few lines before the submit?
  • Is it possible that you use one of these paintings 04 or 05 in other places on the page, except the measurement report?
  • If you use a wwv_flow.debug (apex_application.g_f04. COUNTY) and wwv_flow.debug (apex_application.g_f05. COUNTY)
    Match these values, which is also the same as the number of lines that you see in the report?

  • Function body PLSQL returning a sql report returns ORA-01403 no data found

    I'm on APEX 3.1.2.00.02 and Oracle 10 g.

    I develop a relationship with the type of SQL query (body of function from PL/SQL returning SQL query). But the performance of the report, I get

    error report:
    ORA-01403: no data found


    Source of the region
    declare
      qry varchar2(32767);
    begin
      --Procedure call
      my_pkg.get_query(qry);
    
      htp.p(qry);
    
      return /*select 1 from dual */ qry;
    end;
    Procedure
    PROCEDURE get_query (V_QRY OUT VARCHAR2)
    IS
      qry varchar2(32767);
    begin
    
      qry := ' select name
         , max(decode(to_char(service_date,''Mon-YY''), ''Jan-09'', value, null)) as "Jan-09"
         , max(decode(to_char(service_date,''Mon-YY''), ''Jan-09'', value, null)) as "Feb-09"
         from MY_TABLE
         group by name ';
      
      V_QRY := qry;
    end;
    The query will be improved later to add more month and year according to the user settings that I am running on this report.

    I want to use specific query column names. I saw this suggestion from Scott in a number of threads to use / * select 1 double * / with the query, but does not not in my case.

    Please can anyone suggest what I can do to make it work?

    Kind regards

    Amir

    First of all, unit you have tested the procedure (namely, in the workshop of SQL, SQL * Plus, SQL Developer, etc, etc) to see if it produces the output in the first place right?

    If you have, and the generated query string is valid, try to assign the output to a page element (allowing you to visualize in the session browser), or even through the procedure output window for debugging (using the wwv_flow.debug function). This might indicate a change of State or session that is causing it not to return. You might find this easier to achieve if you switch from one "procedure and output parameter ' combination 'function returning string' approach."

    If not, try to re-create the report in a new region - sometimes I came across strange bugs with parts of the report which were solved in this way.

  • APEX_APPLICATION. G_DEBUG at APEX 3.2

    Hello

    We use the APEX 3.2.1.
    I want to add a debug code custom APEX debugger like this:
    if APEX_APPLICATION.G_DEBUG = 'YES'
    then
            wwv_flow.debug('<font color="red">Kilroy was here</font>');
    end if;
    But the APEX_APPLICATION package is not recognized. You have to grant specific rights on this package to other users, or is this only possible with 4 APEX?

    Thank you
    Matthias Hoys

    Everything correctly, your code is invalid anyway. apex_application.g_debug is a Boolean type. You are comparing it to a varchar2.

    know-how

    if apex_application.g_debug = TRUE THEN
      --todo: logic
    end if;
    

    Van
    Trent

  • Analyze: Body of PL/SQL function returning a SQL query

    I need to get the final SQL returned by the PL/SQL function.
    I'll use this final SQL in a procedure.
    Please provide only a few tips on how to get the SQL code. I already looked in the DBMS_SQL package, but I don't know if this is the right place to look.


    Kind regards
    Sumit
    declare 
    
      l2 varchar2(2000);
    
    begin
    
      l2:= 'Select NAME,ORIGINATED,OWNER,ORIGINATOR,';
      l2:= l2 || 'DESIGNATED_UNIT,SOURCE,';
      l2:= l2 || 'REFERENCE';
      l2:= l2 || ' from MV_DETAILED_DATA';
    
      /*
        Copy dynamic query SQL to application item for later use.
      */
      :app_item := l2;
    
      wwv_flow.debug('l2: ' || l2);
    
      return l2;
    
    end;
    

    I always use a call of debugging in the region of body of the PL/SQL function returning a SQL query sources so the real generated SQL can be quickly entered via the debug mode.

  • Cannot get 'IN' text field with multiple values.

    I have a text field (P11_SERIAL_NUMBERS) someone would use to enter multiple values (i.e. of the serial numbers). I tested various methods but can't seem to get anything working. I used values such as ' 12929', '19191' or ('11919', ' 19192 ', ' 1111') or 12121,121333.»

    I have to analyze this area after the entrance is and update P11_SERIAL_NUMBER to something like ("121212 ', 121211', '292929'). The report is a SQL query returning the body of a PL/SQL function. I build the query in an anonymous block to something like the following:

    SELECT apex_item.checkbox (1, instance_number) Ins,.
    apex_item. Text(2,i.instance_number) instance_number.
    apex_item. Text(3,i.item_number) item_number.
    description of the apex_item. Text(4,i.Description),
    Serial_number apex_item. Text(5,i.serial_number),
    i.party_name,
    i.status_name
    Cycsi_item_details_v I have
    WHERE i.item_number IN (SELECT v.item_number FROM cycsi_installed_base_v WHERE v.serial_number = i.serial_number v)
    AND i.item_number AS NVL ('%' |') XLA' | ' %','%')
    AND NOT EXISTS (SELECT d.item_serial_number FROM cy_fco_d, d WHERE d.fco_id = 2803 AND d.item_serial_number = i.serial_number) AND i.serial_number IN ('61763 ', ' 61621');

    However, when I enter several values that nothing ever went back to the SUMMIT even though the SQL query returns more rows. I run the application in debug mode and it seems to show the values correctly.

    0.11: show report
    0.12: determine the column headings
    0.12: analyze the query such as: TRAFFIC
    0.15: binding: ": P11_MODEL_NUMBER"= "P11_MODEL_NUMBER" value = "XLA"»
    0.16: binding: ": P5_FCO_ID"= "P5_FCO_ID" value = "2803"»
    0.17: binding: ": P11_SERIAL_NUMBERS"= "P11_SERIAL_NUMBERS" value = '(' 61621', ' 61763')""
    0.19: print the column headings
    0.19: loop lines: 15 rows
    No data found

    If I add only a serial number at a time as the APEX application returns the line correctly.


    Does anyone have an idea what I'm doing wrong or what best way to solve this problem?
    Thank you
    John

    Published by: Jennifer on July 13, 2010 15:23

    Hi John,.

    I just tried a report region based on PL/SQL query encoded using your method to refer to element names in the query string of back:

    declare
       q varchar2(100) := 'select ename, job from emp';
    begin
       if :P2_ENAMES is not null then
            q := q || ' where ename in :P2_ENAMES';
       end if;
    
       wwv_flow.debug('*** Query: ' || q);
    
       return q;
    end;
    

    As I suspected, he did not work for me P2_ENAMES was ('KING') or ('KING', 'SMITH'). I think it's because of the reason for which I gave in my previous post - ApEx passes off the coast of the dynamic execution of SQL string, it does not automatically replace the mention: P2_ENAMES with the value of the element. I don't know how it can work for you.

    If I change the code I proposed:

    declare
       q varchar2(100) := 'select ename, job from emp';
    begin
       if :P2_ENAMES is not null then
            q := q || ' where ename in ' || :P2_ENAMES;
       end if;
    
       wwv_flow.debug('*** Query: ' || q);
    
       return q;
    end;
    

    It works very well if one or several names are specified.

    I took a blow to modify your code for the construction of the query string - does not immediately guarantee, it'll work because I can't test (might be missing a parenthesis or quotation) it but you should get the idea:

    -- start with initial valid query that ApEx can parse to determine column names
    q := 'SELECT apex_item.checkbox(1, instance_number) ins, apex_item.text(2, i.instance_number) instance_number,
                 apex_item.text(3, i.item_number) item_number, apex_item.text(4, i.description) description,
                 apex_item.text(5, i.serial_number) serial_number, i.party_name, i.status_name
            FROM cycsi_item_details_v i
           WHERE i.item_number IN (SELECT v.item_number
                                     FROM cycsi_installed_base_v v
                                    WHERE v.serial_number = i.serial_number)';
    
    -- add model number condition if specified
    if :P11_MODEL_NUMBER is not null then
       q := q || ' AND i.item_number LIKE ''%' || :P11_MODEL_NUMBER || '''%''';
    end if;
    
    -- add serial numbers condition if specified
    if :P11_SERIAL_NUMBERS is not null then
       q := q || ' AND i.serial_number IN (' || :P11_SERIAL_NUMBERS || ')';
    end if;
    
    -- add FCO id condition if specified
    if :P5_FCO_ID is not null then
       q := q || ' AND NOT EXISTS (SELECT d.item_serial_number
                                     FROM cy_fco_d d
                                    WHERE d.fco_id = ' || :P5_FCO_ID || '
                                      AND d.item_serial_number = i.serial_number)';
    

    I know that has focused on getting this code works, but I would be remiss in my duties if I didn't at least mention the risk of SQL injection. You may already know this, but unless you do a good job to validate the values of the element used in the query, you could open yourself up to a SQL injection attack. For example, imagine what that would be returned if a hacker sharp entered "12345) GOLD (1 = 1" in the field of P11_SERIAL_NUMBERS - you would get all that may or may not be a security problem.

    Hope this helps,
    John

  • DMBS_OUTPUT

    Hello

    I am trying to troubleshoot an authentication package and want to display the values of certain variables. I added the DBMS_OUTPUT lines in a part of the package (see below), but it is not all the values when the connection fails.
       begin
          v_app_alias := 'APP_ALIAS';
          -- first check to see if the user account dates are valid
          --   and they have a profile for the application
          open  user_cur(v_app_alias, p_username);
          fetch user_cur
           into v_profile_id;
          if user_cur%found then
             -- has profile
             -- fetch the stored password
             select password
               into v_password
               from users
              where lower(user_name) = lower(p_username);
              -- decrypt stored password
              v_stored_password := decrypt_str(v_password);
              -- compare supplied password and stored password
              if p_password = v_stored_password then
                 v_results :=  true;
              end if;
          end if;
          DBMS_OUTPUT.enable;
          DBMS_OUTPUT.PUT_LINE('v_app_alias');
          close user_cur;
          return v_results;
       end my_auth;
    Any suggestions on how I can see the values?

    Thank you
    Matt

    A few suggestions... DBMS_OUTPUT does not work on the web. You can use htp.p () or wwv_flow.debug () instead of this property.

    However, in my opinion a MUCH better solution would be to use the recorder . Yes, I wrote it, but I wrote it for precisely what you're trying to do.

    I think that your 2nd line should be:

    v_app_alias := v('APP_ALIAS');
    

    Finally, I congratulate you for NOT to store passwords in clear text. However, based on your terminology so you're encrypt, which indicates that you can decrypt. Generally accepted practices for this are for them "chop" with a key hash or ' * authentication of Message (MAC) Code. " It is a one-way algorithm so you can never decipher passwords which is even more secure. Your code simply applies the same MAC for the password entered on a login screen, and then you compare hashed values 2. If they are equal, it is valid, otherwise, they entered the wrong password. Take a look at [dbms_crypto.mac | http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_crypto.htm#i1000594].

    Tyler Muth
    http://tylermuth.WordPress.com
    [Oracle security application: development of secure database and Middleware environments | http://sn.im/aos.book]

  • update of a collection should for error

    I'm downloading a file in a collection...
    then a loop in the collection and update a table with the following code...
    It works for those who work, but does not display an error for those who do not work...

    What would be the best way to catch errors and not to commit one of the collection changes if one of the files in the downloaded file does not...

    --------------
    for r in)
    Select c001, c002 htmldb_collections where collection_name = "P50_COLLECTION")
    loop
    If ('P50_PROPERTY_CLAIM_CHOICES') v = "CMR_RECIEVD" then
    Update property_claim set CMR_RECEIVED = r.c002 where CLAIM_NO = r.c001;
    end if;
    end loop;
    --------------

    The UPDATE may not actually update data in many occasions (in code)

    When if unfulfilled condition
    When the 'conditions' in where clause has not met
    When there is no data in collections

    so for a case, oracle do not raise exceptions and this is the reason why you see no message, even if the data have not been updated.

    So update your process as follows... so the user will get error message when no rows updated...

    BEGIN
    if v('P50_PROPERTY_CLAIM_CHOICES') = 'CMR_RECIEVD' then
    update property_claim
    set CMR_RECEIVED = (select c002 from htmldb_collections
    where collection_name='P50_COLLECTION' and CLAIM_NO = c001)
    WHERE CLAIM_NO in (select c001 from htmldb_collections
    where collection_name='P50_COLLECTION');
    end if;
    
    -- if no rows updated then show error message
    -- alternatively you can also raise any custom exception here
    
    IF SQL%NOTFOUND THEN
    wwv_flow.g_notification := 'Error - No rows updated';
    END IF;
    
    COMMIT;
    
    EXCEPTION
    WHEN OTHERS THEN
    rollback;
    -- you can see this when you run in debug mode
    wwv_flow.debug('Exception Raised ' ||SQLCODE ||'Message'|| SQLERRM);
    
    wwv_flow.g_notification := 'Exception Raised ' ||SQLCODE ||'Error Message'|| SQLERRM;
    END;
    

    See you soon,.
    Hari

    Published by: Hari_639 on December 10, 2009 08:58

  • Tables APEX_APPLICATION - phase?

    I'm really struggling to get my head around this. I am generating a region of report using APEX_ITEM and my code looks like this:
    select
    ac.short_desc || apex_item.hidden(1, ac.short_desc) "short_desc",
    apex_item.checkbox(2,ac.audit_check_id,'UNCHECKED') "Fail"
    from audit_check ac
    where active_flag = 'Y'
    and department_id = 1
    I use a validation to loop through the array of checkbox and return the value of the field short_desc. There are only 2 rows in my region to report, but strangely, if I check the first box, which seems to return the value of the second line of the report, not the first short_desc.

    This is the code I use to return the value of short_desc, I rewrote it as a simple debugging output to see what is happening. If I check the first box, I get the second value of short_desc instead of the first. I am doing something stupid here? Code below:
    begin
    
    FOR i in 1..APEX_APPLICATION.G_F02.COUNT LOOP
    
    wwv_flow.debug(APEX_APPLICATION.G_F01(APEX_APPLICATION.G_F02(i)));
    
    end loop;
    
    end;
    Also, if I choose the second box, I get an ORA-01403: no given available error, as he is looking for a value of table that does not exist.

    Hello:

    Your validation needs are not related to the question that started this thread.
    You can consider using javascript to validate the contents of the text box on the form. Something like

    arr1 = document.forms[0].f02;
    arr2 = document.forms[0].f03; // the textarea
    for (i=0;i.value=='') alert ('error message here');}...
    
    
    Edited by: varad acharya on Nov 11, 2009 5:34 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
    
  • apex_items and apex global tables

    Hello
    I use apex_item.checkbox and apex_item.text via a report sql like this:
    SELECT
    id,
    apex_item.checkbox(1,id) " ", 
    apex_item.text(2,name) "name"
    FROM APEX_APPLICATION_FILES
    WHERE REGEXP_LIKE(name,'txt');
    and an after submit processes like this:
    DECLARE
    BEGIN
    
    --Loop through the selected id
    FOR i in 1..apex_application.g_f01.COUNT
    LOOP
      IF apex_application.g_f01(i) IS NOT NULL
        THEN 
           INSERT INTO INC9_TEST(t2)values(apex_application.g_f02(i));
           wwv_flow.debug('MY PROCESS:' || APEX_APPLICATION.G_F02(i));
      END IF;
    END LOOP;
    I have two lines as sample data:
    Id  name
    1   abc
    2   def
    When I select the checkbox for Id 2, it keeps returning Id 1 in the global table of apex_applicaiton.g_f01 instead of Id 2. But if I select the two check boxes, then it correctly she travels with the id of 1 and 2. Anyone know why this is happening and what is the fix for this strange behavior?

    Thank you

    OK - I explained that, on the thread I linked to. You must have the check box values set for line numbers. This can be done by using something like:

    APEX_ITEM.CHECKBOX (1, '#ROWNUM#')
    

    Now, if the user activates the boxes, the submitted values will be the line numbers.

    You can then use this to retrieve the value of NAME to the same line:

    DECLARE
     vROW NUMBER;
     vNAME VARCHAR2(100);
    BEGIN
     FOR i IN 1..APEX_APPLICATION.G_F01.COUNT
     LOOP
      vROW := APEX_APPLICATION.G_F01(i);
      vNAME := APEX_APPLICATION.G_F02(vROW);
      ... etc...
     END LOOP;
    END;
    

    So, first get us the line number for each active element, and then use it to get the value of the corresponding row name.

    Andy

Maybe you are looking for