Oracle XE htp-package limitations?

Hello,
I'm developing a web application on my laptop Windows XP pro, Oracle XE 10 + apache + mod_owa. I had some serious issues with htp.p -calls, I'd keep getting this error message, no matter how small I made the htp.p -arguments
Error 6502 calling procedure:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "SYS.HTP", line 1536
....I then started to wonder about this, and so I copied my packages to another machine (Windows server 2003, Oracle 10g, apache + mod_owa), compiled them and my error disappeared !
Now is this some sort of limitation in Oracle XE, or what?

Funny.. I'm sure that I submitted my response to this yesterday - but it does not show.
Anyway, here it is again. No, there is no limitation I'm aware of - having tested the code below in XE. I have a procedure called WebCall that simulates a mod_plsql call. I've used this to test:
SQL> create or replace type TStrings is table of varchar2(4000);
  2  /                                                         
Type created.
SQL>
SQL> /
Type created.
SQL> create or replace procedure WebTest is
  2          cookie  OWA_COOKIE.cookie;   
  3  begin                                
  4          OWA_UTIL.mime_header('text/html', TRUE );
  5          cookie := OWA_COOKIE.get( 'SOME_CUSTOM_COOKIE' );
  6                                                          
  7          HTP.prn( 'What do you want, universe? (Klingon for "hello world")' );
  8          HTP.prn( '<hr>' );                                                  
  9          HTP.prn( rpad('0',3000,'1') );                                      
10          HTP.prn( '<hr>' );                                                  
11                                                                              
12          if cookie.vals.First is NULL then                                   
13                  HTP.prn( 'Cookie [SOME_CUSTOM_COOKIE] is not set' );        
14          else                                                                
15                  HTP.prn( 'Cookie [SOME_CUSTOM_COOKIE] is set to "'|| cookie.vals( cookie.vals.First )||'"' );
16          end if;                                                                                             
17                                                                                                              
18          HTP.prn( '<hr>' );                                                                                  
19                                                                                                              
20          HTP.prn( 'You are connection from web browser: '|| OWA_UTIL.get_cgi_env( 'HTTP_USER_AGENT' ) );     
21  end;                                                                                                        
22  /                                                                                                           
Procedure created.
SQL>
SQL> create or replace function WebCall( procName varchar2, queryString varchar2 default null ) return TStrings pipelined is
  2          nameList        OWA.vc_arr;                                                                                   
  3          valueList       OWA.vc_arr;                                                                                   
  4          htpBuffer       HTP.htbuf_arr;                                                                                
  5          bufRows         integer         := 99999999;                                                                  
  6          rc              integer;                                                                                      
  7  begin                                                                                                                 
  8          -- name-value list (typical CGI variables)                                                                    
  9          nameList(1) := 'HTTP_COOKIE';                                                                                 
10          nameList(2) := 'HTTP_HOST';                                                                                   
11          nameList(3) := 'HTTP_USER_AGENT';                                                                             
12          nameList(4) := 'QUERY_STRING';                                                                                
13          nameList(5) := 'REMOTE_ADDR';                                                                                 
14          nameList(6) := 'REQUEST_METHOD';                                                                              
15          nameList(7) := 'QUEST_URI';                                                                                   
16                                                                                                                        
17          valueList(1) := 'SOME_CUSTOM_COOKIE=123; SOME_OTHER_COOKIE=foo';                                              
18          valueList(2) := 'localhost';                                                                                  
19          valueList(3) := 'Mozilla/5.0; PL/SQL Interface';                                                              
20          valueList(4) := nvl( queryString, 'param1=value1&pama2=value3' );                                             
21          valueList(5) := 'localhost';                                                                                  
22          valueList(6) := 'GET';                                                                                        
23          valueList(7) := '/custom-web-service';                                                                        
24                                                                                                                        
25          -- initiliase OWA and configure a basic CGI environment                                                       
26          DBMS_SESSION.reset_package;                     -- reset PL/SQL PGA maintaining package state                 
27          rc := OWA.Initialize;                                                                                         
28          OWA.init_cgi_env( 7, nameList, valueList );                                                                   
29          htp.HTBUF_LEN := 255;                                                                                         
30                                                                                                                        
31          -- now call the web enabled PL/SQL procedure                                                                  
32          execute immediate 'begin '||procName||'; end;';                                                               
33                                                                                                                        
34          -- return the output as rows                                                                                  
35          OWA.get_page( htpBuffer, bufRows );                                                                           
36          for i in 1..htpBuffer.Count                                                                                   
37          loop                                                                                                          
38                  PIPE ROW( htpBuffer(i) );                                                                             
39          end loop;                                                                                                     
40                                                                                                                        
41          return;                                                                                                       
42  end;                                                                                                                  
43  /                                                                                                                     
Function created.
SQL> show errors
No errors.     
SQL>           
SQL> col HTML_LINE format a80
SQL>                        
SQL> select                 
  2          rownum          as LINE_NO,
  3          b.column_value  as HTML_LINE
  4  from       TABLE( WebCall('WebTest') ) b
  5  /                                      
   LINE_NO HTML_LINE
         1 Content-type: text/html                                                        
         2 Content-length: 3176                                                           
         3                                                                                
         4 What do you want, universe? (Klingon for "hello world")                        
         5 <hr>                                                                           
         6 01111111111111111111111111111111111111111111111111111111111111111111111111111111
           11111111111111111111111111111111111111111111111111111111111111111111111111111111
           11111111111111111111111111111111111111111111111111111111111111111111111111111111
           111111111111111                                                                
