HTMLDB 1.6 / doSubmit issue

My original problem:
I have numerous instances where I have a form region at the top of the page, and then a report at the bottom of the page. For instance, the top of the page might be header information, and the bottom of the page detail information.
Within the report, I have buttons labelled Edit, View, etc. In the SQL I set them up as
SELECT STUFF, OTHER STUFF, null as VIEW_LINK, null as EDIT_LINK from...
Originally I set the buttons up to branch to another page, setting the primary key of the detail line on the new page.
The problem that arose is that when doing it this way, the original page is not submitted. So, if a user changes information in the form part of the page, and then clicks on a View/Edit button it redirects without submitting the current page.
OK, quick workaround:
I changed the buttons to each have a URL redirect, along the lines of this:
javascript: document.getElementById('some hidden element').value = #SEQ_ID#; doSubmit('EDIT_ROW');
Then, on the page I put a branch to my Edit/View detail page, setting the primary key on the target page to the value within the item in document.getElementById() above. It also clears the cache on the target page.
This seemed to work fine, submitted the current page, set the primary key value, and redirected to the Edit/View detail page successfully.
New Problem:
After going into production with this, I found out this works 99.5% of the time. 0.5% of the time there seems to be a timing issue, where the branch executes before the session state is fully saved. So, the branch sets the target primary key on the detail page to null instead of the value that is set in document.getElementById().
I logged a Service Request, and they suggested I post a sample on the Oracle APEX installation. I did, but, apparently in 2.x this does not work AT ALL! The value NEVER gets set correctly.
Finally, the technician on the Service Request suggested I post my questions here.
My current workaround:
On the target page, I check the value of the primary key. If it is null, I disable all actions and display an error message that says, basically, go back and try the same thing again.
My Questions:
1) What is an acceptable workaround within the context of my requirements (e.g. set a primary key value based on the row selected in the report, redirect to another page with that primary key, submit the current page) for 1.6?
2) What is an acceptable workaround in APEX 2.x?
Thank you in advance for any help you can provide!

Post a link to the application on apex.oracle.com. Sounds like this should work. Just to be sure, you could create a computation or process that sets the ID on the second page to the value submitted. Then your branch can just branch to the second page without needing to set anything. It is OK to repaginate, but don't clear the cache on page 2. If you need to clear the cache, clear it in your process before you set the ID.
This same method can be used if you need to pass two text values to the second page, but the first might contain a comma. If you submit the page and set the values in a computation or process, you don't have to pass the values on the url.
Anton

