Using APEX_ITEM in pl/sql region

 

this is the apex pl/sql region code and the page process, when the page is submitted the process fires but doe snot recognize any of the apex application global arrays???
{DECLARE
CURSOR get_bank IS
select C.form, C.form_description, C.form_details
from form C
where C.form_type = 'P' and
NOT EXISTS
(select ''
from sis_user_portlet D
where D.fk_sis_user_roles = :P0_LOGIN_ROLE and
D.portlet_id = C.form)
order by 2;
BEGIN
htp.tableOpen(cattributes=>'width="100%" border="0" cellspacing="0" cellpadding="2"');
htp.tableRowOpen;
htp.p('<td align="center" width="100%">');
htp.p('<div class="WidgetBank">');
FOR x in get_bank LOOP
htp.p('<td nowrap>');
htp.p('<div id="' || x.form || '" class="bank" ondblclick="moveToDashboard(this.id,this.className);" onmouseup="setPosition(this.id,this.className);">');
htp.p(x.form_description);
htp.p('<span id="'||x.form||'_span" style="display:none;">');
htp.tableOpen;
htp.tableRowOpen;
htp.p('<td>');
htp.p(APEX_ITEM.HIDDEN(P_IDX =>1,
p_value =>'test',
p_attributes =>'id="'||x.form||'_form"'));
htp.p(APEX_ITEM.HIDDEN(P_IDX =>2,
p_value =>'',
p_attributes =>'id="'||x.form||'_x"'));
htp.p(APEX_ITEM.HIDDEN(P_IDX =>3,
p_value =>'',
p_attributes =>'id="'||x.form||'_y"'));
htp.p('Height:');
htp.p(APEX_ITEM.TEXT(P_IDX =>4,
p_value =>'',
p_size =>5,
p_maxlength =>4,
p_attributes =>'id="'||x.form||'_height"
onChange="setHeight(this.value,'||''''||x.form||''''||');"'));
htp.p('</td>');
htp.tableRowClose;
htp.tableRowOpen;
htp.p('<td>');
htp.p('Width:');
htp.p(APEX_ITEM.TEXT(P_IDX =>5,
p_value =>'',
p_size =>5,
p_maxlength =>4,
p_attributes =>'id="'||x.form||'_width"
onChange="setWidth(this.value,'||''''||x.form||''''||');"'));
htp.p('</td>');
htp.tableRowClose;
htp.tableClose;
htp.p('</span>');
htp.p('</div>');
htp.p('</td>');
END LOOP;
htp.p('</div>');
htp.p('</td>');
htp.tableRowClose;
htp.tableClose;
END;
DECLARE
l_portlet_id sis_user_portlet.portlet_name%TYPE;
l_x_position sis_user_portlet.x_position%TYPE;
l_y_position sis_user_portlet.y_position%TYPE;
l_width sis_user_portlet.width%TYPE;
l_height sis_user_portlet.height%TYPE;
get_pk sis_user_portlet.pk_id%TYPE;
BEGIN
FOR i in 1 .. wwv_flow.g_f01.COUNT LOOP
--if apex_application.g_f01(i) is not null then null;
get_pk := sis_express.get_sys_guid();
l_portlet_id := wwv_flow.g_f01(i);
l_x_position := wwv_flow.g_f02(i);
l_y_position := wwv_flow.g_f03(i);
l_height := wwv_flow.g_f04(i);
l_width := wwv_flow.g_f05(i);
insert into sis_user_portlet (pk_id, fk_sis_user_roles, portlet_id,
x_position, y_position, width, height)
values (get_pk, :P0_LOGIN_ROLE, l_portlet_id,
l_x_position, l_y_position, l_width, l_height);
--end if;
END LOOP;
commit;
END;}
Edited by: [email protected] on Nov 11, 2009 3:22 PM
Edited by: [email protected] on Nov 11, 2009 3:23 PM

Similar Messages

  • Ajax Autocomplete Tabular does not work using apex_item.text in SQL Query.

    Hello,
    Is it possible to use the search function which is used in, Dennis Kubicek example, ENAME topic Ajax Autocomplete Tabular
    in a sql query using apex_items?
    Query line :
    , apex_item.text(17,xp.part_nr,null,null,'onfocus="f_register(this);" autocomplete="off"') PART
    At first I followed the example by adding 'onfocus="f_register(this);" autocomplete="off" in the element attributes in the report field.
    This didn't work... so tried to add the it in the attirbutes parameter of the apex_item.
    But this still doesn't work. No errors are given, it does not respond.
    Could somebody please help me?
    Thx!
    Astrid

    Well, I'm trying to take this one step further, but I seem to be having some difficulty.
    I'm trying to make a Filter screen to create a dynamic where clause filter screen.
    This is a page I made with Popup LOVS, just to show you my goal (now trying to use autofilters)
    http://apex.oracle.com/pls/otn/f?p=29989:5
    I have a table on my system that tells you where the field is, and I'm using that to get the table (didn't want to change the javascript, so I pass in a static value).
    This is the javascript code I used
    <pre>
    <script language="JavaScript" type="text/javascript">
    function f_register(p_this,p_name)
    var p_registered = $x('P5_ITEM_ID').value;
         var p_this_name = $x(p_this).id;
    //alert(p_this_name);
    if (p_registered != p_this_name)
    register(p_this_name, "COSTING_M", p_name, "blue", "red");
    $x('P5_ITEM_ID').value = p_this_name;
    </script>
    </pre>
    This is my query
    <pre>
    select column_name || apex_item.hidden(1,column_name) Col_name,
    apex_item.SELECT_LIST_FROM_lov(2,'=','OPERATOR') OPERATOR,
    apex_item.text (3,
    NULL,
    20,
    200,
    'onfocus="f_register(this,''' || column_name || ''');" autocomplete="off"',
    'f3_' || '#ROWNUM#',
    NULL
    ) value,column_id
    from user_tab_cols
    where table_name = 'COSTING_M'
    ORDER BY ROWNUM
    </pre>
    and here is my on-demand process
    <pre>
    declare
    TYPE CurTyp IS REF CURSOR;
    v_row varchar2(4000);
    rec CurTyp;
    V_TABLENAME NKW.UTFIELD_M.TABLE_NAME%TYPE;
    begin
    BEGIN
    SELECT TABLENAME INTO V_TABLENAME
    FROM NKW.UTFIELD_M
    WHERE FIELD_NAME = :TF_SL_COLUMN;
    EXCEPTION WHEN NO_DATA_FOUND THEN RETURN; END;
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&amp;','&');
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&lt;','<');
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&gt;','>');
    :TF_SL_SEARCH := replace(:TF_SL_SEARCH, '&quot;','"');
    owa_util.mime_header('text/xml', FALSE);
    htp.p('Cache-Control: no-cache');
    htp.p('Pragma: no-cache');
    owa_util.http_header_close;
    htp.prn('<rowset>');
    open rec for
    'select distinct ' || :TF_SL_COLUMN || ' ' ||
    'from NKW.' || V_TABLE_NAME || ' ' ||
    'where '||:TF_SL_COLUMN||' like :1||''%'' ' ||
    'and rownum < 100 ' ||
    'order by '||:TF_SL_COLUMN
    using :TF_SL_SEARCH;
    loop
    fetch rec into v_row;
    exit when rec%NOTFOUND;
    htp.prn('<row>' || htf.escape_sc(v_row) || '</row>');
    end loop;
    htp.prn('</rowset>');
    end;
    </PRE>
    I made some slight mods to make the table dynamic from my source table (this is to grab master files when they exist and not to when they don't).
    I get my select list, but it's blank on all fields, any suggestions?
    thanks,
    Scott

  • 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

  • Calling an On Demand Process in PL/SQL Region without using AJAX

    Hi!
    I am trying to find a way to call an On demand Process in a PL/SQL Reports Region. The reason is that i need Reportings for about 20 Pages that look like the same but have different parameters. I already have some Processes that return SQL Statements and it works fine. But these Reportings are more complex and it's not possible to return it wirh a SQL Statement.
    I have seen some solutions in this forum that used AJAX to call such a process. The problem is, that I'm not allowed to use AJAX because activeX is diabled. I tried it and it works but i need another way to solve this process call.
    Thanks in advance
    Philipp

    At the moment I cannot say if your link can help. Right now the call of the On demand Process looks like this:
    Inside annonymous PL/SQL Region:
    <script type="text/javascript">
    get = new htmldb_Get(null,'||:APP_ID||'.,'APPLICATION_PROCESS=F_REPORT_NAME',0);
    gReturn = get.get();
    document.write(gReturn);
    </script>

  • Upload File using decode in SQL Region...Help

    I am trying to allow a user to see the file names of files attached to a row (ex., training certificates for training taken). If there is no training certificate attached, "None (Upload Certificate)" is shown in that column as html. I want the user to be able to upload the certificate, by clicking on that html. I'm getting "Error ERR-1002 Unable to find item ID for item "TRAINING_ID" in application "113". ", when clicking on the link.
    Here is my code:
    select
    A.TRAINING_ID,
    A.TRAINING_ID TRAINING_ID_DISPLAY,
    A.PERSONNEL_ID,
    A.COURSE_ID,
    A.DATE_COMPLETED,
    A.CERTIFICATE_ID,
    B.IMAGE_ID,
    decode(b.filename, null, htf.anchor('f?p=113:1090:'||:APP_SESSION||'::NO::PERSONNEL_ID,TRAINING_ID:'||A.PERSONNEL_ID||'%2C'||A.TRAINING_ID, 'None (Upload Certificate)'),
    ''||&B.FILENAME||'') as cert_file_name,
    B.IMAGE_ID DELETE_CERTIFICATE
    from TRAINING A, EASY_IMAGE B
    WHERE A.PERSONNEL_ID = :P2_PERSONNEL_ID
    AND (A.PERSONNEL_ID = B.PERSONNEL_ID (+)
    AND A.TRAINING_ID = B.TRAINING_ID (+))
    The only thing that doesn't seem to be working correctly, is when the filename is null, the parameter's being passed and calling of the upload form. I've tested this in another app, but not being passed in the SQL Region and in both cases the status line at the bottom match for the call, when passing the mouse over the link. One works fine , but the decoded one gives me the error above.
    Any Help/Direction would be GREATLY Appreciated.
    Thanks in Advance!
    Juanita Layne

    We Got it......
    We changed the decode to this..
    decode(b.filename, null, htf.anchor('https://rockhopper.hqcnsg.navy.mil/apex/f?p=102:1090:&SESSION.::NO::PERSONNEL_ID,TRAINING_ID:'||A.PERSONNEL_ID||','||A.TRAINING_ID||':','None (Upload Certificate)'), ''||&B.FILENAME||'') as cert_file_name,
    and our 2 items
    PERSONNEL_ID and TRAINING_ID were setup as Database Items. We changed them to Static Assignments and passed #PERSONNEL_ID# and #TRAINING_ID# to those items respectively. It worked perfectly after that.
    Maybe that will help someone else.
    Thanks,
    Juanita

  • PL/SQL Region : Getting values from PL/SQL generated form?  (APEX 2.2.0)

    Hi, all,
    If I've got an PL/SQL region that dynamically generates a form using HTMLDB_ITEM.TEXTAREA, what is the best way to get the contents of those form data at submit time?
    Thanks,
    Don
    Message was edited by:
    Don_84
    Edited for clarity.

    Don,
    The apex_item (nee htmldb_item) functions take an index number as a parameter. So if you give the textarea function p_idx=>1, it creates item f01. If you give it p_idx=>2, it creates item f02, etc. In your after-submit code, access the package variable apex_application.g_fxx where xx is the index number you used.
    Scott

  • Exception when using apex_item.select_list_from_lov

    I have a query where I want to use a select list to enable the user to change the value of an attribute. However, when i try using apex_item.select_list_from_lov or apex_item.select_list_from_query I get an exception. My report region shows ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    I tried querying a smaller table, and then it works. Is there a size limit for select_list_from_query and select_list_from_lov? And if so, what is it? The list of values and the query works fine when using them in select list items (in a form). It also works fine when using apex_item.popup_from_lov.
    Camilla

    Camilla,
    Those functions return a varchar2 value so you are limited to 4000 characters for a column of that type selected in SQL. You can use the select_list_from_query_xl or select_list_from_lov_xl, which return a CLOB. In any case the size of the HTML generated for the row must be less than 32K.
    Scott

  • Help in using APEX_ITEM.RADIOGROUP!

    Hi frenz,
    I have 4 rows in the table employees,and the rows changes dynamically as the user keeps adding the users.I also have a Grade table where Grades named A B and C are stored.My requirement is,In the UI when i display the employees,each row of employee should display the grades acoordingly in the same row
    say
    output on the screen should be
    Jeffry radiobutton1 A radiobutton2 B radiobutton3 C
    Jessica radiobutton1 A radiobutton2 B radiobutton3 C
    Eliza radiobutton1 A radiobutton2 B radiobutton3 C
    Joe radiobutton1 A radiobutton2 B radiobutton3 C
    can anyone help me hw to do this?
    I'm using
    APEX version - 4.0.0.00.46
    DB version and edition - 10.2.0.1.0
    Web server architecture - APEX listener
    Browser - IE
    Theme -20
    Thanks in advance

    Already my page(pl/sql) has a region souce
    DECLARE
    cursor itemCur is
    select CATEGORY_ID,
    PARAMETER_ID,
    PARAMETER_VALUE,
    MAX_MARK,
    IS_ACTIVE,
    ID,
    TEST_NUMBER from MES_CATEGORY_PARAMETERS;
    BEGIN
    htp.p('<table>');
    htp.p('<tr>');
    for aRow in itemCur
    LOOP
    htp.p('<tr>');
    htp.p('<td>'||APEX_ITEM.hidden(1,aRow.PARAMETER_ID)||aRow.PARAMETER_VALUE||'</td>');
    htp.p('</tr>');
    END LOOP;
    htp.p('</tr></table>');
    END;This displayes me 12 parameters on the page
    My page luks like dis,,
    Parmeters
    The names of all classes should start with upper case letters
    The names of all members of classes should start with lower case letters
    The names of all local variables and parameters should start with lower case letters
    All the names should be in camel case format
    The names of all constants should be in upper case
    All source code files (.java, .xml etc) should contain proper comments/javadocs
    The base exception class has been defined
    There is an abstraction in exceptions
    There is a funneling of exceptions across the layers
    The main flow has been developed as per the specifiations
    The exception and alternate flows have been developed as per the specifiations
    The business rules and data validations have been devleloped as per the specifiations
    Check the variable names
    Now i have grades A,B,C in my grades table.and I want to display the grades for each of the parameter row so that user can rate the parameter by selecting grades.radio button along with grades should get displayed beside the parameter.Can I achieve this using APEX_ITEM.RADIOGROUP?How?
    Thanks

  • 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

  • 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 !

  • 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 &lt; :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 &gt; :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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • APEX: Store Values of fields which are created dynamically(Using APEX_ITEM)

    Hello All,
    I am creating one application in which i create one report with dynamic fields(using APEX_ITEM Package) and non-dynamic fields(Taking from table). Now i want to store the value of the dynamic fields into table. So please help me on that.
    I want to store value of APEX_ITEM.TEXT fields in a table, but i don't have names of it so how to store value in table?
    select APEX_ITEM.CHECKBOX2(1,HC.S_ID) "SELECT",
    HC.ACT_NAME,HC.REBOOT_DATE,
    APEX_ITEM.TEXT(2,00) "Start Time",
    APEX_ITEM.TEXT(3,00) "End Time",
    APEX_ITEM.TEXTAREA(4,'Enter Remarks',2,40) "Remarks" FROM HWC_CHK_SCHEDUELE HC;
    Thanks,
    Jiten

    Let me clarify a finer point. The APEX_ITEM API provides for value , which can come from a table.
    You need to add APEX_ITEM to your columns selected from the table as well.
    Once you have done that then the p_idx value , the first numeric, in the APEX_ITEM, is accessing in DOM as well as PL/SQL.
    In DOM, for JavaScritps, the p_idx 1 becomes f01, 2 becomes f02 ,etc.
    In PLSQL the same are APEX_APPLICATION.G_F01, APEX_APPLICATION.G_F02, etc.
    Hope that explains what you need to do.
    select APEX_ITEM.CHECKBOX2(1,HC.S_ID) "SELECT",
    APEX_ITEM.TEXT(2,HC.ACT_NAME) "ACT_NAME",
    APEX_ITEM.DATE_POPUP(3,HC.REBOOT_DATE) "REBOOT_DATE",
    APEX_ITEM.DATE_POPUP(4,SYSDATE) "Start Time",
    APEX_ITEM.DATE_POPUP(5,SYSDATE) "End Time",
    APEX_ITEM.TEXTAREA(4,'Enter Remarks',2,40) "Remarks"
    FROM HWC_CHK_SCHEDUELE HC  /* no semi colon in SQL; */In the OnSubmit process
    FOR I IN APEX_APPLICATION.G_F02.COUNT LOOP
      -- LOGIC HERE.
    END LOOP;Note I have not used Check box F01 in the above code. Look up the documentation for checkbox in Referencing Arrays. Checkbox behaves different as compared to other item types.
    BTW, why are you not using Tabular form for this?
    Regards,
    Edited by: Prabodh on May 9, 2012 5:32 PM

  • Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

    I'm trying to migrate a Sql Server 2k database to an Oracle 8i schema using OMWB. After using BCP to collect metadata information on the source database, I tried to capture the source data model and got a "Capture aborted" message on the progress screen (even though then it appears a dialog window reporting "0 errors and 0 warnings", funny!). Down there is the error log OMWB generated. After reading some posts, I changed some columns of the OMWB dictionary that holds the source database name, but still got the same error. If someone can enlighten me on this toppic, I'd greatly appreciated it.
    Here's the error log of OMWB:
    ** Oracle Migration Workbench
    ** Production
    ** ( Build 20050629 )
    ** OMWB_HOME: D:\Datos\Download\Oracle\Oracle Migration Workbench\omwb
    ** user language: es
    ** user region: null
    ** user timezone:
    ** file encoding: Cp1252
    ** java version: 1.4.2_04
    ** java vendor: Sun Microsystems Inc.
    ** o.s. arch: x86
    ** o.s. name: Windows 2000
    ** o.s. version: 5.0
    ** Classpath:
    ..\lib\boot.jar
    ** Started : Fri Feb 23 17:18:48 GMT-03:00 2007
    ** Workbench Repository : Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    With the Partitioning option
    JServer Release 8.1.6.0.0 - Production
    Repository Connection URL: jdbc:oracle:thin:@ServerCms:1521:sigcewbc
    ** The following plugins are installed:
    ** Microsoft Access 2.0/95/97/2000/2002/2003 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 2000 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 6.5 Plugin, Production Release 10.1.0.4.0
    ** Microsoft SQLServer 7.0 Plugin, Production Release 10.1.0.4.0
    ** Active Plugin : SQLServer2K
    EXCEPTION :SQLServer2KDisconnSourceModelLoad.loadSourceModel(): oracle.mtg.migration.MigrationStopException: java.lang.IndexOutOfBoundsException: Index: 15, Size: 15
    ** Shutdown : Fri Feb 23 18:00:50 GMT-03:00 2007

    Duplicate thread
    Error when using Oracle Migration WorkBench (Sql Server 2k to Oracle 8i)

Maybe you are looking for

  • Windows 8.1 Custom Tiles - Deploying SCCM 2012 R2

    Confused. In Hyper V, I created a Windows 8.1 Enterprise image while in sysprep audit mode. I configured the tiles exactly how I wanted them. Captured the image and deployed.  When I login, the tiles are all set to default. Found a Microsoft site tha

  • COPA archiving

    Hi Experts I am having few questions regarding COPA archiving objects: 1. what are differences between archiving objects COPA1_xxxx and COPAA_xxxx, COPAB_xxxx. I have found the SAP recomendation that to use archiving object COPA1_xxxx is not recommen

  • Trying to email customers who have only placed one order.

    Im trying to create a report of my customers who have only placed one order in the past so I can create an email campaign. This will help me with customer retention. If any knows how I can create a report that will filter out customers who have place

  • Indesign CS6 start niet op op Dell optiplex (javascript.rpln error 1000)

    Wij rollen voor het onderwijs CS6 Webpremium uit. Nu start deze netjes op alle HP pc's die we hier hebben staan, maar op de Dell pc's loopt alleen Indesign CS6 vast bij starten met een Javascript.rpln error 1000. De pc's zijn met een identiek image u

  • Hibernate lazy loading with spring

    Has anyone been able to successfully implement the org.springframework.orm.hibernate3.support.PortletOpenSessionInViewInterceptor to enable hibernate lazy loading with page flows? Any examples would be helpful. Thanks