..snipped..
        17 11111111111111111111111111111111111111111111111111111111111111111111111111111111
           11111111111111111111111111111111111111111111111111111111111111111111111111111111
           11111111111111111111111111111111111
        18 <hr>
        19 Cookie [SOME_CUSTOM_COOKIE] is set to "123"
        20 <hr>
        21 You are connection from web browser: Mozilla/5.0; PL/SQL Interface
21 rows selected.
SQL>The WebTest procedure writes a 3000 character string via HTP.PRN. It works fine.
As it accepts a varchar2 parameter, it should be capable of accepting 32KB strings. Note that the size is byte size and not char size. When using a db with a multibyte char set, a single char consumes more than 1 byte of space and then obviously less chars can be send in a 32KB block.
Also note that the limit for the SQL engine for varchar2 is 4000 bytes and not 32KB like the PL engine.
Playing around with the WebCall code, the only time I ran into string size errors, was when changing the HTBUF_LEN parameter to greater than 255. My guess this is a limitation of how the call interface between OWA and mod_plsql has been designed. But this does not limit the actual size of the HTP.PRN to 255 - only the way the data is exchanged (note that the pipeline function returns the data from the HTP buffer in 255 char chunks.

Similar Messages

  • HTP Package and Oracle XE

    Hello Experts,
    I have just installed Oracle10g XE. I wanted to create package/procedure using Oracle HTP package. Would it be possible to use HTP package in XE. If so then how can I call that in browser? (Say package name is my_package_k and procedure id my_proc_p). I do not know what http://???? I have to use??
    Please help me.
    Thanks,
    B Adhvaryu
    London
    UK

    I'm running XE on an Asus 1000H eee netbook and all works fine. I installed 2GB though which is straighforward and relatively inexpensive to do, and also doesn't invalidate the warranty.
    PaulB

  • HTP package question

    I have a feeling I'm in the wrong place for this question but maybe someone can help.
    I'm not so good with Oracle configuration and setup issues but I have created a package with a few procedures that output info using the HTP package. At my old place of employment we had a web server set up and we could use
    http://ouraddress.com/packagename.procedurename?p_param1=123&p_param2=456
    We have a web-based application server set up for Oracle Forms (eBusiness Suite) but I don't know if I'm able to do something like this or not. Where/what do I need to set up to use this type of functionality?
    null

    PL/SQL Web Development Tools: Oracle Database provides built-in tools and technologies that enable you to deploy PL/SQL applications over the Web. Thus, PL/SQL serves as an alternative to Web application frameworks such as CGI.
    The PL/SQL Web Toolkit is a set of PL/SQL packages that you can use to develop stored procedures that can be invoked by a Web client. The PL/SQL Gateway enables an HTTP client to invoke a PL/SQL stored procedure through mod_plsql, which is a plug-in to Oracle HTTP Server. This module performs the following actions:
    - Translates a URL passed by a browser client
    - Calls an Oracle Database stored procedure with the parameters in the URL
    - Returns output (typically HTML) to the client
    You got to start from here:
    Developing Applications with the PL/SQL Web Toolkit
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_web.htm#g1026380

  • Reading html data & uploading a file in single html form using htp package

    Hi
    I have designed a html screen using htp package in which i have few text items and file upload button. I have to validate all forms data like text items and check box elements and upload file to unix. I am using java script for file validations and cgi script to upload file. With this I am able to either read form data or upload file but not both.
    At a time I want to insert a record to database with html form values and upload file to unix with htp package. Please suggest how can I read html form data + uploading a file to unix simultaneously in a single htp procedure.
    Thanks,
    Pradeep

    Have you ever considered using Application Express (APEX)?
    Oracle Application Express (APEX)
    Sounds like you're going the long way around to create a web based application.

  • How to incorporate Javscript into oralce htp packages?

    hello,
    I would like to know about the javascript how one can use in oracle HTP packages while creating the forms using HTP packages... are there any course offered by oracle or is there any documentation available on this? on i know the htp package are there but how one can use javascript in htp packages...
    Please do help me out...
    Thanks a lot.......

    Application Developer's Guide - Fundamentals Contents / Search / Index / PDF
    Chapter 18 Page 679
    http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96590.pdf
    You can enter too javacript code inside a Stored Procedure and use so:
    Example:
    <HTML>
    <HEAD>
    <TITLE>Metalink 2.0</TITLE>
    </HEAD>
    <FRAMESET COLS="152, *" NORESIZE BORDER="0" FRAMESPACE="0"
    FRAMESPACING="0" FRAMEBORDER="NO">
    <FRAME SRC="ml2_gui.checkJavascript?p_section_id=-1" SCROLLING="NO" SCROLLING="NO" MARGINWIDTH="0" MARGINHEIGHT="0" NAME="navbar">
    <FRAMESET ROWS="61,*" BORDER="0" FRAMESPACE="0" FRAMESPACING="0" FRAMEBORDER="NO" NAME="rightframe">
    <FRAME SRC="ml2_gui.queryform"SCROLLING="NO" NORESIZE MARGINWIDTH="0" MARGINHEIGHT=0 BORDER="0" NAME="query">
    <FRAME SRC="per_hom.startup" SCROLLING="AUTO" NORESIZE MARGINWIDTH="0" MARGINHEIGHT="0" BORDER="0" NAME="corner">
    </FRAMESET>
    </FRAMESET>
    Joel P�rez

  • JS Validation for Drop down List is not working in Oracle PL/SQL Package

    Hi All,
    I am facing an issue with JavaScript validation done in Oracle PL SQL package.
    System Requirement:
    There is one screen which contains two fields viz. FLD 1 & FLD 2 and one 'Submit' button.
    FLD 1 and FLD 2 fields are drop down list boxes.These are mandatory fields.
    The screen is developed in Oracle Mod PL SQL package.
    The html coding and java scripting are embedded in the respective Oracle PL SQL Package procedure which generates this screen,takes the input values provided by user,does the
    field validations and submits the form.
    Issue:
    The javascript validation for FLD 2 dropdown is working successfully.
    When the user leaves this field as blank,the embedded javascript pops up an error message 'Selection of FLD 2 is manadatory before submitting the form!'.
    As FLD 1 is also a mandatory field,the javascripting validation should pop up the similar error message 'Selection of FLD 1 is manadatory before submitting the form!'.
    But,this first field validation is not at all working.
    The system allows to submit the form even if the 'FLD 1' is left blank.
    The javascript code sysntax for validation of FLD 1 & FLD 2 drop down list boxes as follows:
    function validate_form_fields()
    if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
    [0].p_fld_1.selectedIndex < 1 )
    alert("Selection of FLD 1 is manadatory before submitting the form!!!");
    return false;
    else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
    [0].p_fld_2.selectedIndex < 1 )
    alert("Selection of FLD 2 is manadatory before submitting the form!!!");
    return false;
    return true;
    I am viewing the screen from the web browser IE version 8.0.
    Your timely help will really be appreciated.
    Regards & Thanking in advance,
    Alka

    Hi,
    1. Your problem is actually related to JavaScript, not SQL and PL/SQL. So, this is the wrong forum to post. The closest to JS is the Application Express forum {forum:id=137}. Clearly state that it is not an Apex issue and that you are looking for JS help.
    2. Your JS code, the way you has posted it, is syntactically incorrect, so if you post on Apex forum put the correct code and in tags as described in the FAQ
    {quote}
    function validate_form_fields()
    if (document.forms[0].p_fld_1.selectedIndex == 0))) || (document.forms
    [0].p_fld_1.selectedIndex < 1 )
    alert("Selection of FLD 1 is manadatory before submitting the form!!!");
    return false;
    else if (document.forms[0].p_fld_2.selectedIndex == 0))) || (document.forms
    [0].p_fld_2.selectedIndex < 1 )
    alert("Selection of FLD 2 is manadatory before submitting the form!!!");
    return false;
    return true;
    {quote}
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Apex new installation - HTP package body has errors

    I installed apex on 10G. When i try to access the apex page, i get the following errors in log:
    [Sat Oct 28 08:39:25 2006] [error] [client 192.168.1.90] [ecid: 1162049964:156.153.112.151:9580:0:9,0] mod_plsql: /pls/apex/apex HTTP-404 ORA-04063: package body "SYS.HTP" has errors\nORA-06508: PL/SQL: could not find program unit being called: "SYS.HTP"\nORA-06512: at line 7\n
    When i recompile HTP package body, i get errors:
    SQL> alter package htp compile body;
    Warning: Package Body altered with compilation errors.
    SQL> sho errors
    Errors for PACKAGE BODY HTP:
    LINE/COL ERROR
    14/11 PLS-00323: subprogram or cursor 'TITLE' is declared in a package
    specification and must be defined in the package body
    15/11 PLS-00323: subprogram or cursor 'HTITLE' is declared in a package
    specification and must be defined in the package body
    1691/7 PL/SQL: Statement ignored
    1691/7 PLS-00307: too many declarations of 'PRINT' match this call
    1694/7 PL/SQL: Statement ignored
    1694/7 PLS-00307: too many declarations of 'PRINT' match this call
    1697/7 PL/SQL: Statement ignored
    1697/7 PLS-00307: too many declarations of 'PRN' match this call
    1700/7 PL/SQL: Statement ignored
    1700/7 PLS-00307: too many declarations of 'PRN' match this call
    1703/7 PL/SQL: Statement ignored
    1703/7 PLS-00307: too many declarations of 'PRINT' match this call
    1706/7 PL/SQL: Statement ignored
    1706/7 PLS-00307: too many declarations of 'PRINT' match this call
    1709/7 PL/SQL: Statement ignored
    1709/7 PLS-00307: too many declarations of 'P' match this call
    1712/7 PL/SQL: Statement ignored
    1712/7 PLS-00307: too many declarations of 'P' match this call
    1715/7 PL/SQL: Statement ignored
    1715/7 PLS-00307: too many declarations of 'P' match this call
    Any ideas...

    Please tell us your first name and update your forum profile with it to help us. Also, change your handle to something more reader-friendly. Thanks.
    If your imported applications are set up to use some kind of SSO authenticaiton and you haven't provided for that in your environment then you'll need to change those applications' authentication scheme to something you can deal with.
    Scott

  • Oracle PL/SQL Package - DB Adapter

    Hi All
    We have PL/SQL package with more than 20 procedures/functions. We prefer to use Oracle DB Adapter and host as webservices
    1. Is there a way to generate a single WSDL/XSD compatible to Oracle DB Adpater for a package ?
    2. Should we generate 20 WSDL/XSD for each of these procedures?
    Any idea on how could we achieve it cleaner and quicker. It is to make a decision whether we should stick with Oracle DB Adapter or host a simple Java Webservice.
    Any comments is appreciable.
    Regards
    Prasad Jayakumar
    Pls Note: I have posted this thread originally in
    Oracle PL/SQL Package - DB Adapter

    Sorry for the late reply. As you state there is no option to manage multiple operations in a DB Adapter.
    To explain my ESB example better, what I mean by this is that you can create a WSDL that has multiple operations, these operations will be based on the procedures in your packages. In your OSB process you can create multiple DB adapters calling the individual procedures of the package. Based on the operation being invoked you can route to the appropriate DB Adapter.
    Therefore the pros and cons
    PL/SQL Web Service
    One service to call multiple procedures in the PL/SQL package
    Lacks visibility through the management consoles
    If your PL/SQL changes will affect the Web Service implementation which may also all clients calling it.
    More of a point to point solution.
    OSB
    Able to add and remove procedures as required.
    Can add procedures and/or functions that are not part of a package
    Manage service endpoints if the PL/SQL changes. Meaning 3rd party objects can remain unchanged.
    If you have hundreds of procedures in your package it will take long time to create individual adapters.
    This is not an exhaustive list but to will get an idea.
    cheers
    James

  • Creating Sap Crystal Report Through Oracle Stored Procedure Packages

    Hi,   
    1.How we can create crystal report through oracle stored
    procedure packages pls tell me the steps through adding command then
    tell me the syntax what should i write in command to call the stored
    procedure packages or if have some other option then also tell. 
    2.can
    we link stored procedure column to other table column that used in
    report.

    Hi Ganesh,
    As this error comes when you are trying to insert non-numeric value into a numeric column in db it seems that your field might be numeric and you are trying to send it as a string in database.
    Please check your Store Proc carefully..
    Reference Thread: Oracle/PLSQL: ORA-01722
    --Dhana

  • Sending Binary Data using HTP package

    Has anyone been successful in using the HTP package and its PUTRAW procedure to send binary data to a browser?
    Example code shows basic idea:
    create or replace
    procedure test_raw as
    output VARCHAR2(20);
    begin
    OWA_UTIL.MIME_HEADER('application/x-gzip', TRUE);
    output := 'Hello World!';
    HTP.PUTRAW(UTL_RAW.CAST_TO_RAW(output));
    HTP.FLUSH;
    end test_raw;
    I receive an empty file when called from the browser.
    What gives?

    I found my answer. I should be using wpg_docload.download_file(BLOB) to "download" a the contents of a BLOB.

  • What are Oracle in built  Packages

    I was talking with a friend today and out of the blue he asked me "Besides select, insert, delete, updates and e.t.c which is common in Oracle PL/SQL, what Oracle in built packages have I used?" I did not have an answer.
    So what are Oracle in built Packages?
    Thanks

    There are some wonderful documents - in Oracle9i titled "Supplied PL/SQL Packages and Types Reference" and "Supplied Java Packages Reference" that provide details about the packages Oracle has made available.
    In addition, every function you call in a SELECT, INSERT, UPDATE or DELETE - such as trim, to_char, substr, etc. is part of package STANDARD

  • Config Lab tool for Oracle CC&B Package

    Hi,
    Is there any configlab tool for Oracle CC&B package for confifuration management accross different environments. we can use VSS as version management for java codes and cobol codes in CC&B. But i am unable to identify any config lab tool for configuration management.
    Guys please help me out in this.
    Thanks and Regards
    sayantan

    Sayantan,
    There is (unfortunately) no silver bullet for your requirement.
    Here is a good blog article on the different options available.
    https://blogs.oracle.com/theshortenspot/entry/configlab_versus_bundling_vers
    Implementations use variations and combinations of the 3 tools that are available, coupled with 3rd party migration tools (like vss). The strategy for an implementation's development-to-production life cycle will vary based on a multitude of factors. Skill set of the IT shop, what tools they are used to, internal audit procedures, etc.
    Hope the article provides some food for thought!
    D

  • Documentation on oracle.ord.im package

    Does anyone know where to find the documentation about oracle.ord.im package?
    I tried the Online Help, it gave me nothing.
    Thanks in advance.
    Cheers!

    Rick -
    Check out http://technet.oracle.com/products/intermedia/ - there is a great deal of information regarding the im packages there.
    Hope this helps,
    Lynn

  • JDBC calling an Oracle PL/SQL Package?

    Does anyone know how to have JDBC call an Oracle PL/SQL Package?
    Thanks, Jon

    Review the CallableStatement object in the JDBC Developers Guide

  • Anybody work with oracle.javatools.editor package ?

    Subj

    To answer your question: Yes, I am sure many people work with oracle.javatools.editor package. If you have a more specific question post it. Someone might have the answer you're looking for.
    PS I don't work with this package, I was just wondering why this post didn't have any replies.
    DB

