Results 1 to 8 of 8

Thread: Using Api

  1. #1
    Join Date
    Jul 2007
    Posts
    6

    Exclamation Unanswered: Using Api

    I am getting an error: PLS-00306: wrong number or types of arguments in call to 'MODIFY_ITEM'


    declare

    l_item portal.wwsbr_all_items%ROWTYPE;
    l_perspectives wwsbr_all_perspectives%ROWTYPE;
    l_item_ID number;
    l_attribute_id portal.wwsbr_type.array;
    l_attribute_caid portal.wwsbr_type.array;
    l_attribute_data_type portal.wwsbr_type.array;
    l_attribute_value portal.wwsbr_type.array;
    I integer;

    select *
    into l_item
    from wwsbr_all_items
    where masterID = 41089;
    select *
    into l_perspectives
    from WWSBR_ALL_PERSPECTIVES
    where name = 'radio';



    l_item_id := portal.wwsbr_api.modify_item
    (



    p_perspectives => l_perspectives.id,
    p_perspectives_caid => l_perspectives.caid

    );

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    MODIFY_ITEM function requires parameter(s). Using the PL/SQL code you have written, you
    a) didn't pass all parameters,
    b) one or more parameters differ in data type,
    c) both of the above.

    Which one of those is it is impossible to say as you didn't post the MODIFY_ITEM function code (or, at least, its declaration).

    Also, next time format the code using the [CODE] tags and, please, avoid colors that make it difficult to read (as you did this time; it is ... what, 40% black? Less?).

  3. #3
    Join Date
    Jul 2007
    Posts
    6

    Question

    hey thanks for the reply, Im new to this, so please bare with me, what parameters am I missing? and isn't me setting the item = to portal.wwsbr_api.modify_item the function?

    Code:
    SET SERVEROUTPUT ON
    
      declare
    
        l_item portal.wwsbr_all_items%ROWTYPE;
        l_perspectives wwsbr_all_perspectives%ROWTYPE;
        l_item_ID number;
        l_attribute_id portal.wwsbr_type.array;
        l_attribute_caid portal.wwsbr_type.array;
        l_attribute_data_type portal.wwsbr_type.array;
        l_attribute_value portal.wwsbr_type.array;
        I integer;
        
      begin
      
      wwctx_api.set_context('portal','password');
    
        --Get the item information
        select *
        into l_item
        from wwsbr_all_items
        where masterID = 41089;
         select *
        into l_perspectives
        from WWSBR_ALL_PERSPECTIVES
        where name = 'FOOT';
        
        
        
         l_item_id := portal.wwsbr_api.modify_item
           (
            
            
            
            p_perspectives => l_perspectives.id,
            p_perspectives_caid => l_perspectives.caid
           
           );
           
           dbms_output.put_line('The Item was updated');
             end;
    Last edited by joshboski; 07-13-07 at 11:34.

  4. #4
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    We are at the beginning again.

    How does the MODIFY_ITEM function look like?

    This part of the code is calling it:
    Code:
         l_item_id := portal.wwsbr_api.modify_item
           (
            
            
            
            p_perspectives => l_perspectives.id,
            p_perspectives_caid => l_perspectives.caid
           
           );
    Now, it *may* be that blank lines cause problems here, so - what happens if you remove them, so that the code looks like this:
    Code:
         l_item_id := portal.wwsbr_api.modify_item
           (p_perspectives => l_perspectives.id,
            p_perspectives_caid => l_perspectives.caid
           );

  5. #5
    Join Date
    Jul 2007
    Posts
    6
    I deleted those extra lines, didnt change anything, and what do you mean when you say



    How does the MODIFY_ITEM function look like?

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    This is the error: "PLS-00306: wrong number or types of arguments in call to 'MODIFY_ITEM'"

    We know what you do to call the MODIFY_ITEM function - it is the "l_item_id := ..." line.

    But we still don't know how the MODIFY_ITEM function looks like. I'd like to see
    Code:
    CREATE OR REPLACE FUNCTION modify_item (par_1 number, par_2 number, par_3 char) return number
    is
    begin 
       ...
    end;
    It is practically impossible to guess what you did wrong if you don't provide complete information about the case.

    In other words: are p_perspectives and p_perspectives_caid the ONLY parameters? "_ID" suggests that those are NUMBERS. Are they? How does the "WWSBR_ALL_PERSPECTIVES" table look like? You used its values as IN parameters for the function. Did you match those data types or not?

    [As the time goes by, more and more it looks like another my car is broken thread ...]

  7. #7
    Join Date
    Jul 2007
    Posts
    6
    wwvallperspectives table

    Column Name ID Data Type Null?

    PARENTID 3 NUMBER Y
    NAME 5 VARCHAR2 (60 Byte) Y
    LANGUAGE 4 VARCHAR2 (30 Byte) N
    ID 1 NUMBER N
    DISPLAY_NAME 6 VARCHAR2 (240 Byte) N
    CAID 2 NUMBER N

  8. #8
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    issue the following command

    desc portal.wwctx_api

    This will list all the procedures and functions in the package and all their parameters.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •