Problem with DBMS_LOB.append() procedure

Hi all.
I have a small question about this function:
I tried to use it to unit 2 CLOB objects. Here is part of my script:
create or replace
procedure PAGE_CSV()
is
S clob;
S_FULL clob;
begin
DBMS_LOB.append(S_FULL, S);
end;
But I've got an error:
ORA-19011: Character string buffer too small
May be somebody knows what about his error? I Can not realize why it's about buffer (looks like varchar2), I do not use it...
Thanks,
Anton.
PS Thats for sure, both of objects are not null.
Edited by: user9050456 on Feb 9, 2010 5:44 AM

You cannot assign to a lob variable a value larger then 32767 bytes if it doesn't have a persistent storage in the DB.
SQL> declare
  2  a clob;
  3  begin
  4    a:=lpad('x',4001,'x');
  5    dbms_output.put_line(a);
  6  end;
  7  /
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 4You have to do something like this:
CREATE OR REPLACE PROCEDURE Example_1a IS
    dest_lob BLOB;
    src_lob  BLOB;
BEGIN
    -- get the LOB locators
    -- note that the FOR UPDATE clause locks the row
    SELECT b_lob INTO dest_lob
        FROM lob_table
        WHERE key_value = 12 FOR UPDATE;
    SELECT b_lob INTO src_lob
        FROM lob_table
        WHERE key_value = 21;
    DBMS_LOB.APPEND(dest_lob, src_lob);
    COMMIT;
EXCEPTION
    WHEN some_exception
    THEN handle_exception;
END;Where both the source LOB and the destination one have a persistent storage on db.
Max
[My Italian Oracle blog| http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

Similar Messages

  • What is the problem with this Stored Procedure

    Hi ,
    What is the problem with this Stored Procedure ?Why is it giving errors ??
    CREATE or replace  PROCEDURE getEmpName
    *(EMP_FIRST OUT VARCHAR2(255))*
    BEGIN
    SELECT ename INTO EMP_FIRST
    FROM Emp
    WHERE EMPNO = 7369;
    END ;
    */*

    You don't specify precision in procedure arguments.
    (EMP_FIRST OUT VARCHAR2(255))should be
    (EMP_FIRST OUT VARCHAR2)Since you asked what's wrong with it, I could add that it needs formatting and the inconsistent use of upper and lower case is not helping readability.

  • Problems with date in procedure on Oracle 11g

    Hi gurus,
    I have some problems with the date format on Oracle 11g.
    Let me explain the situation:
    When I am starting a request like
    select to_number(to_char(to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'))
    from sys.dual
    I got as result 2009 as number.
    When I do the same in a procedure of a package like this
    my_year := to_number(to_char(to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'));
    the variable my_year contains the value 9 instead of 2009.
    Can someone explain me what's going wrong?
    I have just tested with changing the environment variable nls_date_format for the session and for the complete database with no success.
    Regards,
    Björn

    Thank you all for your replies so far:
    @Alex: You are right, using your short script in sqlplus gives me also 2009 as result
    So, I am now posting the essential excerpts of the procedure because the whole one is to large:
    function insert_szrl (my_fremd_name varchar, my_elementadresse varchar,
    my_zeitstempel varchar, my_wert float,
    my_status varchar, my_zyklus varchar,
    my_offset integer,
    my_quelle varchar, my_nzm_daten integer) return integer is
    begin
    my_date := to_date (substr (my_zeitstempel, 1, 10), 'dd.mm.yyyy') + my_tageswechsel +1/24;
    if my_zyklus = 'mm' then
    my_zeitstempeldate := add_months(to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy'),-1) +1 + (my_tageswechsel+1/24);
    my_days := to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy') - add_months(to_date(last_day(to_date(my_date, 'dd.mm.yyyy')), 'dd.mm.yyyy'),-1);
    my_year := to_number(to_char(to_date(my_date,'dd.mm.yyyy'), 'yyyy'));
    ptime.umschalttage_tuned (my_year, my_ws, my_sw);
    end if;
    While debugging the complete procedure I see since the start only a date which looks like '01.04.2009 07:00:00'
    Edited by: user10994305 on 19.05.2009 15:58
    Edited by: user10994305 on 19.05.2009 15:58

  • Problem with java source procedure

    Hello everyone, I've set up a simple example that is supposed to create an fdf file on the server. I tested my program and it works fine.
    Now I'm trying to do the same thing except that I would like to have my java code in the database. Here's what I've done:
    # on database in opus schema
    create or replace and compile java source named testpdf as
    import java.io.*;
    import com.adobe.fdf.*;
    import com.adobe.fdf.exceptions.*;
    public class TestPDF
         public static void Test()
    try
         FDFDoc outputFDF = new FDFDoc();
         outputFDF.SetValue("status", "En traitement!");
         outputFDF.SetValue("Date", "01-01-2006");
         outputFDF.SetValue("Name", "Alexandre Folgueras");
         outputFDF.SetValue("Address", "12 Saratoga Ave");
         outputFDF.SetValue("City", "Saratoga");
         outputFDF.SetValue("State", "CA");
    outputFDF.SetFile("/tmp/java_pdf/GenerateFDF.pdf");
    outputFDF.Save("/tmp/java_pdf/alex.fdf");
    catch (Exception e)
    e.printStackTrace();
    create or replace procedure pdf_doc
    AS LANGUAGE JAVA
    NAME 'TestPDF.Test()';
    commit;
    Everything seems to be OK by when I run it, my file does not get created even though I don't get any errors.
    Anybody knows why?
    Thanks in advance!

    Hello,
    I'm also creating a class with static functions and putting it as a Java source in Oracle but I have problems with imports. In my case, I use MQSeries JAR files and when I put my code in Oracle, I have warnings "Java created with compilation errors". It's just about the lines where I create/use MQSeries objects, because when I comment them, I have no more errors.
    I see you also use specific imports with PDF, so I would like to know where you put the JAR files so that the Java source can be compiled correctly.
    Thanks in advance,

  • Problem with SQL,udfs & procedures

    I have couple of problems with my database. Please suggest solution.
    We are basically a web product With a Quite large Database
    1. I am using functions both User Defined and Built in Functions in
    SQL Statement. I want to optimize the query how do i do it.
    why the usage of function in sql statements suppresses,the
    usage of indexes internally. How to forceable make use of
    the index even though function is used.
    2. Whenver The Client makes a request to the Database server with a
    Sql Query What are the steps we can take at the
    client side to enhance the performance of the Query.
    (i.e the Data Request ). How to optimize the usage of CPU at
    client site?
    3. what is the increase in the performance ration by having
    separate table spaces for user data,system data and indexes.
    4. Why the procedures are getting invalided
    after some time. The procedure is
    not getting executed at the front end.
    Once the procedure is getting invalidated.
    However even though the status of the
    procedure is invalid the same is getting
    executed at the back end.
    Can anybody help me
    Request for reply ASAP.
    Regards
    Koshal
    null

    1. In Oracle 8i, one can create function-based indexes, where instead of indexing a column, one can index upper() of that column.
    2. Optimizing client performance is trickier. One can tune the queries being
    submitted by the client, but if getting the first row back -- which is how response time is generally perceived -- set the OPTIMIZER_MODE parameter in init.ora to FIRST_ROWS.
    3. There is minimal benefit to having data, index, rollback, and temp tablespaces all separated unless all the datafiles for each tablespace reside on different disks (data on disk 1, index on disk 2, etc). It's recommended regardless, but unless the files are on separate volumes, there won't be a great performance benefit.
    4. A procedure is invalidated whenever DDL is issued against any object that that procedure depends upon. For example, if you add a column to a table, any procedures which reference that table will be invalidated. Any procedures which reference views which reference that table will be invalidated, because the view will be invalidated. It's best to run a compile script which looks for and attempts to recompile any invalid objects on a daily basis.
    Adam

  • Problem with DBMS_LOB.

    Hi, I am working with Oracle XE, I created a table with the following structure:
    CREATE TABLE "HR". EMPLOYEE_DOCUMENTS "
    "NUM_DOCUMENS" ENABLE NUMBER NOT NULL,
    "EMPLOYEE_COD" NUMBER (6.0) NOT NULL ENABLE,
    "TIPO_DOCUMENTO" VARCHAR2 (12 BYTE) NOT NULL ENABLE,
    "GENERADO_EL" DATE NOT NULL ENABLE,
    "DOCUMENTO_BLOB" BLOB,
    "DOCS8_CLOBS" CLOB,
    CONSTRAINT "EMPLOYEE_DOCUMENTS_PK" PRIMARY KEY ( "NUM_DOCUMENS")
    In the field CLOB stored as a text as follows:
    A person who carries the card. # for the use of the credential # pursued by the law.
    With DBMS_LOB, replacing the characters # content in the field CLOB by the value 1306958172, but the text that remains the last # concatenates and not get results like this:
    A person who carries the card. 1306958172 for the use of the credential 1306958172 pur
    One more question, as can assign field contents CLOb the type BLOB field to save as a Word document, an example please.
    Tahnk.
    Roberto.

    In that place of my Store Procedure:
    declare
    clobs1 CLOB;
    clobs2 CLOB;
    BLOBS blob;
    clobs_aux CLOB;
    valor number;
    cadena varchar2(4000);
    nposicion number;
    ncontar number:=1;
    begin
    select docs8_clobs, documento_blob into clobs1,blobs
    from hr.EMPLOYEE_DOCUMENTS
    where hr.EMPLOYEE_DOCUMENTS.NUM_DOCUMENS=12812;
    valor:=DBMS_LOB.INSTR(CLOBS1,'#',1,ncontar);
    clobs_aux:=clobs1;
    while valor<>0 loop
    nposicion:=valor+1;
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(VALOR));
    clobs2:=DBMS_LOB.SUBSTR(clobs_aux,valor-1,1);
    clobs2:=clobs2||' '||to_clob('1306958172');
    clobs2:=clobs2||' '||DBMS_LOB.SUBSTR(clobs_aux,nposicion,nposicion);
    CLOBS_AUX:=CLOBS2;
    if ncontar>=1 then
    update hr.EMPLOYEE_DOCUMENTS
    set docs8_clobs=clobs_aux
    where num_documens=12812;
    commit;
    end if;
    --Recuperar campo CLOB actualizado.
    select docs8_clobs, documento_blob into clobs1,blobs
    from hr.EMPLOYEE_DOCUMENTS
    where hr.EMPLOYEE_DOCUMENTS.NUM_DOCUMENS=12812;
    CLOBS_AUX:=CLOBS1;
    valor:=DBMS_LOB.INSTR(CLOBS_AUX,'#',1,ncontar);
    ncontar:=ncontar+1;
    end loop;
    end;
    Roberto.

  • Problem with text determination procedure

    here we r finding text determinations procedures for purchase order in spro - img conflagration as follows materialmanagement-purchasing-messages-text for messages-define text for po.by going here i had a view where both header and item text for different po is maintained.
    now i want this text to be printed in my purchase order every time with different item selected there should be different item text should be selected.
    1. the major problem when inserting into medruck form as  insert-text-standard text, here it selecting the text object as TEXT BUT FOR DIFFERENT MATERIALS IT SHOULD SELECT MATERIAL as text object then only i can retrieve the material text's.
    if any one can forward a document r help to solve this problem and solution suggestions.
    this is a very important requirement.pls forward it as early as possible,
    thanx with regards...
    hareesh tadepalli

    Raj,
    Thanks for your suggestion.  This would be a possiblity going forward, but we have existing tickets that would still be missing the interaction text.  This apparently worked before we upgraded to SP 14, so I don't think there is a problem with our configuration.
    I created some new test tickets, and found that the interaction text is still being copied and saved in the ticket log, even after text is added to the ticket.  The problem is that the interaction text is not visible from IC Web.  It is visible when looking at the ticket in the SAP GUI (transaction CRMD_ORDER).
    For example, here is the contents of the Log text as seen in SAP GUI (I use "TICKET" or "INTERACTION" in the text to indicate where the text originated):
    General Note
    06/03/2009          11:14:36            M305755
    TICKET - general note
    General Note
    06/03/2009          11:13:59            M305755
    INTERACTION - general note
    Technical Problem
    06/03/2009          11:13:59            M305755
    INTERACTION - technical problem
    Here is the contents of the Log text as seen in IC Web:
    General Note
    06/03/2009          11:14:36            M305755
    TICKET - general note
    Martin

  • Performance problem with java stored procedure

    hi,
    i developped a java class, then I stored it in Oracle 8.1.7.
    This class contains several import of other classes stored in the database.
    It works, but the execution perfomances are disappointing. It's very long. I guess, that's because of the great number of classes to load that are necessary for my class execution.
    I tried to increase the size of the java pool (I parameter 70 Mo in the java_pool_size parameter of the init.ora), but the performance is not much better.
    Has anyone an idea to increase the performance of this execution of my class ?
    In particular, is there a way to keep permanently in memory the java objects used by my class ?
    Thanks in advance
    bye
    [email protected]
    null

    before running Java, the database session needs to be Java enabled; this might be the reason why it is taking so long. If this is the case, you should see an improvement in subsequent calls, once a database session is Java enabled, other users can benefit from it.
    Kuassi
    I have some performance issue with java stored procedure. Hope some one will be able to help me out. I'm using java stored procedures in my application and basically these procedures are used to do some validation and form the XML message of the database tables. I have noticed that when I call the PL/SQL wrapper function, it is taking time to load the java class and once the class is loaded the execution is faster. Most of the time is spent for loading the class rather than executing the function. if I reduce the class load time, I can improve the performance drastically. Do any one of you know how to reduce the class load time. The following are the platform and oracle version.
    O/S: IBM AIX
    Oracle: 8.1.7

  • Problem with DBMS_LOB.SUBSTR

    Hi,
    i want to encode a BLOB into BASE64_ENCODE.
    Here my PL/SQL function:
    FUNCTION encodeBlob2Base64(pBlobIn IN BLOB)
    RETURN BLOB
    IS
    vAmount PLS_INTEGER := 20000;
    vBase64Blob BLOB;
    vBlobIn BLOB;
    vOffset PLS_INTEGER := 1;
    BEGIN
    vBlobIn := pBlobIn;
    dbms_lob.createtemporary(lob_loc => vBase64Blob, CACHE => FALSE);
    LOOP
    dbms_lob.append(dest_lob => vBase64Blob,
    src_lob => utl_encode.base64_encode(r =>
    dbms_lob.substr(lob_loc => vBlobIn, amount => vAmount, offset => vOffset)));
    vOffset := vOffset + vAmount;
    END LOOP;
    dbms_lob.freetemporary(lob_loc => vBase64Blob);
    RETURN vBase64Blob;
    EXCEPTION
    WHEN OTHERS THEN
    RAISE;
    END encodeBlob2Base64;
    When i now use my function i get the ORA-29261: bad argument in the statement DBMS_LOB.SUBSTR(lob_loc ...)
    Has somebody an idea, what's wrong?
    Many thanks in advance.
    Regards,
    Martin

    The reason is that utl_encode returns a raw whereas dbms_lob.append expects either a blob or a clob.
    SQL> desc utl_encode;
    FUNCTION BASE64_DECODE RETURNS RAW
    Argument Name                  Type                    In/Out Default?
    R                              RAW                     IN   
    FUNCTION BASE64_ENCODE RETURNS RAW
    Argument Name                  Type                    In/Out Default?
    R                              RAW                     IN   
    FUNCTION MIMEHEADER_DECODE RETURNS VARCHAR2
    Argument Name                  Type                    In/Out Default?
    BUF                            VARCHAR2                IN   
    FUNCTION MIMEHEADER_ENCODE RETURNS VARCHAR2
    Argument Name                  Type                    In/Out Default?
    BUF                            VARCHAR2                IN   
    ENCODE_CHARSET                 VARCHAR2                IN     DEFAULT
    ENCODING                       BINARY_INTEGER          IN     DEFAULT
    FUNCTION QUOTED_PRINTABLE_DECODE RETURNS RAW
    Argument Name                  Type                    In/Out Default?
    R                              RAW                     IN   
    FUNCTION QUOTED_PRINTABLE_ENCODE RETURNS RAW
    Argument Name                  Type                    In/Out Default?
    R                              RAW                     IN   
    FUNCTION TEXT_DECODE RETURNS VARCHAR2
    Argument Name                  Type                    In/Out Default?
    BUF                            VARCHAR2                IN   
    ENCODE_CHARSET                 VARCHAR2                IN     DEFAULT
    ENCODING                       BINARY_INTEGER          IN     DEFAULT
    FUNCTION TEXT_ENCODE RETURNS VARCHAR2
    Argument Name                  Type                    In/Out Default?
    BUF                            VARCHAR2                IN   
    ENCODE_CHARSET                 VARCHAR2                IN     DEFAULT
    ENCODING                       BINARY_INTEGER          IN     DEFAULT
    FUNCTION UUDECODE RETURNS RAW
    Argument Name                  Type                    In/Out Default?
    R                              RAW                     IN   
    FUNCTION UUENCODE RETURNS RAW
    Argument Name                  Type                    In/Out Default?
    R                              RAW                     IN   
    TYPE                           BINARY_INTEGER          IN     DEFAULT
    FILENAME                       VARCHAR2                IN     DEFAULT
    PERMISSION                     VARCHAR2                IN     DEFAULT
    SQL> spool off

  • Problem with SDO_ADMIN.update_index procedure

    Hi all:
    We use for develpment Oracle 10g XE utilizing Oracle Spatial (SDO) in relational model , with this version works great, all procedures work with out problems.
    Recently we want try Oracle 11g, i create the schema, relational model, the same that in 10g XE.
    The problem is when i want to update the sdoindex tables with the function SDOADMIN.UPDATE_INDEX, no response are returned, no error o update of _sdoindex table.
    I try to use the procedure SDO_ADMIN.POPULATE_INDEX and the same situation.
    Also try to use the procedure POPULATE_INDEX with a wrong SDO_GID, in 10g Xe return a ORA-13182 error, and no error returned in 11g.
    In 10g XE i need to give permissions from MDSYS to the schema with the model, but in 11g i have the permission for execute the package.
    Also in the migration the tables have data and with this data the Geometry function works, i can query data and are found in the geometry, but no new data can be added.
    I copy some data to 10g XE and the functions and work great.
    I use the relational model, this is a example of tables.
    ROADS
    ROADS_SDODIM
    ROADS_SDOGEOM
    ROADS_SDOINDEX
    ROADS_SDOLAYER
    Any help will be appreciated
    Thanks
    Juan Pablo

    You may get better answers here :- Spatial

  • Problem with a PLSQL procedure

    Hi Guys
    Here a very small stored proc.
    CREATE OR REPLACE procedure PRODDATA.LECTX123 is
    type x123_aat is table of PRODDATA.CLIENTS%ROWTYPE index by PLS_INTEGER;
    l_x123 x123_aat;
    begin
    select * bulk collect into l_x123 from PRODDATA.CLIENTS;
    FOR indx IN 1 .. l_x123.COUNT
    LOOP
    null;
    END LOOP;
    end;
    A call to this procedure from SQL-PLUS give us a big nightmare. Paging space is 100% used and the HP-UX partition must be restarted !!!
    Why memory consumption on all the systems
    Global memory system is 120 GB
    SGA_TARGET = SGA_MAX_SIZE = 2 GB
    PGA_AGGREGATE_TARGET = 256 MB
    IT's very strange.
    Regards
    A.G.

    Andre-Guy wrote:
    It was just a test to reproduce an initial error. That mean that, to secure my servers I need to limit ressources on Oracle background processes to avoid this. IT's a solution but I agree not the explaination of this curious behaviour. What is curious about PL/SQL doing as instructed, fetching 16 million rows and attempting to allocate sufficient memory (private process memory) to store these rows?
    You can do the same with C/C++ program and a malloc() call. You could cause it by trying to load a 4GB text file into an editor on the server.
    The only curious thing in this regard is not using bulk processing in PL/SQL as it is supposed to be use. Bulk fetching is not about caching data in the PGA (PL/SQL private and dedicated memory), but about reducing context switching.
    As for "+limiting resources to avoid such a problem+", what about protecting the server against cartersian joins? Or badly designed SQL? Or a row-by-row processing instead of processing data sets? And so on...?
    Just where do you draw the line in trying to make the server (and its resource utilisation) idiot proof? Is it not better to educate these idiots in using the server correctly? Which means that instead of the server spending time trying to protect itself, it spends time running well designed and written production code?
    IMO the problem you describe is not one about server resource abuse, but ignorance. And that one fixes not by protecting the server, but by curing the ignorance. Doing bulk processing correctly is not rocket science either.

  • Problem with a stored procedure to search in a table

    h5.
    Hi,
    h5.
    As many people on the forum, I'm new on PL/SQL programming.
    h5.
    I'm trying to program a stored procedure that allow to search on my table fields with different parameters.
    h5.
    All this parameters doesn't need to be set, at least one.
    h5.
    I'm looking for the solution from 2 weeks ago.
    h5.
    I have looked everywhere
    h5.
    Could someone help me, please??
    h5.
    Here is my code:
    * HERE WE CREATE PACKAGE FOR THE CURSOR
    create or replace
    PACKAGE HOTEL_DEST_PKG
    IS
    /* Define the REF CURSOR type. */
    TYPE HOTEL_DEST_TYPE IS REF CURSOR;
    END HOTEL_DEST_PKG;
    * HERE WE CREATE OUR STORE PROCEDURE TO SEARCH
    create or replace
    PROCEDURE Search_Hotel (
    IdDocument IN number,
    MyFilter IN VARCHAR2,
    IdCountry IN number,
    DepartureDateFirst IN DATE,
    DepartureDateSecond IN DATE,
    HD_Cursor OUT HOTEL_DEST_PKG.HOTEL_DEST_TYPE)
    IS
    SQL_REQ VARCHAR2(5000);
    BEGIN
    /* all columns were entered */
    IF ((IdDocument > 0) OR
    ((MyFilter IS NOT NULL) AND (length(MyFilter) > 0)) OR
    (IdCountry > 0) OR
    (DepartureDateFirst IS NOT NULL) OR
    (DepartureDateSecond IS NOT NULL))
    THEN
    SQL_REQ := 'SELECT HOTEL_DESTINATION.*
    FROM HOTEL_DESTINATION
    WHERE 1=1';
    /* Search on the hotel id*/
    IF IdDocument > 0 THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_ID = :IdDocument';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :IdDocument IS NULL';
    END IF;
         /*Search on different indexed fields*/
    IF MyFilter IS NOT NULL AND LENGTH(MyFilter)>0 THEN
    SQL_REQ := SQL_REQ || ' AND CONTAINS(HOTEL_DESTINATION.HD_FILTER, :MyFilter)';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :MyFilter IS NULL';
    END IF;
    /* Search on the hotel country id*/
    IF IdCountry > 0 THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_CN_ID = :IdCountry';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :IdCountry IS NULL';
    END IF;
    /* Search on the dates*/
    IF DepartureDateFirst IS NOT NULL THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_DEPARTURE_DATE >= :DepartureDateFirst';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :DepartureDateFirst IS NULL' ;
    END IF;
    IF DepartureDateSecond IS NOT NULL THEN
    SQL_REQ := SQL_REQ || ' AND HOTEL_DESTINATION.HD_DEPARTURE_DATE <= :DepartureDateSecond';
    ELSE
    SQL_REQ := SQL_REQ || ' AND :DepartureDateSecond IS NULL';
    END IF;
    OPEN HD_CURSOR FOR SQL_REQ USING IdDocument,
    MyFilter,
    IdCountry,
    DepartureDateFirst,
    DepartureDateSecond;
    END IF;
    END;
    * HERE WE CALL AND EXECUTE OUR STORE PROCEDURE TO SEARCH
    * ON WORD
    set serveroutput on
    DECLARE
         IDDOCUMENT NUMBER;
         MYFILTER VARCHAR2(200);
         IDCOUNTRY NUMBER;
         DEPARTUREDATEFIRST IN DATE;
         DEPARTUREDATESECOND IN DATE;
         HD_CURSOR OUT HOTEL_DEST_PKG.HOTEL_DEST_TYPE);
    BEGIN
    IDDOCUMENT := 0;
    MYFILTER := 'test';
    IDCOUNTRY := 0;
    DEPARTUREDATEFIRST := NULL;
    DEPARTUREDATESECOND := NULL;
    SEARCH_HOTEL(
    IDDOCUMENT => IDDOCUMENT,
    MYFILTER => MYFILTER,
    IDCOUNTRY => IDCOUNTRY,
    DEPARTUREDATEFIRST => DEPARTUREDATEFIRST,
    DEPARTUREDATESECOND => DEPARTUREDATESECOND,
    HD_Cursor => HD_Cursor
    -- Modify the code to output the variable
    --DBMS_OUTPUT.PUT_LINE('HD_Cursor = ' || HD_Cursor);
    END;

    You need to grant right on the table to the owner of the stored procedure directly (not via Role).
    When there are only rights via role everything is fine in sql, but it will not work in stored procedures, functions or packages.
    So as Table-Owner do:
    grant select on <table> to <procedure, package or function-owner>;Edited by: hm on 22.10.2010 08:49

  • Problem with new pricing procedure - free of cost

    i set up a new pricing procedure where i have zsed (special excise duty) and zmws (sales tax) set as manual, it's not valid on some free sample orders. but when i goto create order it does not show up under conditions, even though i've maintained it for that material in vk11. and when i click on condition type in conditions, it doesn't show up in the drop down either (at the order level). if i just type zsed it says zsed cannot be processed manually.
    but if i change the pricing procedure and take off the manual check mark, the tax shows up on the same order automatically (from vk11) but i can't delete it there.
    suggestions? i need for it to show up or have an option where if it shows up i can delete it. thanks!

    fyi,
    If you set the "Manual" indicator in pricing procedure against to any condition type, then you can enter this condition type value in particular transaction. ( But for this condition type details, " changes can be made- setting maintain as "D" not possible to process manuall). Same "manual" logic in the pricing procedure will not work.
                  Because controls in Condition type has priority than anyother.
    Now coming to your question,
               If I understood it properly,
    ZSED is not applicable to every free of cost order, but it may be applicable to other orders ( excl: FOC orders). Expecting ZSED Condition type maintained in both pricing procedures ( FOC sales pricing procedure & non FOC sales procedure).
    if you set the " Manual entries has priority"/ tick mark delete check box in ZSED, then it will allow to enter manually/delete the condition type in FOC order as well as non FOC orders too.
    Then there could be chance that user may delete/manually enter ZSED in non FOC sales.
    better way would be, create new conditiont table by including Sales document type ( assume you created new document type for FOC sales) with other required fields ( eg: customer/material etc..,).
    assign this condition table in top of all the accesses in ZSED's access sequence.
    Maintain Condition record.
    By doing so, Condition record is applicable only to FOC doc type sales- if maintained , else it will search next condition record.
    which will not effect the non FOC sales & user cant delete ZSED from non FOC sales.
    Hope it helps

  • Problems with java stored procedure.

    I have a java stored procedure that uses a package called RmiJdbc
    which allows calling remote JDBC data sources from any java capable
    machine.
    I've loaded the RmiJdbc classes into oracle via the loadjava
    command and everything seems to come up valid.
    The stored procedure does a Class.forName() to get the driver
    registered, than attempts to connect to the remote RMI driver.
    The particular line it dies on is this (see the error below):
    c = DriverManager.getConnection("jdbc:rmi:" + rmiHost + "/" + url);
    A mangled version of this (minus the Oracle specific stuff) works
    from the command line correctly. Can somebody point me in a
    direction to figure out what's going on here?
    THanks,
    Eric
    Oracle9i Enterprise Edition Release 9.0.1.3.0 - 64bit Production
    With the Partitioning option
    JServer Release 9.0.1.3.0 - Production
    ORACLE_HOME = /oracle/v901ee
    System name: HP-UX
    Node name: athena
    Release: B.11.00
    Version: A
    Machine: 9000/889
    Instance name: PASDB2
    Redo thread mounted by this instance: 1
    Oracle process number: 13
    Unix process pid: 7839, image: oracle@athena (TNS V1-V3)
    *** SESSION ID:(8.547) 2002-08-15 15:41:27.221
    java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    java.lang.NullPointerException
    at sun.rmi.server.LoaderHandler$LoaderKey.<init>(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.lookupLoader(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java)
    at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputArray(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java)
    at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.inputObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java)
    at sun.rmi.registry.RegistryImpl_Stub.lookup
    at org.objectweb.rmijdbc.RJConnection.<init>(RJConnection:83)
    at org.objectweb.rmijdbc.Driver.connect(Driver:135)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)
    java.sql.SQLException: Error unmarshaling return; nested exception is:
    java.lang.NullPointerException
    at org.objectweb.rmijdbc.Driver.connect(Driver:140)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at java.sql.DriverManager.getConnection(DriverManager.java)
    at TurnoverInfoPlusInterface.insertInterfaceRecords(TurnoverInfoPlusInterface:53)

    More info...I'm also seeing "ORA-03113: end-of-file on communication channel". I checked the user trace file and didn't get much help...it indicated an "exception signal: 11" and core-dump type stuff that had no meaning to me.

  • Problem with JDBC stored procedure

    Hi...
    We are implementing an interface from SAP r/3 4.7 to Oracle DB 9.0. On sender side we have used IDOC Adapter and on Receiver side we have used JDBC Adapter.
    Here we are using stored procedures in JDBC Adapter. I have 2 stored procedures(one for header and one for items) and SISCSO.SISCSO01 IDOC.
    Here we are getting following error in RWB for JDBC Receiver adapter....
    <b>Error</b>
    " Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
    Configured at 2006-08-16 10:12:14 GMT+05:30
    History:
    - 2006-08-16 11:02:04 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. 'PR_SPARES_VOR_PO_HDR_UPLOAD' (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00201: identifier 'PR_SPARES_VOR_PO_HDR_UPLOAD' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored ".
    <b>My mapping file is like this.....</b>
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:TVS_MST_SPARES_ORDER xmlns:ns0="urn:tvsmotor:salesorder"><statement><PR_SPARES_VOR_PO_HDR_UPLOAD action="execute"><table>PR_SPARES_VOR_PO_HDR_UPLOAD</table><IN_DEALER_ID isInput="true" type="String">efde</IN_DEALER_ID><IN_SPARE_PO_NO isInput="TRUE" type="STRING">sdfsdf</IN_SPARE_PO_NO><IN_PO_DATE isInput="TRUE" type="STRING">12.12.2555</IN_PO_DATE><IN_ORDER_TYPE isInput="TRUE" type="STRING">23</IN_ORDER_TYPE><IN_REMARKS isInput="TRUE" type="STRING">Remark</IN_REMARKS><IN_SAP_SALE_ORD_NO isInput="TRUE" type="STRING">146546</IN_SAP_SALE_ORD_NO><IN_SAP_SALE_ORD_DT isInput="TRUE" type="STRING">12.12.2555</IN_SAP_SALE_ORD_DT><IN_TOT_VAL isInput="TRUE" type="STRING">2323</IN_TOT_VAL></PR_SPARES_VOR_PO_HDR_UPLOAD><PR_SPARES_VOR_PO_DTL_UPLOAD action="execute"><IN_DEALER_ID isInput="TRUE" type="STRING">efde</IN_DEALER_ID><IN_SPARE_PO_NO isInput="TRUE" type="STRING">sdfsdf</IN_SPARE_PO_NO><IN_PO_DATE isInput="TRUE" type="STRING">12.12.2555</IN_PO_DATE><IN_PART_NO isInput="TRUE" type="STRING">cfgdfw4w</IN_PART_NO><IN_ORDER_QTY isInput="TRUE" type="STRING">2</IN_ORDER_QTY><IN_PENDING_QTY isInput="TRUE" type="STRING">20</IN_PENDING_QTY><IN_RATE isInput="TRUE" type="STRING">2432</IN_RATE><IN_TAX isInput="TRUE" type="STRING">18</IN_TAX></PR_SPARES_VOR_PO_DTL_UPLOAD></statement></ns0:TVS_MST_SPARES_ORDER>
    Please help me out with this error... tell me if more information is required.
    Thanks,
    Audumbar.

    hi mario,
    tell me one thing.... does case metter for stored procedure name? and even for the parameters used in stored procedure?
    i have changed the case of stored procedure name... (its small in Oracle) but have not changed the case of parameters....
    after changing the case also i m getting the following error....
    " Receiver Adapter v2112 for Party '', Service 'BS_ORADEV':
    Configured at 2006-08-16 10:12:14 GMT+05:30
    History:
    - 2006-08-16 14:18:19 GMT+05:30: Error: TransformException error in xml processor class: Error processing request in sax parser: Error when executing statement for table/stored proc. <b>'pr_spares_vor_po_hdr_upload'</b> (structure 'statement'): java.sql.SQLException: ORA-06550: line 1, column 7:
    PLS-00201: identifier <b>'PR_SPARES_VOR_PO_HDR_UPLOAD'</b> must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored "
    Reply me as soon as possible.
    Thanx,
    Regards,
    Audumbar
    Message was edited by: Audumbar Pikle

Maybe you are looking for