Pagination with pl/sql region.

Hi all,
I have created one more sample page with pl/sql region
workspace: srijaks
login:[email protected]
password:srijakutty
Application: 49471 - Sample Field Display
page 16
Initially it will display the first two records of the concerned department.
but then by clicking the next and previous buttons it has to display the next two records and the previous 2 records respectively.
Please, if some one can help me !!!?
Thanks in advance
bye
Srikavi

Hi Srikavi,
OK - I've updated your page to get the next/previous buttons working. I have removed the bit in the PL/SQL code that assigned a value to the next button as this was causing me problems. I have also updated the select statement in this to include: and empno >= v('P16_EMPNO').
The next/previous buttons are based on:
Previous:
WITH EMPS AS (SELECT EMPNO, DENSE_RANK () OVER (ORDER BY EMPNO DESC) EMPNUMBER FROM EMP WHERE DEPTNO = :P16_SELECT_DEPT AND EMPNO < :P16_EMPNO ORDER BY EMPNO DESC)
SELECT NVL(MAX(EMPNO),0)
FROM EMPS
WHERE EMPNUMBER = 2Next:
WITH EMPS AS (SELECT EMPNO, DENSE_RANK () OVER (ORDER BY EMPNO) EMPNUMBER FROM EMP WHERE DEPTNO = :P16_SELECT_DEPT AND EMPNO > :P16_EMPNO ORDER BY EMPNO)
SELECT NVL(MIN(EMPNO),0)
FROM EMPS
WHERE EMPNUMBER = 2These are calculated Before Header and are unconditional
I have also added an Employees item that is set as:
{code
SELECT COUNT(*)
FROM EMP
WHERE DEPTNO = :P16_SELECT_DEPT
This is only calculated when the item is null - which will be the case when a new dept is selected - so this only happens once per selection.  This returns a correct record count - updating the select statement in the report as above, caused problems with the existing count.  Not sure if you want to change these back?
As you can see, I've assigned a ranking to each item - this could have been achieved using a row number as well.  There are several ways this could have been handled.  The next/previous buttons could be based on the ranking/rownumber value and the EMPNO retrieved based on this.  The EMPNOs could be queried into a collection and you could use the sequence numbers to move through the records.  The above is just one example - you might like to try the others to see which one you prefer.
Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Dynamic PL/SQL Region

    Hi,
    i'm having some trouble with PL/SQL regions (or rather with function htp.p)...
    The first problem is: i want to allocate a variable with the current user and call this variable in htp.p.
    So i wrote:
    DECLARE
    BEGIN
    v_user := :P1_USER;
    HTP.p (v_user);
    END;
    Where P1_User is allocated with &APP_USER.
    But while starting the application, v_user seems to be empty (even though it isnt empty).
    Second problem: is it possible, to call page items in htp.p (like htp.p(&P1_USER.))? i didn't manage it...
    So i tried to create this items in HTML (a textfield and a button). But if i'm having these HTML-items, how do i call them in apex?
    It won't be :P1_ITEMNAME, will it?
    I hope both is understandable (my english and my problems)

    Thanks for your answers. But I'm still having some problems.
    In case of the 'user-example', it works just fine.
    But my second problem isn't solved.
    I'm creating a HTML-table via htp.p.
    But in this table, I want to place a textfield and a button (for searching).
    How could I place this items as objects (not only their value) in this table?
    I tried it with htp.p(V('P1_BUTTON')), but this doesn't work.
    @Dimitri
    Why would you use the :ITEM notation wherever possible?
    (i'm new to apex, so, sorry for this question)
    Message was edited by:
    DFiles

  • Report Using PL/SQL Region

    Hi,
    I have bit experiment create custom reports using PL/SQL region
    http://dbswh.webhop.net/apex/f?p=BLOG:READ:0::::ARTICLE:97800346956448
    I would like have from you tips and ideas how enhance this.
    Because I'm not so good with SQL,
    I really appreciate if you have tips enhance performance for query used for cursor.
        /* Report query */
        l_sql := '
          SELECT * FROM(
            SELECT a.*, row_number() OVER (ORDER BY '
            || l_sort_col
            || ' '
            || l_sort_ord
            || ') rn, COUNT(1) over() mrn
            FROM(' || l_sql || ') a
          ) WHERE rn BETWEEN ' || l_start_row || ' AND ' || l_last_row
        ; Regards,
    Jari

    Hi Jari
    I'm guessing you're trying to do paginated grid data or somewthing similar? You could try something like this...
        l_sql := 'SELECT * '||
               'FROM ('||
                      'SELECT /*+ FIRST_ROWS(n) */ '||
                              'a.*, ROWNUM rnum '||
                       'FROM ('||l_sql||' '||
                              'ORDER BY '||l_sort||' '||l_dir||') a '||
                       'WHERE ROWNUM <= '||l_max_row||') '||
               'WHERE rnum >= '||l_start;The variables would be initialized in the procedure as follows...
        l_max_row := p_start + p_limit;
        l_start   := p_start + 1;
        l_sort    := NVL(p_sort,'1');
        l_dir     := NVL(p_dir, 'ASC');My application process would be called something like follows, to spit out a JSON object...
    BEGIN
      htp.p(wwv_flow.g_widget_num_return||'(');
      munky_extjs.grid_json(p_app_id => wwv_flow.g_x01,
                        p_app_page_id => wwv_flow.g_x02,
                        p_region_id => TO_NUMBER(wwv_flow.g_x03),
                        p_start => NVL(wwv_flow.g_x04,0),
                        p_limit => NVL(wwv_flow.g_x05,10),
                        p_sort => wwv_flow.g_x06,
                        p_dir => wwv_flow.g_x07);
      htp.p(')');
    END;I think your use of analytics in the inner query may be slowing you down if you have a lot of data?
    Cheers
    Ben

  • Connecting a report region and a PL/SQL region

    Hi,
    I have created a report region whith pagination that only show 1 row at a time. I can then navigate backwards and forwards through this recordset. The first reportcolum in this recordset contains a number.
    I have also, on the same page, created a PL/SQL procedure region. What I want is to use the number from the SQL region as an input to the PL/SQL region. So when I navigate through the report (Using the pagination arrows), the PL/SQL region is in sync with the record I'm currently seeing in the report.
    Is this possible or do I have to try something different?
    Regards
    Trond

    Hi Trond,
    If you only want to show one record in your first region, it might be best to work with page items, retrieve one record at a time and use that data as the source for your page items. It's easier to implement and easier to reference those values in your second region. Reports are great if you have more then one record.
    Having said that, there are ways to implement it the way you outlined it in your posting. Granted it's not very elegant but it serves its purpose. You could write your own PL/SQL package, use this to set a global to the current row's primary key value and reference that global in your second region.
    Create your package as follows:
    create or replace package md_sample as
    g_pk_value number;
    function set_value(p_value number) return number;
    end;
    create or replace package body md_sample as
    function set_value(p_value in number) return number is
    begin
    g_pk_value := p_value;
    return 1;
    end;
    end;
    Now you need to make sure that your report calls this package appropriately. Calling this as part of your SQL statement won't work properly as it would also be called for records not currently shown on your page. A better way would be to use it for a PL/SQL expression within your report template definition. Pick a custom report template for your report and edit that template. Scroll down to the condition for the first column template and pick “Use Based on PL/SQL Expression”. Then type in the following expression (this is based on a select deptno, dname, loc from dept report):
    md_sample.set_value(#DEPTNO#)=1
    After that you'll be able to reference the global md_sample.g_pk_value. You could e.g. use this as the source for page items shown in your second region.
    Hope this helps,
    Marc

  • How can I decouple the pagination for a global region?

    I was having a delightful time using a common region defined on a global page when I determined that pagination setting was begin carried from one page to the next.  Arghhhh!  So for example, if I have paged to the second set (page) of rows (11-20) on Page 1 and then I go to Page 2, the second set (page) of rows (11-20) is displayed there.   If I go to a page which only has a first set of rows (1-10), I get the pagination error "Invalid set of rows requested, the source data of the report has been modified. Reset Pagination".  And when I click to reset, it just repeats the error.  [I suppose it tries to display the second set or rows (11-20) again -- which doesn't exist.  What's that saying about insanity?]  
    How can I decouple the pagination for a global region? I want it to operarate just as it would if it were not sharing a common region.  So if I'm looking at rows (11-20) on page 1, I can go to any other page beginning with rows 1-10 there.  Then return to page 1 where I left off with rows 11-20 displayed.  One solution is NOT to paginate but that's not my preferred solution.
    Howard

    Howard(...inTraining) wrote:
    I was having a delightful time using a common region defined on a global page when I determined that pagination setting was begin carried from one page to the next.  Arghhhh!  So for example, if I have paged to the second set (page) of rows (11-20) on Page 1 and then I go to Page 2, the second set (page) of rows (11-20) is displayed there.   If I go to a page which only has a first set of rows (1-10), I get the pagination error "Invalid set of rows requested, the source data of the report has been modified. Reset Pagination".
    The fact that there are different numbers of rows returned on different pages implies that the reports have some local page dependencies, so why try to use a global component? What's the actual requirement? How many pages does the report have to appear on? (Please say it is a report and not a tabular form...)
    How can I decouple the pagination for a global region? I want it to operarate just as it would if it were not sharing a common region.
    The point is that a global region is just that: a single region that happens to be displayed on multiple pages. It does not create multiple instances of a region on different pages. (Specifically, a region has a single region ID, and this is used to reference it whether it appears on one page or all of them. The region ID is used by the report for the purposes of AJAX refresh, pagination etc.)
    A similar situation was discussed a long time ago. I'm rather surprised that Scott regarded it as a bug: the fact that it doesn't seem to have been "fixed" or have a bug number attached may indicate that the others on the APEX team disagreed with him? I haven't tried the workaround he suggested, however I don't think it's likely to be prove a useful line of attack for your issue, as (1) it resets pagination rather than preserving it; and (2) it doesn't appear to be compatible with the AJAX PPR pagination used in more recent versions of APEX.
    I can't see any straightforward "solution" (largely because I don't think there's really a problem: the exhibited behaviour is exactly how I expect/want global regions to behave). Pagination processing is undocumented. The current 4.2 apex.widget.report.paginate JS method is specifically annotated as "for internal use only". Search the forum for custom pagination techniques. Messy looking hacks for IRs have previously been suggested.
    So if I'm looking at rows (11-20) on page 1, I can go to any other page beginning with rows 1-10 there.  Then return to page 1 where I left off with rows 11-20 displayed.  One solution is NOT to paginate but that's not my preferred solution.
    Assuming that there aren't too many pages involved, the other obvious option is to create unique regions on the required pages. You can achieve some level of reusability by creating SQL Query (PL/SQL function body returning SQL query) reports based on an external function so that there's only a single SQL source to be maintained.
    Explain the requirement in more detail. Pagination is not the only option for reducing the quantity of displayed information. Often it's better to display some of all of the data, rather than all of some of it...

  • Render Dynamic PL/SQL region as PDF?

    Hi!
    I would like to be able to render a Dynamic PL/SQL region as a PDF. Anybody have an idea how to do this or even if it can be done? This is not a report region.
    Also any idea's on how I might do pagination in a dynamic PL/SQL region?
    Any hope that a future version of APEX will accept lines from a PL/SQL function (including anonymous ones) as the source of a report region? It would need to preserve blank lines. Currently only select statements are valid for generating APEX reports.
    Thanks in advance for your help!
    Dave Venus

    Scott,
    This is what is what debug mode puts out just before it issues the data not found error:
    0.07: ...Process "create collection": PLSQL (ON_SUBMIT_BEFORE_COMPUTATION) -- -- Create Collections -- -- declare la_cks apex_application_global.vc_arr2; begin if apex_application.g_f19.count > 0 then -- wwv_flow.debug('count gt 0 for checksum'); la_cks := apex_application.g_f19; else
    0.09: Encountered unhandled exception in process type PLSQL
    0.09: Show ERROR page...
    0.09: Performing rollback...
    I was hoping that the wwv_flow.debug statements would help me figure out where the error was occurring, but they did not produce anything so I commented them out. One thing that might be useful is that when I am not in debug mode and I click the OK link after the Oracle error message, the repainted screen still has the checkboxes that have been marked so I am guessing the error handler can see the data that I put into the .g_fnn arrays within my pl/sql region code.
    In other tabular forms within the same application, the create collection code starts the same way and I do not have any problems.
    One of the tests I did this morning was to replace my reference to the fcs array with f19 just in case there was something special being done for checksums, but the change had no effect.
    thanks,
    Peter

  • Problem with "PL/SQL Dynamic Content" and displaying rows

    hi,
    im new to APEX, and pl/sql [but not web dev or sql].
    ive found the bit in APEX that lets you add data from your DB using the 'CREATE' > 'PL/SQL Dynamic Content'.
    maybe there's a better option for people who dont know pl/sql? i dont know?
    however, i think i can getting working with a little bit of help but im stumbling around in the dark a bit here.
    ok so this is the pl/sql ive come up with to show three example values on page 23 of my aplplication:
    BEGIN
    SELECT ID, NAME, OWNER
    FROM COM_MAILSHOTS
    INTO :P23_ID, :P23_NAME, :P23_OWNER;
    END;
    im getting the error:
    1 error has occurred 
    ORA-06550: line 5, column 21: PL/SQL: ORA-00933: SQL command not properly ended ORA-06550: line 4, column 1: PL/SQL: SQL Statement ignored
    thanks for reading!

    Metabaron wrote:
    hi,
    im new to APEX, and pl/sql [but not web dev or sql].
    ive found the bit in APEX that lets you add data from your DB using the 'CREATE' > 'PL/SQL Dynamic Content'.
    maybe there's a better option for people who dont know pl/sql? i dont know?
    The easiest (and best) way to "display rows" is using a report. Dynamic PL/SQL regions are more complex and are required much less frequently.
    The Oracle® Database 2 Day + Application Express Developer's Guide tutorial explains how to create reports and other basic APEX techniques.

  • Create a report with PL/SQL

    Hi,
    I have two pages: the first page contains two text fields and a submit button. In the first text field you can enter a name and in the second field you can enter a number. That means you can search a record by name or by number.
    In the second page the report is generated depending on the used text field of the first page.
    I tried to to define a region source code with PL/SQL for the report, but nothing appears on the report page although the record I was looking for exists in the database.
    begin
    if :ENTERNAME IS NOT NULL then
    FOR item IN (select "TB_PERSON_INSTITUTION"."PI_ID" as "PI_ID",
    "TB_PERSON_INSTITUTION"."PI_NAME" as "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" as "PI_VORNAME",
    from     "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    where      upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:ENTERNAME||'%'))
    loop
    DBMS_OUTPUT.PUT_LINE('First name = ' || item.PI_NAME ||
    ', Last name = ' || item.PI_VORNAME);
    end loop;
    end if;
    end;
    Regards
    Mark

    Hi,
    ok thanks. I tried to use the SQL-Report with type "SQL Query (PL/SQL function body returning SQL-Query)" and made a few changes in the SQL-Statement so that a second table is also included:
    declare My_select varchar2(500);
    begin
    if :TEXTEINGABENAME IS NOT NULL then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:TEXTEINGABENAME||"%")';
    else
    if :TEXTMITGLIEDSNUMMER is not null then
    My_select:='SELECT
    "TB_ADRESSE"."A_PLZ" "A_PLZ",
    "TB_ADRESSE"."A_ORT" "A_ORT",
    "TB_ADRESSE"."A_ID" "A_ID",
    "TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
    "TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
    "TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
    "TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
    "TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
    FROM
    "TB_ADRESSE" "TB_ADRESSE",
    "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
    WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
    AND upper("TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER") like upper(:TEXTMITGLIEDSNUMMER||"%")';
    end if;
    end if;
    return My_select;
    end;
    When I try to apply changes an error message occurs:
    "Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
    Regards,
    Mark

  • Have an ajax memory tree in a pl/sql region be rendered only once in a page

    Hi all,
    I have a pl/sql region with region source calling a function "ajax_memory_tree.render". Everytime I come back to this particular page, I am having a tree being rendered. Can you give any suggestion as to how I can have only one tree. Thank you for your help/ideas.
    regards,
    Suma.

    procedure render_branch
      (p_type in varchar2, p_icon in varchar2, p_class in varchar2, p_id in number, p_pid in number, p_name in varchar2)
    is
    x varchar2(1000);
    y varchar2(2000);
    begin
    -- If the branch has sub nodes, render it with a +/- sign
    if p_type = 'exp' then
        htp.prn('&lt;li style="vertical-align:right;">&lt;img style="cursor:pointer;margin-right:15px;"
             src="/i/' || p_icon || '.gif" onClick="getTreeNode(this,''' || p_id || ''')" />
       &lt;a class="' || p_class || '" href="f?p=' ||
       v('APP_ID') || ':1:' || v('APP_SESSION') || '::::P1_SELECTED_NODE:' || p_id || '">' || p_name ||
       '&lt;/a>&lt;/span>&lt;/li>');
    -- Otherwise, just render the item
    else
    if p_id = 5000 then
        select opt_path into x from e_navopts where opt_num = p_id and popt_num = p_pid
        and userid = v('APP_USER');
            htp.prn('&lt;li style="vertical-align:right;margin-left:15px;">&lt;img src="/i/wwv_bullet.gif" style="padding-right:8px;"/>&lt;a
      class="' || p_class || '" href="'||x || v('APP_SESSION')|| '::::'||
      '">' || p_name ||'&lt;/a>&lt;/span>&lt;/li>');
    elsif  p_id = 3000 then
        select opt_path into x from e_navopts where opt_num = p_id and popt_num = p_pid
        and userid = v('APP_USER');
        select opt_params into y from e_navopts where opt_num = p_id and popt_num = p_pid
        and userid = v('APP_USER');
           htp.prn('&lt;li style="vertical-align:right;margin-left:15px;">&lt;img src="/i/wwv_bullet.gif" style="padding-right:8px;"/>&lt;a
      class="' || p_class || '" href="'||x || v('APP_SESSION')|| '::::'||
      '">' || p_name ||'&lt;/a>&lt;/span>&lt;/li>');
    else
      htp.prn('&lt;li style="vertical-align:right;margin-left:15px;">&lt;img src="/i/wwv_bullet.gif" style="padding-right:8px;"/>&lt;a
      class="' || p_class || '" href="f?p=' || v('APP_ID') || ':1:' || v('APP_SESSION') ||
      '::::P1_SELECTED_NODE:' || p_id || '">' || p_name || '&lt;/a>&lt;/span>&lt;/li>');
        end if;
    end if;
    end render_branch;

  • Azure remote App with Azure SQL Backend

    Hi, If I had an application which utilised a SQL backend could I host the front end in Azure remote app and the backend on an Azure SQL database or would I need to use IAAS to provide the backend?
    Many thanks
    James 

    Hi James,
    If the application is designed to be compatible with Azure SQL Database then yes, you can use Azure RemoteApp for the frontend and Azure SQL Database for the backend.  If the application is not compatible with Azure SQL Database then you would
    need to use SQL Server running in an IaaS VM, or SQL Server running in an on-premises VM.  The IaaS VM or SQL Database should be in the same Azure region as the RemoteApp collection in order to minimize latency.
    For example, say you have an internally-developed application that uses SQL Server 2012 as its backend database.  Before you would be able to use Azure SQL Database you would first need to migrate the database to Azure SQL Database and make any changes
    necessary to the application and/or database for compatibility.  The SQL Database Migration Wizard is helpful for this process.
    -TP

  • Sorry-duplicate thread,since problem in forumby5.45pm pl/sql region in apex

    Hi All,
    From sqlworkshop,
    I have created a view like
    CREATE OR REPLACE FORCE VIEW VW_SUB_CL_ADD1 AS
    (select a.siteid siteid,a.bpaadd_0 bpaadd_0,a.bpanum_0 bpanum_0,
    case when a.bpaaddlig_0 = '' then '-' else a.bpaaddlig_0 end address1,
    case when a.bpaaddlig_1 = '' then '-' else a.bpaaddlig_1 end address2,
    case when a.bpaaddlig_2 = '' then '-' else a.bpaaddlig_2 end address3,
    case when a.bpades_0 = '' then '-' else a.bpades_0 end place,
    case when a.cty_0 = '' then '-' else a.cty_0 end city,
    case when a.poscod_0 = '' then '-' else a.poscod_0 end pincode,
    case when b.cntnam_0 = '' then '-' else b.cntnam_0 end contactname,
    case when b.fax_0 = '' then '-' else b.fax_0 end fax,
    case when b.MOBTEL_0 = '' then '-' else b.MOBTEL_0 end mobile,
    case when b.TEL_0 = '' then '-' else b.TEL_0 end phone,
    case when b.web_0 = '' then '-' else b.web_0 end website,
    c.zinvcty_0 zcity,c.bpainv_0 bpainv_0,c.bpcnum_0 bpcnum_0
    from lbcreport.bpaddress@info a,lbcreport.contact@info b ,lbcreport.bpcustomer@info c
    where (a.bpanum_0=b.bpanum_0) and (a.cty_0 = c.zinvcty_0) and (a.siteid = c.siteid))
    but when i execute select * from vw_sub_cl_add1
    the case is not working. '-' is not getting displayed for null values even i tried nvl function it is not working
    when i use this view in apex for pl/sql region to display in the form of table .
    The problem is, when there is no value in the columns the table is not showing row and column in a proper manner.
    could any one help to overcome it.
    Thanks in advance
    bye
    Srikavi
    Edited by: srikavi on Sep 10, 2008 10:42 AM

    Srikavi,
    1. The problem with null values is a template problem. Using Firefox and Web Developer Toolbar extension / CSS / View Style Information, you can find out which css class your report is referencing. Open the corresponding css file and add the following to the css class:
    empty-cells:show;border-collapse:collapse;
    It will show the borders for null values after that.
    2. b.fax_0 = '' is not correct. It should be b.fax_0 IS NULL.
    3. You can also try to use the built in property for showing NULL values as in the report attributes.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Pl/sql region in apex

    Hi All,
    From sqlworkshop,
    I have created a view like
    CREATE OR REPLACE FORCE VIEW VW_SUB_CL_ADD1 AS
    (select a.siteid siteid,a.bpaadd_0 bpaadd_0,a.bpanum_0 bpanum_0,
    case when a.bpaaddlig_0 = '' then '-' else a.bpaaddlig_0 end address1,
    case when a.bpaaddlig_1 = '' then '-' else a.bpaaddlig_1 end address2,
    case when a.bpaaddlig_2 = '' then '-' else a.bpaaddlig_2 end address3,
    case when a.bpades_0 = '' then '-' else a.bpades_0 end place,
    case when a.cty_0 = '' then '-' else a.cty_0 end city,
    case when a.poscod_0 = '' then '-' else a.poscod_0 end pincode,
    case when b.cntnam_0 = '' then '-' else b.cntnam_0 end contactname,
    case when b.fax_0 = '' then '-' else b.fax_0 end fax,
    case when b.MOBTEL_0 = '' then '-' else b.MOBTEL_0 end mobile,
    case when b.TEL_0 = '' then '-' else b.TEL_0 end phone,
    case when b.web_0 = '' then '-' else b.web_0 end website,
    c.zinvcty_0 zcity,c.bpainv_0 bpainv_0,c.bpcnum_0 bpcnum_0
    from lbcreport.bpaddress@info a,lbcreport.contact@info b ,lbcreport.bpcustomer@info c
    where (a.bpanum_0=b.bpanum_0) and (a.cty_0 = c.zinvcty_0) and (a.siteid = c.siteid))
    but when i execute select * from vw_sub_cl_add1
    the case is not working. '-' is not getting displayed for null values even i tried nvl function it is not working
    when i use this view in apex for pl/sql region to display in the form of table .
    The problem is, when there is no value in the columns the table is not showing row and column in a proper manner.
    could any one help to overcome it.
    Thanks in advance
    bye
    Srikavi

    Hi Srikavi,
    From your statement, it looks as though you are retrieving data from an external datasource? I have had a similar problem - it's due to the ODBC driver not recognizing nulls properly. In the end, I had to do something like:
    case when xxx is null then '-' when xxx = ' ' then '-' when xxx = '' then '-' else xxx end xxxxx,
    ...This particularly happens with MS SQL databases and especially when their tables use char instead of varchar fields. The MSSQL table treats "empty" char fields as nulls but the ODBC driver doesn't - so the IS NULL value won't work on Oracle's side and the '' comparison won't always work on MS SQL side; hence having to check for all possibilities. The above may be overkill, but it did the job!
    Andy

  • How to process a form created in a pl/sql region

    Hi:
    I have a form that is generated using pl/sql and this form is displayed on a page in a 'pl/sql' region. The form displays a 'Submit' button which upon being clicked should return the user to the same page but with the contents of the form updated etc etc. What should I set the form's 'Action' attribute to for this to happen ? Is it possible for 'post-submit' processes to be specified for such a form ?
    Thanks !

    Vikas:
    The form is the product of converting a VB based application to pl/sql. The VB app. is a sort of a dynamic form generator. The form elements (what elements a form is made up of) are stored in a database. For the purpose of illustration we can assume that the application is a survey application and the VB code generates the required survey form depending on the user requesting the form, the survey being requested etc. The questions/answers and the HTML element that will be used to render the question/answer are stored in the database as mentioned previously.
    I adopted what I thought was the easiest method to convert this application into an APEX app. This method ofcourse being converting the VB to PL/SQL and then using the pl/sql Web Tool kit to generate a PL/SQL region on an APEX page.
    Now, based on your comments it appears to me that I may have started off on the wrong track !

  • Htp.p not rendering correctly in Apex PL/SQL region

    I'm using Apex 3.0.1 and have an application that merges data with an email template. I have a mailing list review function that allows you to preview any of the emails. This works by calling a packaged merge function in a PL/SQL region as in:
    htp.p (package.merge_function (p1 => 1, p2 => 2, p3 => 3));
    The "merge_function" returns a CLOB which contains the complete HTML message.
    The problem is this: when the email is sent and received it looks fine, but when previewed as above the font size changes in the HTML are not recognised. The other attributes, e.g. colour and font face are OK. I am more experienced with PL/SQL than with HTML so any help would be appreciated.

    Rick,
    The CSS files that APEX uses set some default font settings for all regions. Unless overridden, these default settings will be applied to most everything on the page.
    If you're going to use an htp.p() to put some text on the page, you may want to consider wrapping the entire output of htp.p with a DIV tag.
    For instance:
    htp.p('&lt;div style="font-size:12px;"&gt;' || your_contents || '&lt;/div&gt;');Hope that helps!
    - Scott -

  • [SOLVED] Shuttle in PL SQL region (Apex 3.2)

    Hi OTN,
    Is there an option of creating shuttle element in PL SQL region?
    I need to have a dynamic number of those elements on my page.
    I have copied HTML code of a static apex shuttle (with Never condition) on this page, but no double clicks or buttons [<<] [>>] are working.
    Could someone help me cope with the problem?
    Thanks.
    Solved. Should have copied <field> and <script> after right select list also.
    Edited by: ILya Cyclone on Feb 18, 2011 2:26 PM

    You won't get a no-data-found exception in a cursor loop like that. You can do something like this:declare
      l_found boolean := false;
    begin
      for c in (select 1 from dual where 1=2) loop
        htp.p('never print this');
        l_found := true;
      end loop;
      if not l_found then
        htp.p('no rows selected in cursor loop');
      end if;
    end;Scott

Maybe you are looking for