Maybe you are looking for

  • Printer 'offline' when actually not on wireless connection laptop

    I have an Officejet Pro L7590, connected via a wired connection to my Linksys router. My laptop runs Windows 7 32-bit Home Premium and is wireless connected to my router. When I double-click the printer in 'Devices and Printers'. It shows 'printer of

  • HELP!  JOB ON THE LINE-  Need to import fields from one document to another document

    In a nutshell I have a set of documents and we now have a new structure for those documents. Either I have to cut and paste all the data from one to another or figure out how to import fields to another document. I have two documents. Both are differ

  • Unmountable boot volume error blue screen

    I have a toshibia laptop that has crashed, I am eventually getting the unmountable_boot_volume error blue screen, the recovery disks that i ordered will not work, just disk 1 loads windows file then goes to a black screen with the cursor pointer, com

  • Convert type dats to oracle type date

    Hi guys, I have abap field data: begin of itab occurs 0,         dat type dats, end of itab. how can I convert abap field dat into oracle type DATE, so I can insert dat into that oracle field? thanks, nihad Edited by: nihad omerbegovic on Mar 25, 200

  • How to clear the cache files in folder Temporary Internet Files

    When one user opens files such as pdf. or doc. from Portal,  the same file will be downloaded into the Temporary Internet Files folder. if another user copied the files out of the Temporary Internet Files folder from this computer and save to somepla