Forum Stats

  • 3,750,344 Users
  • 2,250,158 Discussions
  • 7,866,941 Comments

Discussions

Package errors

buggleboy007
buggleboy007 Member Posts: 280 Bronze Badge

Hi all,

I am creating a package where in the INPUT parameter is also an associative array and so also the output parameter. When I compile I get the following error. What is the reason for this? Is it that the input parameter cannot be an array type?

My package specs is below the error.

SQL> SHOW ERRORS;
Errors for PACKAGE MERCH.POSTOMERCHDIRECTTRANSFER:
LINE/COL ERROR
-------- --------------------------------------------
70/73  PLS-00488: 'L_TRANSFER_ID_AA' must be a type
0/0   PL/SQL: Compilation unit analysis terminated



CREATE OR REPLACE PACKAGE POStoMerchDirectTransfer
IS 
--Global public variables
 TYPE transfer_id_aa IS TABLE OF NUMBER(20) INDEX BY PLS_INTEGER;
 l_transfer_id_aa transfer_id_aa;


 TYPE iripostransferdetails_rt IS RECORD
		       (Businessunitid       IRI_POS_TRANSFERS.business_unit_id%TYPE,
		       Transfer_id        IRI_POS_TRANSFERS.transfer_id%TYPE,  
		       transfer_occurence_type  IRI_POS_TRANSFERS.transfer_occurence_type%TYPE,       
		       line_no          IRI_POS_TRANSFERS.line_no%TYPE,               
		       prgid           IRI_POS_TRANSFERS.prgid%TYPE,                
		       transfer_type       IRI_POS_TRANSFERS.transfer_type%TYPE,            
		       request_id         IRI_POS_TRANSFERS.request_id%TYPE,             
		       from_site         IRI_POS_TRANSFERS.from_site%TYPE,              
		       to_site          IRI_POS_TRANSFERS.to_site%TYPE,               
		       bar_code_bus_unit_id    IRI_POS_TRANSFERS.bar_code_bus_unit_id%TYPE,        
		       bar_code_sub_type     IRI_POS_TRANSFERS.bar_code_sub_type%TYPE,          
		       bar_code_id        IRI_POS_TRANSFERS.bar_code_id%TYPE,             
		       style_id          IRI_POS_TRANSFERS.style_id%TYPE,              
		       color_id          IRI_POS_TRANSFERS.color_id%TYPE,              
		       dimension_id        IRI_POS_TRANSFERS.dimension_id%TYPE,            
		       valid_dimension_id     IRI_POS_TRANSFERS.valid_dimension_id%TYPE,         
		       size_id          IRI_POS_TRANSFERS.size_id%TYPE,               
		       valid_size_id       IRI_POS_TRANSFERS.valid_size_id%TYPE,            
		       item_qty          IRI_POS_TRANSFERS.item_qty%TYPE,              
		       valid_ind         IRI_POS_TRANSFERS.valid_ind%TYPE,              
		       status           IRI_POS_TRANSFERS.status%TYPE,               
		       site_id          IRI_POS_TRANSFERS.site_id%TYPE,               
		       valid_header        IRI_POS_TRANSFERS.valid_header%TYPE,            
		       valid_detail        IRI_POS_TRANSFERS.valid_detail%TYPE,            
		       reason_id         IRI_POS_TRANSFERS.reason_id%TYPE,              
		       transfer_origin_name    IRI_POS_TRANSFERS.transfer_origin_name%TYPE,        
		       from_site_retail_value   IRI_POS_TRANSFERS.from_site_retail_value%TYPE,       
		       to_site_retail_value    IRI_POS_TRANSFERS.to_site_retail_value%TYPE,        
		       unit_cost         IRI_POS_TRANSFERS.unit_cost%TYPE,              
		       expense_transfer_id    IRI_POS_TRANSFERS.expense_transfer_id%TYPE,         
		       rej_rpt_printed_ind    IRI_POS_TRANSFERS.rej_rpt_printed_ind%TYPE,         
		       rejected_id        IRI_POS_TRANSFERS.rejected_id%TYPE,             
		       reason_sub_type      IRI_POS_TRANSFERS.reason_sub_type%TYPE,           
		       process_status       IRI_POS_TRANSFERS.process_status%TYPE,           
		       process_date_time     IRI_POS_TRANSFERS.process_date_time%TYPE,          
		       richter_version_id     IRI_POS_TRANSFERS.richter_version_id%TYPE,         
		       pos_version_id       IRI_POS_TRANSFERS.pos_version_id%TYPE,           
		       control_no         IRI_POS_TRANSFERS.control_no%TYPE,             
		       user_trace_id       IRI_POS_TRANSFERS.user_trace_id%TYPE,            
		       user_id          IRI_POS_TRANSFERS.user_id%TYPE,               
		       ride_error_code      IRI_POS_TRANSFERS.ride_error_code%TYPE,           
		       severity_code       IRI_POS_TRANSFERS.severity_code%TYPE,            
		       inventory_adjust_id    IRI_POS_TRANSFERS.inventory_adjust_id%TYPE,         
		       from_business_unit_id   IRI_POS_TRANSFERS.from_business_unit_id%TYPE,        
		       to_business_unit_id    IRI_POS_TRANSFERS.to_business_unit_id%TYPE,         
		       cancel_ind         IRI_POS_TRANSFERS.cancel_ind%TYPE,             
		       pos_transfer_id      IRI_POS_TRANSFERS.pos_transfer_id%TYPE,           
		       date_created        IRI_POS_TRANSFERS.date_created%TYPE,            
		       process_date_created    IRI_POS_TRANSFERS.process_date_created%TYPE,        
		       ride_out_date       IRI_POS_TRANSFERS.ride_out_date%TYPE,            
		       transfer_date       IRI_POS_TRANSFERS.transfer_date%TYPE,            
		       user_in_date        IRI_POS_TRANSFERS.user_in_date%TYPE,            
		       --fkdomshipmentid     IRI_POS_TRANSFERS.fkdomshipmentid%TYPE,           
		       rma_code          IRI_POS_TRANSFERS.rma_code%TYPE,              
		       ref_dom_order_id      IRI_POS_TRANSFERS.web_order_id%TYPE  
         
		     );
		      
		     TYPE lv_iripostransferdetails_aa  IS TABLE OF iripostransferdetails_rt INDEX BY PLS_INTEGER;

	      
 procedure accept_transfer_transferdetails( p_NbrInTransfer_id  IN  l_transfer_id_aa,  																			                    p_aaoutiriposdetails OUT lv_iripostransferdetails_aa 																			  	 );    																			  	
END POStoMerchDirectTransfer;  
 																			  	
/ 																				

     

     

      

    

          

          

          

Best Answers

  • Frank Kulash
    Frank Kulash Member, Moderator Posts: 40,887 Red Diamond
    Accepted Answer

    Hi, @buggleboy007

    As the error message says, l_transfer_id_aa is not a TYPE; it's variable of type transfer_id_aa.

    If you have a procedure called proc_x that takes a NUMBER argument, and you plan to call it with a NUMBER variable named amt, you don't declare the procedure as

    PROCEDURE proc_x (arg1  IN  amt)  -- WRONG!
    

    No, you declare if with amt's type

    PROCEDURE proc_x (arg1  IN  NUMBER)
    

    It's the same with user-defined types.

    buggleboy007
  • Alex Nuijten
    Alex Nuijten Member Posts: 169 Silver Badge
    Accepted Answer
    l_transfer_id_aa
    

    is a variable that you declared in the package.


    Like the error says: it's not a datatype

    Change the procedure to

     procedure accept_transfer_transferdetails( p_NbrInTransfer_id  IN  transfer_id_aa,  																			                    p_aaoutiriposdetails OUT lv_iripostransferdetails_aa 																			  	 );   
    

    and it should work

    buggleboy007

Answers