Similar Messages

  • Save confirm message appearing twice due to doSubmit behaviour

    I am using the IE onBeforeUnload event on the body tag to confirm whether the user really wishes to leave if there are changes made to the page. However, in circumstances where htmldb uses the doSubmit procedure (eg: when clicking a sub tab) the message appears twice. I found that this is because the the following statements in the doSubmit procedure
    flowSelectAll();
    and
    document.wwv_flow.submit();
    are both triggering the onBeforeUnload event for some reason. If I insert a flag in between these statements the problem is solved. However since doSubmit is a htmldb core javascript procedure, I dont want to modify it. Is there any other solution to the issue that anybody knows of? Please help....

    figured out that it was not because of the flowSelectAll() but the anchor tag of the page and the wwv_flow.submit() that causes the onBeforeUnload to fire twice. Anyway the problem at the core remains the same. If anybody knows of any way to tackle this problem without changing the doSubmit function, your help will be much appreciated. Thanks.

  • Connect to a different database

    Hi there,
    I have got a properly running HTML DB on a dedicated server and the database server is on another machine.
    And now I want to point this HTML DB installation to another database were HTML DB is also running properly . So I issued the command
    opmnctl stopall
    and then I did the modification within the tnsnames.ora for the alias HTMLDB.
    Then I issue
    opmnctl startall
    But the HTMLDB still connects to the old and not to new database that is referenced within the tnsnames.ora!
    So what am I doing wrong or is there another place where modifications have to be done?
    Thanks for help in advance!
    Regards,
    Christian

    Thanks for your reply, I have good idea about dblinks as i have been using dblinks with existing 8i and 9i servers. I have problem with 10g xe and application express.
    What i have made idea about these two until now is:-
    1. Oracle xe is a free database for developer and ISV's.
    2. Oracle application express is a tool for developing web based applications.
    3. Application express is installed and is configured with an existing installed 10g database.
    4. Free application express is also included with oracle express edition.
    5. Application express included with oracle xe is not fully featured. (like workspaces and options of new schemas).
    What i wanted to ask was, can i deploy web application with this free version of 10g i mean oracle ex ?, can i connect to other databases with the help of net service from this application express included with 10 ex.
    I am doing all this on my personal computer for testing the things (learning) not at the enterprise level, but my computer is part of network domain and i want to test all the features.
    Please help
    Regards

  • Issues after installing HTMLDB 2.0

    We installed HTMLDB 2.0. After install I am not able to create new regions any more. I am getting following error.
    ORA-06550: line 7, column 9: PLS-00103: Encountered the symbol "SELECT" when expecting one of the following: ( - + case mod new not null others avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe ORA-06550: line 8, column 46: PLS-00103: Encountered the symbol
    ERR-1904 Unable to compute item default: type = Function Body computation_type= declare
    r varchar2(255) := 'AFTER_SHOW_ITEMS';
    begin
    if nvl(:P4016_SOURCE_TYPE,'x') = 'MENU' then
    for c1 in (
    select nvl(STEP_TEMPLATE,
    (select DEFAULT_PAGE_TEMPLATE
    from wwv_flows where id = :fb_flow_id)) t
    from wwv_flow_steps where id = :fb_flow_page_id and
    flow_id = :fb_flow_id) loop
    for c2 in (select BREADCRUMB_DEF_REG_POS
    from wwv_flow_templates
    where id = c1.t and flow_id = :fb_flow_id) loop
    if c2.BREADCRUMB_DEF_REG_POS is not null then
    r := c2.BREADCRUMB_DEF_REG_POS;
    end if;
    end loop;
    end loop;
    end if;
    return r;
    end;.
    Return to application.
    Steps to recreate the problem.
    1. Create application From Scratch with one page.
    2. Go to page definition, create a new region
    3. Select html (or any region type) and click on next button
    We have 1.6 installed on production box which is working fine. Any help is appreciated. We couple of projects on hold because of this issue.
    Thanks
    Anil Kaparthi
    Pella Corporation
    Oracle Analyst

    Kaparthi - Please refer to the 2.0 Release Notes: "For Oracle HTML DB 2.0, the value of the character set in the configuration of the mod_plsql Database Access Descriptor (DAD) must be set to AL32UTF8, regardless of the underlying database character set." Also, be sure to apply any patches mentioned in that document and to follow all other steps exactly. If this doesn't clear up your issue, please file a TAR with Oracle Support.
    Scott

  • Parameter passing issue for HTMLDB report page

    Hi,
    I have created a HTMLDB report based on SQL query in which the where clause column needs to takeup dynamic value each time.
    So I have defined a hidden item on the page PUSERID of Source type "Static Assigment".
    And this variable is used in SQL as
    Select Name
    from employees
    where employeeid = :PUSERID
    Now when i try to run this report and pass the parameter thru the URL by edititng the URL to have parameter value as
    http://localhost:33492/pls/htmldb/f?p=104:8:8320056215249064505:::::PUSERID:CPRASAD
    This shows the page with no data found...though when i run the query manually it returns the result.
    Select Name
    from employees
    where employeeid = 'CPRASAD'
    Plz let me know the correct procedure to make this work?
    Thanks
    AJ

    Thanks Serigo..it works!
    But why we need to remove the colon?Was it symbolizing that there was no parameter passed initially on URL and later when I was expecting one which was acting as two parametes in case of my url example(one parameter as nothing and another ad PUSERID)

  • Htmldb 1.6 synonym / DbLink issue

    Hi,
    1. I've tested the following issue in 3 version 1.5 , 1.5.1 , 1.6 and it seems issue is yet not solved.
    2. When you create a publich synonym for a remote table or even use the dblink directly , you can't based anythy form / report etc only using a free query method.
    3. Is there any option to create this not using manual selects / handling ...
    Thanks
    Etay G.

    To create the views:
    SELECT 'CREATE OR REPLACE VIEW '||Lower(object_name)||' AS SELECT * FROM '||Lower(object_name)||'@database_link;' FROM user_objects@database_link
    WHERE object_Type IN ('TABLE','VIEW');
    Just replace 'database_link' with your database link.
    Sequence number generators are tricky because you cannot create a view to select the nextval of a sequence number generator in another database over a database link. You have to just append the database link to the sequence reference or create a view which calls a function in the remote database which in turn returns the nextval of the sequence.

  • Pocket IE Issues on ApEx 3.0

    The other day I had an issue with the javascript doSubmit() function that's associated with all the buttons in ApEx not working with Pocket IE. That thread can be found here:
    Javascript problem in ApEx 3.0 [Solved]
    Another issue has surfaced over the past two days that is truly puzzling. The logout link on the navigation bar is giving a message "the page you are looking for cannot be found". Again, this works fine in a regular workstation browser. Pocket IE also worked fine when this was running on HTMLDB 2.0.0.00.49. The error only started appearing after the upgrade to ApEx 3.0.
    The logout link on the navigation bar is as follows:
    wwv_flow_custom_auth_std.logout?p_this_flow=&APP_ID.&p_next_flow_page_sess=&APP_ID.:101I know this is very little information to go on, but anyone that has any ideas I would really like to hear them! Thanks.
    Earl

    Hello,
    Cool yeah get in touch with me. I created a new workspace for testing of mobile issues on apex.oracle.com and would definitely like some feed back and help with issues.
    And now that the iPhone is coming out the market could literally explode!Well even though I have an irrational hatred of all things Apple (from the time my neighbor wouldn't let mess with the 2E and then the damn Newton) like I said it isn't rational. But I have to admit the one thing I have ever cared about as a major shortcoming in mobile phones Apple has fixed first which is put a 'FULL' browser on the phone.
    Plus they finally provide Safari for Windows (you do know they only did that for us developers) and I have been testing Apex application against it and most seem to work pretty good and supposedly anything that runs on Safari for windows will run on iPhone so I think we're looking good.
    I can't wait to see the AJAX + Canvas based application on the iPhone hopefully it will push Microsoft along on their mobile platforms.
    Carl

  • Error Message when installing Companion CD for HTMLDB 1.6 and HTTP Server

    Hi. First time forum user so bear with me.
    I'm not sure if this is the correct forum for this but the assistance of anyone who may be able to shed some light on the problem whould be greatly appreciated. I am having a problem when attempting to install the Companion CD for HTMLDB 1.6 and HTTP Server, details given below:
    The following Oracle components have been successfully installed
         Oracle 10gR2 Database.
         Oracle 10gR2 Database patch 10.2.03.
         Critical patch up date (security).
    The following Oracle component failed to install.
         Companion CD for HTMLDB 1.6 and HTTP server
    Scenario leading up to failure
         Extracted companion CD installation files to D:\oracle\utilities\Oracle_10_2_0_Companion
         Executed D:\oracle\utilities\Oracle_10_2_0_Companion\companion\setup.exe.
    The following error message is displayed in a "JAVA VIRTUAL MACHINE LAUNCHER" dialog box
         "Could not find the main event class. Program will exit."
    I have been attmepting to resolve this problem for over a week and have already checked the following with no resolution to the problem:
    Cause. This issue may have to do with two issues (and may occur more on Windows):-
    1. Within the ORACLE_HOME directory full pathname there is a space.
    2. The directory from where the software / patch is being installed has a space within the directory full
    pathname (where the file for the installation by default is named products.jar or products.xml).
    Solution. To implement the solution, please execute the following steps:-
    1. Rename the full pathname directory NOT to contain a space.
    2. Launch again the OUI... and verify if the problem occurs.
    Any further guidance would be greatly appreciated.
    Edited by: user10386555 on 03-Oct-2008 02:51

    Can you install using OUI from the RDBMS installation? IIRC, there is a problem using OUI on companion to install companion items.

  • Outlook can not display htmldb mail message correctly

    We are using some applications which constructed by HTML DB. All mail messages from HTML DB applications can not be displayed correctly in Outlook, but they are displayed very well in Netscape mail client. This issue happens in both HTML DB 1.5 and 1.6. Therefore, I am not sure this is HTML DB mail package issue or outlook issue. Have anyone experienced this issue. Any suggestions are highly appreciated. Thanks in advance!
    Here is a sample in our application.
    We see the mail message in Outlook:
    This message generated by the HTML DB Mail Package. -----=1T02D27M75MU981T02D27M75MU98
    Content-Type: text/plain; charset=utf-8
    <BR><FONT color=#0000ff>E-Leave System Notification for SGT China.<FONT
    size=2>(Note: it is NOT an official leave system)</FONT></FONT> <HR align=left width="70%" noShade><TABLE width="80%"><TBODY><TR><TD width="20%"><FONT color=#336699>Leave User :</font></TD><TD width="50%">[email protected]</TD></TR><TR><TD><FONT
    color=#336699>Formal:</font></TD><TD>No</TD></TR><TR><TD><FONT
    color=#336699>Type :</font></TD><TD>Personal<BR></TD></TR><TR><TD><FONT
    color=#336699>Begin Time :</font></TD><TD><FONT color=#ff0000>04-MAR-05 11:30</font></TD></TR><TR><TD><FONT color=#336699>End Time :</font></TD><TD><FONT color=#ff0000>04-MAR-05 13:30</font></TD></TR><TR><TD><FONT color=#336699>Urgent Contact :</font></TD><TD>13811512211<BR></TD></TR><TR><TD><FONT
    color=#336699>Note :</font></TD><TD>Go to CCB Haidian Branch for my debit cards again :(<BR></TD></TR></TBODY></TABLE><P><A
    href="http://sgt.us.oracle.com/pls/htmldb/f?p=132:101">E-Leave
    System</A><BR></P
    -----=1T02D27M75MU981T02D27M75MU98
    Content-Type: text/html;
    <BR><FONT color=#0000ff>E-Leave System Notification for SGT China.<FONT
    size=2>(Note: it is NOT an official leave system)</FONT></FONT> <HR align=left width="70%" noShade><TABLE width="80%"><TBODY><TR><TD width="20%"><FONT color=#336699>Leave User :</font></TD><TD width="50%">[email protected]</TD></TR><TR><TD><FONT
    color=#336699>Formal:</font></TD><TD>No</TD></TR><TR><TD><FONT
    color=#336699>Type :</font></TD><TD>Personal<BR></TD></TR><TR><TD><FONT
    color=#336699>Begin Time :</font></TD><TD><FONT color=#ff0000>04-MAR-05 11:30</font></TD></TR><TR><TD><FONT color=#336699>End Time :</font></TD><TD><FONT color=#ff0000>04-MAR-05 13:30</font></TD></TR><TR><TD><FONT color=#336699>Urgent Contact :</font></TD><TD>13811512211<BR></TD></TR><TR><TD><FONT
    color=#336699>Note :</font></TD><TD>Go to CCB Haidian Branch for my debit cards again :(<BR></TD></TR></TBODY></TABLE><P><A
    href="http://sgt.us.oracle.com/pls/htmldb/f?p=132:101">E-Leave
    System</A><BR></P>
    -----=1T02D27M75MU981T02D27M75MU98--
    -----=1T02D27M75MU981T02D27M75MU98--
    And this is my code:
    declare
    l_body_html varchar2(4000);
    l_subject varchar2(100);
    begin
    l_subject := 'eLeave Notification from ' || lower(:app_user) || '@oracle.com'; l_body_html := '<BR><FONT color=#0000ff>E-Leave System Notification for SGT China.<FONT size=2>(Note: it is NOT an official leave system)</FONT></FONT> ' || '<HR align=left width="70%" noShade>' || '<TABLE width="80%"><TBODY><TR>' || '<TD width="20%"><FONT color=#336699>Leave User :</font></TD><TD width="50%">' || lower(:app_user) || '@oracle.com' || '</TD></TR><TR><TD><FONT color=#336699>Formal:</font></TD><TD>' || :P3_FORMAL || '</TD></TR><TR><TD><FONT color=#336699>Type :</font></TD><TD>' || :P3_LEAVE_TYPE || '<BR></TD></TR><TR><TD><FONT color=#336699>Begin Time :</font></TD><TD>'
    || '<FONT color=#ff0000>' || :P3_BEGIN_TIME || '</font>' ||
    '</TD></TR><TR><TD><FONT color=#336699>End Time :</font></TD><TD>' || '<FONT color=#ff0000>' || :P3_END_TIME || '</font>' || '</TD></TR><TR><TD><FONT color=#336699>Urgent Contact :</font></TD><TD>'
    || :P3_CONTACT ||
    '<BR></TD></TR><TR><TD><FONT color=#336699>Note :</font></TD><TD>' || :P3_NOTE || '<BR></TD></TR></TBODY></TABLE><P><A
    href="http://sgt.us.oracle.com/pls/htmldb/f?p=132:101">E-Leave
    System</A><BR></P>';
    HTMLDB_MAIL.SEND(
    P_TO => :P3_MAIL_TO,
    P_FROM => '[email protected]',
    P_CC => :P3_MAIL_CC,
    P_BCC => :P3_MAIL_BCC,
    P_BODY => l_body_html,
    P_BODY_HTML => l_body_html,
    P_SUBJ => l_subject);
    end;
    ---------------------------------------------------------------------------------------------------------------

    This was not well documented, but we have improved the doc for the next relase. Essentially, you need a carriage return / line feed every 1000 characters. This is part of the SMTP spec. The package does not do this automatically for you, so try adding them yourself. You can use utl_tcp.crlf for the crlf.
    Tyler

  • After upgrade HTMLDB 2.0, the browser can not launch MS words to view doc

    I create a page with an item to hold the file id in flows_files.wwv_flow_file_objects$. and use the htmldb_util.get_file(:P14_file_id) on-load before header process to allow user to view the documents under flows_files.wwv_flow_file_objects$ table.
    When we are still in HTMLDB 1.6, the window would pop-up to ask for Open, Save or Cancel. When we click open, the window would depend on the file extension to lauch the Ms Words or Excel or Acrobat reader to view the file.
    After we upgrade to HTMLDB 2.0, the window won't pop-up asking for open, save or cancel. Instead, it would open another Internet Explorer to try to read the file. Since the web browser could not read the MS words or excel, all of page display strange characters. I check the httpd.conf file and mime.type in the apache, everything looks fine with me. Could anyone provide me further information on the troubleshooting...

    >
    Does any one have this issue before?
    >
    Probably not because this is internal build so most of us don't have this version :)
    I suppose that there is internal forum for questions like this.
    Dario

  • SSO logout issue with APEX

    I am trying to resolve the logout URL issue with our APEX application configured as a partner application with SSO. The partner application name is SSO_APEX and the logout URL is defined in partner application as
    http://OID_Server:7777/pls/orasso/orasso.wwsso_app_admin.ls_logout where OID_Server is our OID server name.
    In the APEX application page, I tried to open the application that was imported from another apex server.
    Home>Application Builder>Application 107>Shared Components>Authentication Schemes
    SSO_Auth - current is
    &INFRA_NAME./pls/orasso/ORASSO.wwsso_app_admin.ls_logout?p_done_url=&SERVER_NAME./pls/htmldb/f?p=&APP_ID.
    The logout link is http://INFRA_NAME:7777/pls/orasso/ORASSO.wwsso_app_admin.ls_logout?p_done_url=http://SERVER_NAME/pls/cms/f?p=107 , The application is retrieving the INFRA_NAME and SERVER_NAME values from a database table and they correspond to the OID and 10g application servers respectively.
    The logout link should take it to the login page where the user will be prompted to enter login credentials again however it is currently taking to the above logout link page from APEX. It is not changing even though I specified a different logout link in partner application page. Moreover the check box beside SSO_APEX in the logout page is unchecked.
    The authentication scheme of application is overriding the partner application configuration. How can I make sure the logout is actually happening? Thanks in advance for any suggestions.
    Pavan.

    Scott,
    I am having the same issue, and have posted on another thread about this same thing. I know that's inappropriate to post the same thing in multiple threads, but I was searching the forum again today, and Pavan described exactly what I'm experiencing.
    We have been using SSO for about 4 years or so now, and haven't had logout issues. Our DBA at the time had written his own logout function for SSO where he invalidated the cookie with owa_cookie calls. It's worked until now. We have upgraded our database servers and all URLs referencing those servers are now in a different domain than our OAS server. Now the logic in the logout function is no longer invalidating the cookie for SSO (because it's in a different domain). SSO login and authentication still work, it's just the logout that does not.
    I'd like to just alter the logout URL to redirect to the OAS server for logout as you described. But here's what's happening. I press logout link, and it takes me to the OAS Single Sign-Off page where it shows the services it's logging you out of, but it doesn't automatically redirect (just sits there until I press the Return button).
    Is that expected (no automatic redirect)?
    And as Pavan mentioned, the Partner application name (APEX_SERVERNAME_SSO) doesn't show a checkmark next to it. If I go back to my application, I get right back in without being prompted for SSO (ie, not logging out successfully then).
    I know there are a lot of question marks here, but I'm not sure if there's something obvious I am missing or if there's something else I need to fix that I don't know about.
    Can you offer any guidance?
    Thank you for your time,
    Chris

  • Performance issue for Report Regions

    We have an app which has as it's "Home Page" a portal-style page. The "portlets" are separate regions. Some of these regions are HTML forms, but most are report regions, invariably with PL/SQL returning the SQL query.
    On our dev box this portal renders fine, in no more than 5 seconds (acceptable). On the production box a couple of the portlets go crazy, usually taking between 1-2 minutes each. I know this because I added the #TIMING# string to each region footer. The portal page has a META tag to refresh every 120 seconds.
    The first thing I did to debug was to take the PL/SQL function body returning the SQL query, replace all the variables (which are just local vars, app items and page items) with hardcoded values, strip all quotes and run the "cleaned up" SQL query in SQLPlus. It executes very fast.
    So my conclusion is that the problem lies with the application server (which is Oracle iAS). Is this a logical conclusion? What should my next move be to get to the bottom of this?
    Even without the problem portlets the portal refresh speed varies widely, between <1 sec and >10 sec.
    The application also has other pages displaying the portal regions individually. These pages (including those with the "problem portlet" queries) render ok (ie, order of 5 seconds or less). This tells me that there is an issue with having a bunch of query-based regions on the same page.
    My guess is that I might need to examine the logs and/or httpd/modplsql settings of the app server. Number of simultaneous connections?
    What would happen if hundreds of users used this app concurrently, navigated to the portal page and left it like that to auto-refresh every 2 minutes? Are such pages a no-no in HTMLDB?

    Some more information:
    When I run the page in debug mode, I see the following timings for one of the problem portlets:
    11.53: show report
    11.54: determine column headings
    11.54: parse query
    60.95: binding: ":F118_BUNDLE"="F118_BUNDLE" value="1"
    60.95: binding: ":P52_STMETRICS_PRODBRANCH"="P52_STMETRICS_PRODBRANCH" value="RDBMS_MAIN"
    60.95: binding: ":P52_STMETRICS_PLATFORM"="P52_STMETRICS_PLATFORM" value="LINUX"
    61.35: print column headings
    61.35: rows loop: 15 row(s)
    [report is printed here]
    61.49: FORMITEM: P52_STMETRICS_PLATFORM HIDDEN
    61.54: FORMITEM: P52_STMETRICS_PRODBRANCH HIDDEN
    This tells me that the bulk of the time (50 seconds in this case) is eaten up in parsing the query. What is this symptomatic of?
    Another problem I've just noticed. It takes about 5 seconds to open up a region for editing (Region Definition) in HTMLDB. When I click "Apply Changes" (even without editing anything) it is taking on the order of minutes for the changes to be applied to the page. Our app server was bounced just before I noticed this.
    These are the params in our DAD:
    <Location /pls/toolsdb>
    SetHandler pls_handler
    Order deny,allow
    PlsqlDatabaseConnectString ...
    PlsqlDatabasePassword ...
    PlsqlDatabaseUsername ...
    PlsqlDefaultPage ...
    PlsqlDocumentPath docs
    </Location>

  • Creating Job Issue

    Hi Experts,
    I have created a page in Apex where I m using File browse item say :p13_filebrowse(where i m using CSV format files) and other items too. On click of Submit button I m calling package which dynamically creates the table successfully of browsed CSV FIle.
    Now My requirement is to create the dbms_scheduler Job for the existing package(AS Above) so that If I upload the very huge file it should run in backend using the DBMS Job.If I call package directly from the APex . it is happening successfully. But If i create the Job for that package then I m getting error for not identify the Apex file browsed items.
    In Package I m using wwv_flow_files from where i m extracting the file and creating the table.Through Job it is unable to recognise the Apex file browse item.For more information please go through the follwing code:-
    I m calling package from Apex which is succesfully executing in creaitng the table:-
    htmldb_sid_50.parse_file(:P13_FILEBROWSE,'P13_COLLECTION' ,'P13_HEADINGS','P13_COLUMNS','P13_DDL');
    htmldb_sid_50.parse_file(:P13_FILEBROWSE,'P13_COLLECTION' ,'P13_HEADINGS','P13_COLUMNS','P13_DDL','gdqdata.gdq_table1');
    Foollwing code of Package:-
    create or replace PACKAGE BODY htmldb_sid_50
    AS
    TYPE varchar2_t IS TABLE OF VARCHAR2(32767) INDEX BY binary_integer;
    -- Private functions --{{{
    PROCEDURE delete_collection ( --{{{
    -- Delete the collection if it exists
    p_collection_name IN VARCHAR2
    IS
    BEGIN
    IF (htmldb_collection.collection_exists(p_collection_name))
    THEN
    htmldb_collection.delete_collection(p_collection_name);
    END IF;
    END delete_collection; --}}}
    PROCEDURE csv_to_array ( --{{{
    -- Utility to take a CSV string, parse it into a PL/SQL table
    -- Note that it takes care of some elements optionally enclosed
    -- by double-quotes.
    p_csv_string IN VARCHAR2,
    p_array OUT wwv_flow_global.vc_arr2,
    p_num IN VARCHAR2 DEFAULT null,
    p_separator IN VARCHAR2 := ','
    IS
    l_start_separator PLS_INTEGER := 0;
    l_stop_separator PLS_INTEGER := 0;
    l_length PLS_INTEGER := 0;
    l_idx BINARY_INTEGER := 0;
    l_new_idx BINARY_INTEGER := 0;
    l_quote_enclosed BOOLEAN := FALSE;
    l_offset PLS_INTEGER := 1;
    p_csv_string_test varchar2(4000);
    cell_value varchar2(400);
    BEGIN
    l_length := NVL(LENGTH(p_csv_string),0);
    IF (l_length <= 0)
    THEN
    RETURN;
    END IF;
    LOOP
    l_idx := l_idx + 1;
    l_quote_enclosed := FALSE;
    -- p_csv_string
    p_csv_string_test := replace(p_csv_string,'""','@@');
    --p_csv_string := p_csv_string_test;
    IF SUBSTR(p_csv_string_test, l_start_separator + 1, 1) = '"'
    THEN
    l_quote_enclosed := TRUE;
    l_offset := 2;
    l_stop_separator := INSTR(p_csv_string_test, '"', l_start_separator + l_offset, 1);
    ELSE
    l_offset := 1;
    l_stop_separator := INSTR(p_csv_string_test, p_separator, l_start_separator + l_offset, 1);
    END IF;
    IF l_stop_separator = 0
    THEN
    l_stop_separator := l_length + 1;
    END IF;
    if l_idx = 1 then
    p_array(l_idx) := p_num;
    l_idx := l_idx + 1;
    end if;
    if(l_idx < 50) then
    cell_value := (SUBSTR(p_csv_string_test, l_start_separator + l_offset,(l_stop_separator - l_start_separator - l_offset)));
    cell_value := replace(cell_value, '@@', '"');
    p_array(l_idx) := cell_value;
    end if;
    EXIT WHEN l_stop_separator >= l_length;
    IF l_quote_enclosed
    THEN
    l_stop_separator := l_stop_separator + 1;
    END IF;
    l_start_separator := l_stop_separator;
    END LOOP;
    END csv_to_array; --}}}
    PROCEDURE get_records(p_blob IN blob,p_records OUT varchar2_t) --{{{
    IS
    l_record_separator VARCHAR2(2) := chr(13)||chr(10);
    l_last INTEGER;
    l_current INTEGER;
    BEGIN
    -- Sigh, stupid DOS/Unix newline stuff. If HTMLDB has generated the file,
    -- it will be a Unix text file. If user has manually created the file, it
    -- will have DOS newlines.
    -- If the file has a DOS newline (cr+lf), use that
    -- If the file does not have a DOS newline, use a Unix newline (lf)
    IF (NVL(dbms_lob.instr(p_blob,utl_raw.cast_to_raw(l_record_separator),1,1),0)=0)
    THEN
    l_record_separator := chr(10);
    END IF;
    l_last := 1;
    LOOP
    l_current := dbms_lob.instr( p_blob, utl_raw.cast_to_raw(l_record_separator), l_last, 1 );
    EXIT WHEN (nvl(l_current,0) = 0);
    p_records(p_records.count+1) := utl_raw.cast_to_varchar2(dbms_lob.substr(p_blob,l_current-l_last,l_last));
    l_last := l_current+length(l_record_separator);
    END LOOP;
    END get_records; --}}}
    -- Utility functions --{{{
    PROCEDURE parse_textarea ( --{{{
    p_textarea IN VARCHAR2,
    p_collection_name IN VARCHAR2
    IS
    l_index INTEGER;
    l_string VARCHAR2(32767) := TRANSLATE(p_textarea,chr(10)||chr(13)||' ,','@@@@');
    l_element VARCHAR2(100);
    BEGIN
    l_string := l_string||'@';
    htmldb_collection.create_or_truncate_collection(p_collection_name);
    LOOP
    l_index := instr(l_string,'@');
    EXIT WHEN NVL(l_index,0)=0;
    l_element := substr(l_string,1,l_index-1);
    IF (trim(l_element) IS NOT NULL)
    THEN
    htmldb_collection.add_member(p_collection_name,l_element);
    END IF;
    l_string := substr(l_string,l_index+1);
    END LOOP;
    END parse_textarea; --}}}
    PROCEDURE parse_file( --{{{
    p_file_name IN VARCHAR2,
    p_collection_name IN VARCHAR2,
    p_headings_item IN VARCHAR2,
    p_columns_item IN VARCHAR2,
    p_ddl_item IN VARCHAR2,
    p_table_name IN VARCHAR2 DEFAULT NULL
    IS
    l_blob blob;
    l_records varchar2_t;
    l_record wwv_flow_global.vc_arr2;
    l_datatypes wwv_flow_global.vc_arr2;
    l_headings VARCHAR2(4000);
    l_columns VARCHAR2(4000);
    l_seq_id NUMBER;
    l_num_columns INTEGER;
    l_ddl VARCHAR2(4000);
    l_keyword varchar2(300);
    l_records_count number;
    l_count number;
    l_filename varchar2(400);
    BEGIN
    --delete from test_mylog;
    -- insert into t_log(slog) values('p_file_name '||p_file_name||'p_collection_name '||p_collection_name||'p_headings_item '||p_headings_item||'p_columns_item '||p_columns_item||'p_ddl_item '||p_ddl_item||'p_table_name '||p_table_name);
    -- commit;
    insert into testing_job values(p_file_name,p_collection_name,p_headings_item,p_columns_item,p_ddl_item,p_table_name);commit;
    IF (p_table_name is not null)
    THEN
    BEGIN
    execute immediate 'drop table '||p_table_name;
    EXCEPTION
    WHEN OTHERS THEN null;
    END;
    l_ddl := 'create table '||p_table_name||' '||v(p_ddl_item);
    htmldb_util.set_session_state('P13_DEBUG',l_ddl);
    execute immediate l_ddl;
    l_ddl := 'insert into '||p_table_name||' '||
    'select '||v(p_columns_item)||' '||
    'from htmldb_collections '||
    'where seq_id > 1 and collection_name='''||p_collection_name||'''';
    htmldb_util.set_session_state('P13_DEBUG',v('P13_DEBUG')||'/'||l_ddl);
    execute immediate l_ddl;
    RETURN;
    END IF;
    BEGIN
    /*select blob_content into l_blob from wwv_flow_files
    where name=p_file_name;*/
    select the_blob into l_blob from t_batch_attachments
    where blob_filename=p_file_name;
    -- insert into testing_job values (l_blob);commit;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    raise_application_error(-20000,'File not found, id='||p_file_name);
    END;
    get_records(l_blob,l_records);
    IF (l_records.count < 2)
    THEN
    raise_application_error(-20000,'File must have at least 2 ROWS, id='||p_file_name);
    END IF;
    -- Initialize collection
    htmldb_collection.create_or_truncate_collection(p_collection_name);
    -- Get column headings and datatypes
    csv_to_array(l_records(1),l_record,'sid');
         --l_records_count:=l_record.count+1;
    --csv_to_array(l_records(l_records_count),l_datatypes);
         l_num_columns := l_record.count;
         if (l_num_columns > 100) then
    raise_application_error(-20000,'Max. of 100 columns allowed, id='||p_file_name);
    end if;
    -- Get column headings and names
    FOR i IN 1..l_record.count
    LOOP
    l_record(i) := trim(l_record(i));
    l_record(i) := replace(l_record(i),' ','_');
    l_record(i) := replace(l_record(i),'-','_');
    l_record(i) := replace(l_record(i),'(','_');
    l_record(i) := replace(l_record(i),')','_');
    l_record(i) := replace(l_record(i),':','_');
    l_record(i) := replace(l_record(i),';','_');
    l_record(i) := replace(l_record(i),'.','_');
    l_record(i) := replace(l_record(i),'"','_');
    l_headings := l_headings||':'||l_record(i);
    l_columns := l_columns||',c'||lpad(i,3,'0');
    END LOOP;
    l_headings := ltrim(l_headings,':');
    l_columns := ltrim(l_columns,',');
    htmldb_util.set_session_state(p_headings_item,l_headings);
    htmldb_util.set_session_state(p_columns_item,l_columns);
         -- Get datatypes
    FOR i IN 1..l_record.count
    LOOP
    l_datatypes(i):='varchar2(400)';
    l_ddl := l_ddl||','||l_record(i)||' '||l_datatypes(i);
    END LOOP;
    l_ddl := '('||ltrim(l_ddl,',')||')';
    htmldb_util.set_session_state(p_ddl_item,l_ddl);
    -- Save data into specified collection
    FOR i IN 1..l_records.count
    LOOP
    csv_to_array(l_records(i),l_record,i-1);
    l_seq_id := htmldb_collection.add_member(p_collection_name,'dummy');
    FOR i IN 1..l_record.count
    LOOP
    htmldb_collection.update_member_attribute(
    p_collection_name=> p_collection_name,
    p_seq => l_seq_id,
    p_attr_number => i,
    p_attr_value => l_record(i)
    END LOOP;
    END LOOP;
    -- DELETE FROM wwv_flow_files WHERE name=p_file_name;
    END;
    BEGIN
    NULL;
    END;
    Now I m stuck in If I call the Package through following Job:-
    DBMS_SCHEDULER.create_job (
    job_name => 'New_Testing1',
    job_type => 'PLSQL_BLOCK',
    job_action => 'begin
    GDQ.htmldb_sid_50.parse_file ('''||:P13_FILEBROWSE||''',''P13_COLLECTION'',''P13_HEADINGS'',''P13_COLUMNS'',''P13_DDL'');
    htmldb_sid_50.parse_file('''||:P13_FILEBROWSE||''',''P13_COLLECTION'' ,''P13_HEADINGS'',''P13_COLUMNS'',''P13_DDL'',''gdqdata.gdq_table1'');
    end;
    start_date => NULL,
    repeat_interval => NULL,
    end_date => NULL,
    enabled => TRUE,
    comments => 'UPLOAD FILE INTO TABLE IN GDQ.'
    I believe there is security issue in APex related to wwv_flow_files which is creating the problem . Please can anybody assist me in this issue.
    Thanks in Advance
    Danalaxmi

    Please post the details of the application release, along with the complete error message and the steps you followed to reproduce the issue.
    Thanks,
    Hussein

  • Post Install steps for htmldb 1.6.1

    I am done with a new installation on RHL
    - 10g DB install on ORACLE_HOME1
    - Standalone 9.0.4 Http Server for the CCD on ORACLE_HOME2
    - Install of HTMLDB 1.6.0 and later patch of 1.6.1 error free
    I am following the post installation steps for configuring the DAD and I am unable to find the file "wdbsrv.app". I am on page 22 of the HTMLDB installation guide (B14498_02.pdf)
    How do I configure the DAD and up my htmldb.
    thanks
    -/srinath

    I am still having issues .....
    I get INVALID LOGIN CREDENTIALS - logging as ADMIN/HTMLDB in the /pls/htmldb/htmldb_admin page
    I unknowingly unlocked and changed the passwords of HTMLDB_PUBLIC_USER and other users
    to "htmldb", but IMO that should'nt matter because I used "htmldb" as the password during
    the initial install too. So....
    the access log has this:
    172.16.4.57 - HTMLDB_PUBLIC_USER [01/Apr/2005:13:13:33 -0800] "POST /pls/htmldb/wwv_flow.accept HTTP/1.1" 302 165
    172.16.4.57 - HTMLDB_PUBLIC_USER [01/Apr/2005:13:13:33 -0800]
    "GET /pls/htmldb/f?p=4550:10:1949690027032632943&notification_msg=Invalid%20Login%20Credentials/344577F9B4C4782C9D0F6CCC888077AB/ HTTP/1.1" 200 6688
    172.16.4.57 - HTMLDB_PUBLIC_USER [01/Apr/2005:13:13:42 -0800] "POST /pls/htmldb/wwv_flow.accept HTTP/1.1" 302 165
    172.16.4.57 - HTMLDB_PUBLIC_USER [01/Apr/2005:13:13:42 -0800]
    "GET /pls/htmldb/f?p=4550:10:1949690027032632943&notification_msg=Invalid%20Login%20Credentials/344577F9B4C4782C9D0F6CCC888077AB/ HTTP/1.1" 200 6688
    my dad looks likes this:
    <Location /pls/htmldb>
    SetHandler pls_handler
    Order deny,allow
    Allow from all
    AllowOverride None
    PlsqlDatabaseUsername HTMLDB_PUBLIC_USER
    PlsqlDatabasePassword htmldb
    PlsqlDatabaseConnectString biz1:1521:e5dwhdb1 SIDFormat
    PlsqlDefaultPage htmldb
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDocumentPath docs
    PlsqlDocumentProcedure wwv_flow_file_mgr.process_download
    PlsqlAuthenticationMode Basic
    PlsqlNLSLanguage AMERICAN_AMERICA.AL32UTF8
    </Location>
    I tried this from the FAQ section but get this:
    SQL> begin
    2 wwv_flow_api.set_security_group_id(p_security_group_id=>10);
    3 end;
    4 /
    PL/SQL procedure successfully completed.
    SQL> ed /tmp/z
    wwv_flow_api.set_security_group_id(p_security_group_id=>10);
    begin
    wwv_flow_fnd_user_api.create_fnd_user(
    p_user_name => 'myself',
    p_email_address => '[email protected]',
    p_web_password => 'mypasswd') ;
    end;
    ERROR at line 1:
    ORA-20001: Unauthorized access (wwv_flow_api.set_credentials not set).
    ORA-06512: at "FLOWS_010600.WWV_FLOW_FND_USER_API", line 19
    ORA-06512: at "FLOWS_010600.WWV_FLOW_FND_USER_API", line 429
    ORA-06512: at line 2
    ===============================
    thanks in advance for your insights
    -/srinath

  • Cross browser issue using ajax report pull

    Hi,
    I have an application working using ajax report pull.
    Entire application is based on ajax and its currently released.
    Its performance is good. It works fine with mozilla but in ie,
    links and buttons are not working.
    my code is as follows:
    var container = document.getElementById("divlayer");
         container.innerHTML="";
         var l_Val = document.getElementById('P15_ID').value;
         var l_Val1 = document.getElementById('P15_REGION').value;
         var l_Val2 = document.getElementById('P15_COUNTRY').value;
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,null,10);
         get.add('P15_GSI_PARTY_ID',l_Val);
         get.add('P10_ID',l_Val);
         get.add('P10_REGION',l_Val1);
         get.add('P10_COUNTRY',l_Val2);
         get.add('P10_ROWS',l_Val3);
         get.add('P15_REGION',l_Val1);
         get.add('P15_COUNTRY',l_Val2);
         get.add('P15_ROWS',l_Val3);
         gReturn = get.get(null,'<htmldb:BOX_BODY>','</htmldb:BOX_BODY>');
         get = null;
    document.getElementById("divlayer").style.visibility='visible';
    document.getElementById("divlayer").style.display='block';
    var elem = document.createElement('div');
         elem.id='d1';
    elem.innerHTML=gReturn;
         container.appendChild(elem);
    The links with doSubmit is not submitting to the same page in ie.
    Please help me.
    Thanks,
    Niveditha

    Hello Niveditha,
    There're some differences in browsers... so yes it's possible that it doesn't work with the same code in another browser. The good news is that most of time there're workaround.
    When I look at your code, you could already change document.getElementById() by $x(), which is doing the same, but comes from the APEX framework.
    Do you have an idea where it fails in IE? Are you using the Developer Toolbar? Maybe that gives you more insights. You could also put some alert('hello 1'); in your code to see what's happening and how far it comes.
    If you put it on apex.oracle.com we can have a look into more detail.
    Dimitri
    -- http://dgielis.blogspot.com
    -- http://apex-evangelists.com

Maybe you are looking for

  • My weather app keeps crashing

    My iPod's weather app keep crashing. I already tried resetting, updating (theres always an error) restoring and all of that. I don't know what to do now!

  • Discoverer 4i:i have to create a report based on the two columns

    Hi, I have to create a report(workbook) that will have 2 parameters from date & to date.i have to apply a validation that from date should be lesser then to date.Do reply Thanks,

  • WBS-AUC-ASSET listing report

    Hi, Is there a standard report in SAP which can give me the below details in 1 single report? 1) line items on a WBS elements 2) If the line items on WBS are settled to an AUC then AUC number 3) If the line items on AUC are settled to an Asset then A

  • Strange error occurring /only/ on landscape photos

    I'm using iPhoto '11 version 9.4.3   I noticed today that a very specific set of images in one "event" are giving an error when I try to view them. All thumbnails work for every single picture. The pictures that are giving the error _do show up_ in t

  • SBS 2011 - Need to change Machine name and IP address range

    We had upgraded to SBS 2011 and new hardware 6 months ago, we have recently been aquired by a larger company and want us to comply with their machine naming conventions and change the IP address range to fit in with their corporate structure.  They w