'PLS-00363: expression..' error when executing a stored procedure..

Hello,
I'm trying to run a PLSQL script containing an ORACLE API but its failing on compilation with the message:
'PLS-00363: expression '<expression>' cannot be used as an assignment target'.
As far as I understand its connected to my IN-OUT parameters but I can't figure out which (I must admit I'm still hiking up a steep learning curve here and I've cut and pasted someone elses example and modified it).
I would be most grateful if one of you pro's could read through my code and advise..
SET serveroutput ON SIZE 1000000 FORMAT WRAPPED
SET verify OFF
SET feedback OFF
DECLARE
   error_msg                   varchar2(2000) := '';       
   l_status           varchar2(10) := 'True';       
   l_validate_cnt           number;                       
   l_ass_count           number;                       
   l_business_group_id        number := 0;               
    l_validate          BOOLEAN DEFAULT FALSE;                                   
   l_city                       varchar2(30);
   l_mode              varchar2(20) := 'UPDATE'; 
   l_sup_join_date           date;
   l_organization_id            hr_organization_units.organization_id%type;
   l_person_id                  per_all_people_f.person_id%type;
   l_object_version_number      per_all_assignments_f.object_version_number%type;
   l_job_id                     per_jobs.job_id%type;
   l_position_id                per_positions.position_id%type;
   l_location_id               number := 233;  -- number;
   l_grade_id              number := 3; --      per_grades.grade_id%type;
   l_supervisor_id       number := 2; --        per_all_assignments_f.supervisor_id%type;
   l_assignment_status_type_id  number;
   l_pay_basis_id           number := 33;
   l_join_date           date;
   l_assignment_id                per_all_assignments_f.assignment_id%type;
   l_soft_coding_keyflex_id       per_all_assignments_f.soft_coding_keyflex_id%type;
   l_people_group_id              per_all_assignments_f.people_group_id%type;
   l_payroll_id                   per_all_assignments_f.payroll_id%type;
   l_effective_start_date         per_all_assignments_f.effective_start_date%type;
   l_effective_end_date           per_all_assignments_f.effective_end_date%type;
   l_assignment_sequence          per_all_assignments_f.assignment_sequence%type;
   l_comment_id                   per_all_assignments_f.comment_id%type;
   l_concatenated_segments        varchar2(240);
   l_group_name                   varchar2(100);
   l_other_manager_warning        boolean;
   l_org_now_no_manager_warning   boolean;
   l_spp_delete_warning           boolean;
   l_entries_changed_warning      varchar2(200);
   l_tax_district_changed_warning boolean;
   l_special_ceiling_step_id      number;
   l_no_managers_warning          boolean;
   l_other_manager_warnings       boolean;
   l_cagr_grade_def_id            number;
   l_cagr_concatenated_segments   varchar2(100);
   l_total_records             number := 0;
   l_success_records          number := 0;
   l_failure_records          number := 0;
BEGIN
   dbms_output.put_line('#############################################################');
   dbms_output.put_line('Data Migration Of Employee Assignments :');
   dbms_output.put_line('#############################################################');
   dbms_output.put_line('Start Time : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));  
      l_person_id      := null;
      l_object_version_number := null;
      l_organization_id   := 0;
      l_location_id      := null;
      l_grade_id      := null;
      l_job_id      := null;
      l_position_id           := null;
      l_supervisor_id           := null;
      l_assignment_status_type_id := null;
      error_msg      := null;
      l_status      := 'True';
            hr_assignment_api.update_emp_asg_criteria
     p_validate                     => l_validate
               ,p_effective_date               => sysdate --to_date('11-Jan-2009','DD-MON-YYYY')
               ,p_datetrack_update_mode        => l_mode                     
               ,p_assignment_id                => l_assignment_id   
               ,p_object_version_number        => l_object_version_number +1   
               ,p_organization_id              => l_organization_id 
               ,p_location_id                  => l_location_id --assignment_v.location_id
               ,p_grade_id                     => l_grade_id
               ,p_job_id                       => l_job_id
               ,p_position_id                  => l_position_id
               ,p_payroll_id                   => l_payroll_id --21--hardcoding this you should change this
         --      ,p_segment1                     => assignment_v.people_group
       --        ,p_employment_category          => assignment_v.employee_category
               ,p_pay_basis_id                 => l_pay_basis_id
               ,p_special_ceiling_step_id      => l_special_ceiling_step_id    
               ,p_people_group_id              => l_people_group_id            
               ,p_group_name                   => l_group_name                 
               ,p_org_now_no_manager_warning   => l_org_now_no_manager_warning 
               ,p_effective_start_date         => l_effective_start_date       
               ,p_effective_end_date           => l_effective_end_date         
               ,p_other_manager_warning        => l_other_manager_warning      
               ,p_spp_delete_warning           => l_spp_delete_warning         
               ,p_entries_changed_warning      => l_entries_changed_warning    
               ,p_tax_district_changed_warning => l_tax_district_changed_warning
            hr_assignment_api.update_emp_asg
       p_validate                   => l_validate --false                       
               ,p_effective_date             => to_date('11-Jan-2009','DD-MON-YYYY') --assignment_v.date_of_change                      
               ,p_datetrack_update_mode      => 'CORRECTION'                    
               ,p_assignment_id              => l_assignment_id  
               ,p_object_version_number      => l_object_version_number   
               ,p_supervisor_id              => l_supervisor_id
               ,p_normal_hours               => '7.5' 
               ,p_frequency                  => 'D'
               ,p_time_normal_start          => '09:30'
               ,p_time_normal_finish         => '17:30'
               ,p_soft_coding_keyflex_id     => l_soft_coding_keyflex_id    
               ,p_comment_id                 => l_comment_id                
               ,p_effective_start_date       => l_effective_start_date      
               ,p_effective_end_date         => l_effective_end_date        
               ,p_concatenated_segments      => l_concatenated_segments     
               ,p_no_managers_warning        => l_no_managers_warning       
               ,p_other_manager_warning      => l_other_manager_warnings    
               ,p_cagr_grade_def_id          => l_cagr_grade_def_id         
               ,p_cagr_concatenated_segments => l_cagr_concatenated_segments
dbms_output.put_line('End Time   : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
   dbms_output.put_line('          
END;
commit;
exit;many thanks,
Steven

Thanks for the suggestions people. Here's the other API description requested:
PROCEDURE UPDATE_EMP_ASG
Argument Name                  Type                    In/Out Default?
P_VALIDATE                     BOOLEAN                 IN     DEFAULT
P_EFFECTIVE_DATE               DATE                    IN   
P_DATETRACK_UPDATE_MODE        VARCHAR2                IN   
P_ASSIGNMENT_ID                NUMBER                  IN   
P_OBJECT_VERSION_NUMBER        NUMBER                  IN/OUT
P_SUPERVISOR_ID                NUMBER                  IN     DEFAULT
P_ASSIGNMENT_NUMBER            VARCHAR2                IN     DEFAULT
P_CHANGE_REASON                VARCHAR2                IN     DEFAULT
P_ASSIGNMENT_STATUS_TYPE_ID    NUMBER                  IN     DEFAULT
P_COMMENTS                     VARCHAR2                IN     DEFAULT
P_DATE_PROBATION_END           DATE                    IN     DEFAULT
P_DEFAULT_CODE_COMB_ID         NUMBER                  IN     DEFAULT
P_FREQUENCY                    VARCHAR2                IN     DEFAULT
P_INTERNAL_ADDRESS_LINE        VARCHAR2                IN     DEFAULT
P_MANAGER_FLAG                 VARCHAR2                IN     DEFAULT
P_NORMAL_HOURS                 NUMBER                  IN     DEFAULT
P_PERF_REVIEW_PERIOD           NUMBER                  IN     DEFAULT
P_PERF_REVIEW_PERIOD_FREQUENCY VARCHAR2                IN     DEFAULT
P_PROBATION_PERIOD             NUMBER                  IN     DEFAULT
P_PROBATION_UNIT               VARCHAR2                IN     DEFAULT
P_SAL_REVIEW_PERIOD            NUMBER                  IN     DEFAULT
P_SAL_REVIEW_PERIOD_FREQUENCY  VARCHAR2                IN     DEFAULT
P_SET_OF_BOOKS_ID              NUMBER                  IN     DEFAULT
P_SOURCE_TYPE                  VARCHAR2                IN     DEFAULT
P_TIME_NORMAL_FINISH           VARCHAR2                IN     DEFAULT
P_TIME_NORMAL_START            VARCHAR2                IN     DEFAULT
P_BARGAINING_UNIT_CODE         VARCHAR2                IN     DEFAULT
P_LABOUR_UNION_MEMBER_FLAG     VARCHAR2                IN     DEFAULT
P_HOURLY_SALARIED_CODE         VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE_CATEGORY       VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE1               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE2               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE3               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE4               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE5               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE6               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE7               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE8               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE9               VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE10              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE11              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE12              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE13              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE14              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE15              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE16              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE17              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE18              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE19              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE20              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE21              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE22              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE23              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE24              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE25              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE26              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE27              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE28              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE29              VARCHAR2                IN     DEFAULT
P_ASS_ATTRIBUTE30              VARCHAR2                IN     DEFAULT
P_TITLE                        VARCHAR2                IN     DEFAULT
P_SEGMENT1                     VARCHAR2                IN     DEFAULT
P_SEGMENT2                     VARCHAR2                IN     DEFAULT
P_SEGMENT3                     VARCHAR2                IN     DEFAULT
P_SEGMENT4                     VARCHAR2                IN     DEFAULT
P_SEGMENT5                     VARCHAR2                IN     DEFAULT
P_SEGMENT6                     VARCHAR2                IN     DEFAULT
P_SEGMENT7                     VARCHAR2                IN     DEFAULT
P_SEGMENT8                     VARCHAR2                IN     DEFAULT
P_SEGMENT9                     VARCHAR2                IN     DEFAULT
P_SEGMENT10                    VARCHAR2                IN     DEFAULT
P_SEGMENT11                    VARCHAR2                IN     DEFAULT
P_SEGMENT12                    VARCHAR2                IN     DEFAULT
P_SEGMENT13                    VARCHAR2                IN     DEFAULT
P_SEGMENT14                    VARCHAR2                IN     DEFAULT
P_SEGMENT15                    VARCHAR2                IN     DEFAULT
P_SEGMENT16                    VARCHAR2                IN     DEFAULT
P_SEGMENT17                    VARCHAR2                IN     DEFAULT
P_SEGMENT18                    VARCHAR2                IN     DEFAULT
P_SEGMENT19                    VARCHAR2                IN     DEFAULT
P_SEGMENT20                    VARCHAR2                IN     DEFAULT
P_SEGMENT21                    VARCHAR2                IN     DEFAULT
P_SEGMENT22                    VARCHAR2                IN     DEFAULT
P_SEGMENT23                    VARCHAR2                IN     DEFAULT
P_SEGMENT24                    VARCHAR2                IN     DEFAULT
P_SEGMENT25                    VARCHAR2                IN     DEFAULT
P_SEGMENT26                    VARCHAR2                IN     DEFAULT
P_SEGMENT27                    VARCHAR2                IN     DEFAULT
P_SEGMENT28                    VARCHAR2                IN     DEFAULT
P_SEGMENT29                    VARCHAR2                IN     DEFAULT
P_SEGMENT30                    VARCHAR2                IN     DEFAULT
P_CONCAT_SEGMENTS              VARCHAR2                IN     DEFAULT
P_CONTRACT_ID                  NUMBER                  IN     DEFAULT
P_ESTABLISHMENT_ID             NUMBER                  IN     DEFAULT
P_COLLECTIVE_AGREEMENT_ID      NUMBER                  IN     DEFAULT
P_CAGR_ID_FLEX_NUM             NUMBER                  IN     DEFAULT
P_CAG_SEGMENT1                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT2                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT3                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT4                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT5                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT6                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT7                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT8                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT9                 VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT10                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT11                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT12                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT13                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT14                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT15                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT16                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT17                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT18                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT19                VARCHAR2                IN     DEFAULT
P_CAG_SEGMENT20                VARCHAR2                IN     DEFAULT
P_NOTICE_PERIOD                NUMBER                  IN     DEFAULT
P_NOTICE_PERIOD_UOM            VARCHAR2                IN     DEFAULT
P_EMPLOYEE_CATEGORY            VARCHAR2                IN     DEFAULT
P_WORK_AT_HOME                 VARCHAR2                IN     DEFAULT
P_JOB_POST_SOURCE_NAME         VARCHAR2                IN     DEFAULT
P_SUPERVISOR_ASSIGNMENT_ID     NUMBER                  IN     DEFAULT
P_CAGR_GRADE_DEF_ID            NUMBER                  IN/OUT
P_CAGR_CONCATENATED_SEGMENTS   VARCHAR2                OUT  
P_CONCATENATED_SEGMENTS        VARCHAR2                OUT  
P_SOFT_CODING_KEYFLEX_ID       NUMBER                  IN/OUT
P_COMMENT_ID                   NUMBER                  OUT  
P_EFFECTIVE_START_DATE         DATE                    OUT  
P_EFFECTIVE_END_DATE           DATE                    OUT  
P_NO_MANAGERS_WARNING          BOOLEAN                 OUT  
P_OTHER_MANAGER_WARNING        BOOLEAN                 OUT  
P_HOURLY_SALARIED_WARNING      BOOLEAN                 OUT  
P_GSP_POST_PROCESS_WARNING     VARCHAR2                OUT On looking on the web I've found that my latest error message - ORA-20001: The primary key specified is invalid
Cause: The primary key values specified are invalid and do not exist in
the schema.
Action: Check the primary key values... - relates to incorrect combination of person_id,object_version_number,effective_start_date and effective_end_date - all of which seem OK to me - her's my latest version of my code.. Many thanks again.
SET serveroutput ON SIZE 1000000 FORMAT WRAPPED
SET verify OFF
SET feedback OFF
DECLARE
   error_msg     varchar2(2000);       
   l_status           varchar2(10);       
   l_validate_cnt           number;                       
   l_ass_count           number;           
   l_validate   BOOLEAN DEFAULT FALSE;                                   
   l_city            varchar2(30);
   l_mode        varchar2(20) := 'UPDATE'; 
   l_organization_id    number;
   l_effective_date date := '12-FEB-09';                                    
   l_person_id   number := '29987';
   l_object_version_number number := '3';
   l_effective_start_date date := '12-FEB-09';                                    
   l_effective_end_date date := '12-FEB-56';                                    
   l_job_id                     per_jobs.job_id%type;
   l_position_id                per_positions.position_id%type;
   l_location_id               number;
   l_grade_id              number;
   l_supervisor_id       number;
   l_assignment_status_type_id  number;
   l_pay_basis_id           number;
   l_join_date           date;
   l_soft_coding_keyflex_id   number;
   l_people_group_id              per_all_assignments_f.people_group_id%type;
   l_payroll_id                   per_all_assignments_f.payroll_id%type;
   l_assignment_sequence          per_all_assignments_f.assignment_sequence%type;
   l_comment_id                   per_all_assignments_f.comment_id%type;
  l_normal_end varchar2(15) := '17:30';
  l_normal_start varchar2(15) := '09:30';
  l_frequency varchar2(10) := 'D';
  l_normal_hours varchar2(25) := '7.5';
  l_assignment_id number := '29884';
  l_gsp_post_process_warning varchar2(30);
  l_entries_changed varchar2(30);
  l_old_obj_ver_number per_addresses.OBJECT_VERSION_NUMBER%type;
   l_segment1 varchar2(25);
   l_segment2 varchar2(25);
   l_segment3 varchar2(25);
   l_concatenated_segments        varchar2(240);
   l_group_name                   varchar2(100);
   l_other_manager_warning        boolean;
   l_org_now_no_manager_warning   boolean;
   l_spp_delete_warning           boolean;
   l_entries_changed_warning      varchar2(200);
   l_tax_district_changed_warning boolean;
   l_special_ceiling_step_id      number;
   l_no_managers_warning          boolean;
   l_other_manager_warnings       boolean;
   l_cagr_grade_def_id            number;
   l_cagr_concatenated_segments   varchar2(100);
   l_datetrack_update_mod varchar2(10);
   l_total_records             number := 0;
   l_success_records          number := 0;
   l_failure_records          number := 0;
BEGIN
   dbms_output.put_line('#############################################################');
   dbms_output.put_line('Data Migration Of Employee Assignments :');
   dbms_output.put_line('#############################################################');
   dbms_output.put_line('Start Time : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));  
      l_person_id  := null;
      l_object_version_number  := null;
      l_organization_id  := null;
      l_location_id  := null;
      l_grade_id      := null;
      l_job_id      := null;
      l_position_id           := null;
      l_supervisor_id           := null;
      l_assignment_status_type_id := null;
      error_msg      := null;
      l_status      := 'True';
        hr_assignment_api.update_emp_asg_criteria (
     p_effective_date           => l_effective_date                                                                        ,p_datetrack_update_mode     => l_datetrack_update_mod                                                           ,p_assignment_id             => l_assignment_id                                                                       ,p_called_from_mass_update     => NULL                                                                         ,p_grade_id                   => l_grade_id                                                                               ,p_position_id              => l_position_id                                                                            ,p_job_id                     => l_job_id                                                                                   ,p_payroll_id                => l_payroll_id                                                                              ,p_location_id                => l_location_id                                                                            ,p_organization_id        => l_organization_id                                                        ,p_pay_basis_id              => l_pay_basis_id
     ,p_segment1               => l_segment1
     ,p_segment2               => l_segment2
     ,p_segment3             => l_segment3                                                                                     ,p_employment_category          => NULL                                                                     ,p_concat_segments              => NULL                                                                       ,p_contract_id               => NULL                                                                                       ,p_establishment_id             => NULL                                                                         ,p_scl_segment1              => NULL                                                                                       ,p_grade_ladder_pgm_id       => NULL                                                                                       ,p_supervisor_assignment_id      => NULL                                                                         ,p_object_version_number         => l_old_obj_ver_number                                                ,p_special_ceiling_step_id       => l_special_ceiling_step_id                                                           ,p_people_group_id               => l_people_group_id                                                                    ,p_soft_coding_keyflex_id        => l_soft_coding_keyflex_id                                                           ,p_group_name                    => l_group_name                                                                         ,p_effective_start_date          => l_effective_start_date                                                               ,p_effective_end_date            => l_effective_end_date                                                                ,p_org_now_no_manager_warning      => l_org_now_no_manager_warning                                ,p_other_manager_warning           => l_other_manager_warning                                          ,p_spp_delete_warning              => l_spp_delete_warning                                              ,p_entries_changed_warning         => l_entries_changed                                                   ,p_tax_district_changed_warning     => l_tax_district_changed_warning                                ,p_concatenated_segments         => l_concatenated_segments                                        ,p_gsp_post_process_warning      => l_gsp_post_process_warning);
            hr_assignment_api.update_emp_asg
       p_validate                   => l_validate
               ,p_effective_date             => l_effective_date
               ,p_datetrack_update_mode      => l_datetrack_update_mod --'CORRECTION'                    
               ,p_assignment_id              => l_assignment_id  
               ,p_object_version_number      => l_object_version_number   
               ,p_supervisor_id              => l_supervisor_id
               ,p_normal_hours               => l_normal_hours --'7.5' 
               ,p_frequency                  => l_frequency --'D'
               ,p_time_normal_start          => l_normal_start --'09:30'
               ,p_time_normal_finish         => l_normal_end --'17:30'
               ,p_soft_coding_keyflex_id     => l_soft_coding_keyflex_id    
               ,p_comment_id                 => l_comment_id                
               ,p_effective_start_date       => l_effective_start_date      
               ,p_effective_end_date         => l_effective_end_date        
               ,p_concatenated_segments      => l_concatenated_segments     
               ,p_no_managers_warning        => l_no_managers_warning       
               ,p_other_manager_warning      => l_other_manager_warnings    
               ,p_cagr_grade_def_id          => l_cagr_grade_def_id         
               ,p_cagr_concatenated_segments => l_cagr_concatenated_segments
dbms_output.put_line('End Time   : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
   dbms_output.put_line('          
END;
commit;
exit;

Similar Messages

  • 'PLS-00363: expression..' error when executing a stored procedure with in o

    Hello,
    I'm trying to run a PLSQL script containing an ORACLE API but its failing on compilation with the message:
    'PLS-00363: expression '<expression>' cannot be used as an assignment target'.
    As far as I understand its connected to my IN-OUT parameters but I can't figure out which (I must admit I'm still hiking up a steep learning curve here and I've cut and pasted someone elses example and modified it).
    I would be most grateful if one of you pro's could read through my code and advise..
    many thanks,
    Steven

    i guess you are trying to store value in your IN parameter.
    here is an example
    SQL> create or replace procedure pr(p in integer)
      2  as
      3  begin
      4     p := 1;
      5  end;
      6  /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE PR:
    LINE/COL ERROR
    4/2      PL/SQL: Statement ignored
    4/2      PLS-00363: expression 'P' cannot be used as an assignment targetSee it also gives the exact line in which the error has occurred. so see that and fix it.
    Edited by: Karthick_Arp on Feb 12, 2009 1:57 AM

  • Error while executing the stored procedure through sender JDBC adapter

    Hi All,
    I am getting below error while executing the stored procedure through sender JDBC adapter.
    Database-level error reported by JDBC driver while executing statement 'exec SapgetNextEntity 'SalesOrder''. The JDBC driver returned the following error message: 'com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.'. For details, contact your database server vendor.
    what is the problem? any idea to anyone...
    regards
    Ramesh

    hi Dharamveer,
    I am not getting below statement for your reply
    Try to use Refrence Cursor it will return u reference of resultset.
    I mention SP like this
    exec SapgetNextEntity 'SalesOrder'
    SapgetNextEntity -
    > SP Name
    SalesOrder----
    > Parameter I am passing...
    regards
    Ramesh

  • Strange error while executing a stored procedure: Incorrect syntax near '@p0'

    All, I am getting a strange error while executing a stored procedure: Incorrect syntax near '@p0'  using JDBC CallableStatment.
    Here is my code...
    CallableStatement cStmt = con.prepareCall("{call SET CHAINED ON EXEC <dbName>.<schemaName>.<SPName> (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}");
    cStmt.setString(1, "2012005881");
    cStmt.setString(2, "07");
    cStmt.setString(3, "10");
    cStmt.setString(4, "Case title");
    cStmt.setString(5, "Open");
    java.sql.Date dt1 = new java.sql.Date(2014,10,20);
    cStmt.setDate(6, dt1);
    cStmt.setString(7, "01");
    cStmt.setString(8, "N");
    cStmt.setString(9, "ADA Test");
    cStmt.setString(10, "N");
    cStmt.setString(11, "English");
    cStmt.setString(12, "N");
    cStmt.setString(13, "N");
    cStmt.setString(14, "N");
    cStmt.setString(15, "N");
    cStmt.setString(16, "N");
    cStmt.setString(17, "N");
    cStmt.setString(18, "07");
    cStmt.setString(19, "10");
    cStmt.setString(20, "juache0");
    java.sql.Date dt2 = new java.sql.Date(2014,10,20);
    java.sql.Date dt3 = new java.sql.Date(2014,10,20);
    cStmt.setDate(21, dt2);
    cStmt.setDate(22, dt3);
    cStmt.setString(23, "userid0");
    cStmt.setString(24, "");
    cStmt.setString(25, "");  
    cStmt.setString(26, "");
    java.math.BigDecimal bg1 = new java.math.BigDecimal(10);
    cStmt.setBigDecimal(27, bg1);
    cStmt.setString(28, "userid");
    cStmt.setString(29, "userid");
    int hadResults = cStmt.executeUpdate();
    Your help is greatly appreciated.
    I am executing the above using Jconnect3.0 driver, inside WebSphere Application Server V8.0
    Thanks
    Nags

    NOTE: I don't work with JDBC/jConnect so (at this point) just some questions ...
    1 - are you sending this to ASE, ASA, IQ, or some other RDBMS?
    2 - what is the value of <schemaname>?
    3 - do you have other prepareCall() instances that successfully call a stored proc? [would be interesting to see if there's a difference in the format of the calls]
    A quick google search shows a couple ways to submit a stored proc execution to the RDBMS, with the format depending on the format expected by the target RDBMS.
    I'm wondering if you really need/want the parentheses around the argument list, ie, what happens if you change
    from
    -- parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ( ?,?,?,?,?,...,? )
    to
    -- no parentheses around args
    EXEC <dbName>.<schemaName>.<SPName> ?,?,?,?,?,...,?
    In ASE if I wrap the parameters in parentheses I get the same error you're getting:
    ================== w/ parentheses => error
    1> sp_who (sa)
    2> go
    Msg 102, Level 15, State 1:
    Server 'CC1_V1', Line 1:
    Incorrect syntax near 'sa'.   <<=== sa == @p0 ??
    ================== w/out parentheses => works
    1> sp_who sa
    2> go
    fid spid status  loginame origname ...
       0   17 running sa       sa       ...
    ==================

  • Error while executing a stored procedure from forms6i

    When I execute a STORED PROCEDURE from ORACLE DB 10g this procedure works perfectly fine.
    But when I execute the same from the FORMs 6i I get the following error:
    PDE-PLU022 Don't have access to the stored program unit
    XMLPARSERCOVER in schema CARE.
    where XMLPARSERCOVER is the class and
    CARE is the schema.
    Regards,
    Jignesh S

    I have tried this with both the owner of the schema and the intended user, -from both forms and directly.
    All rights was granted on the stored procedure. Since posting I have found that one of the tables that the procedure might insert into, was not explicitly granted to the intended user, and after rectifying that the error message went away.
    -however, the procedure now silently "finishes" without any evidence that it ever ran, if invoked from the forms application. When invoked from SQL Plus (or JDev, or Toad) it runs as expected.
    I have no public synonym for the procedure, -is that necessary?
    The stored procedure in question is implemented in java, and published as a stored procedure. It does rather heavy lifting, when running, using a view against another server , updating local tables and quite a lot of data validation/cleansing, and logging. All recourses are within the same schema.
    Any ideas?

  • Error when executing d2kwutil.pll procedure

    Hi all,
    I use a client/server architecture.
    There was an error when executing the procedure write_registry in the w2kutil.pll. I created a test forms , and I just created a control block containing a button. In the when-button-pressed trigger I coded : win_api_environment.write_registry('HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE','TEST_REGISTR','D:\MYLOGS',true); . I already attached the d2kwutil.pll to the form module.
    The error is : FRM-40734: internal error : pl/sql error occurred.
    So how to resolve it ?
    Thank you very much indeed.

    You have that atachar the bookstore to the form and then you can make use of the contained functions inside the bookstore.

  • Getting Error message when execute Netezza Stored Procedure calling in ODI

    Hi,
    I need help to resolve this issue,
    I'm trying to execute a Netezza stored procedure passing three parameters and It getting error message .
    code:import java.sql as sql
    import java.lang as lang
    import java.sql.Types as types
    MyCon = snpRef.getJDBCConnection("SRC")
    def CALL_NZ_SP():
         try: p_log_id = 22
    p_step_number = 2
              p_drive_id= 3455
    myStmt = MyCon.prepareStatement("CALL SP_NAME(?,?,?)");
              myStmt.setInt(1, p_log_id);
              myStmt.setInt(2, p_step_number);
              myStmt.setInt(3, p_drive_id);
              resultSet=myStmt.executeQuery();
              resultSet.next();
              sp_return=resultSet.getInt(1);
              if sp_return !=0:
              raise 'fail';
         finally:
              pass
    Please let me know is this the right code or need any code updatation.
    I appreciate ur help in this regard
    Thanks
    brk

    Hi Gowsiya,
    Maybe the WCF forum would be better for this issue, you know that this forum is to discuss the VS IDE.
    WCF forum link:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf
    Thanks for your understanding.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error while executing Multiple Stored Procedure through .sql file

    Hi Guru's.
    I am new to ORACLE. I am facing problem while creating Stored Procedure through .sql file.
    I have one test.sql file with Stored Procedure is like,
    CREATE OR REPLACE PROCEDURE skeleton1
    AS
    BEGIN
         DBMS_Output.Put_Line('skeleton1');
    END skeleton1;
    CREATE OR REPLACE PROCEDURE skeleton2
    AS
    BEGIN
         DBMS_Output.Put_Line('skeleton2');
    END skeleton2;
    Now when i try to execute this test.sql file through SQL PLUS it gives me Error like this
    I am opening test.sql file from SQL PLUS,
    SQL>
    1 CREATE OR REPLACE PROCEDURE skeleton1
    2 AS
    3 BEGIN
    4 DBMS_Output.Put_Line('skeleton1');
    5 END skeleton1;
    6 /
    7 CREATE OR REPLACE PROCEDURE skeleton2
    8 AS
    9 BEGIN
    10 DBMS_Output.Put_Line('skeleton2');
    11* END skeleton2;
    SQL> /
    Warning: Procedure created with compilation errors.
    SQL> show errors;
    Errors for PROCEDURE SKELETON1:
    LINE/COL ERROR
    6/1 PLS-00103: Encountered the symbol "/"
    SQL>
    Please suggest how to create multiple CREATE PROCEDURE using single .sql script file....
    Regards,
    Shatrughan

    Hi,
    Try this
    CREATE OR REPLACE PROCEDURE skeleton1
    AS
    BEGIN
    DBMS_Output.Put_Line('skeleton1');
    END ;
    CREATE OR REPLACE PROCEDURE skeleton2
    AS
    BEGIN
    DBMS_Output.Put_Line('skeleton2');
    END;
    /Save the file and call it.
    Regards,
    Bhushan

  • Error while executing java stored procedure from a pl/sql procedure

    We have a requirement where we need to execute JAVA code stored in an Oracle database (Java Stored Procedure). This code uses some JAR files which we have already loaded without any errors in the database.
    The class file was also loaded in the database without any errors. But when we execute the method of this class (JAVA code), it gives the following error:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NoClassDefFoundError
    Is there any way of debugging the code and getting to know where exactly the problem is? Or, any tool/software available for doing the same.
    Any pointers would be of great help!
    Thanks in advance

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • ORA-03115 error when calling a Stored Procedure

    Hi All,
    I'm in the process of porting a Pro/C app from NT to Linux. I've installed 8.1.5 on our Linux box and patched it up to 8.1.5.02.
    It all kind of works ok, except that I'm sometimes getting ORA-03115 errors when the app calls a stored procedure. The call in question looks like this:
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR resprows[50][3998];
    int numret = 0;
    int numrows= 50;
    int done= 0;
    unsigned long resp_id = 0;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL AT DB_NAME EXECUTE
    BEGIN pkg_something.getdata(
    :resp_id, /* IN */
    :numrows, /* IN */
    :done, /* OUT */
    :resprows, /* OUT */
    :numret /* OUT */
    END;
    END-EXEC;
    The stored procedure basically uses the resp_id value to select rows from a table;
    in each row there is a VARCHAR2(4000) column which it copies into the hostarray resprows.
    There may be anything from 1 to numrows returned from the SP.
    Initially, the resprows rows were defined to be size [4000]. Unfortunately, this caused ORA-02005 errors - I then changed the size to [3998], which seemed to fix the 02005's (although I'm unclear as to the reasons why).
    Now I'm getting the 03115 errors when calling the SP. The oracle manual is not very helpful on what this error means.
    This all works chipper on NT.
    Any ideas?
    Thanks in advance,
    Nigel.
    PS: The database the app is talking to is still hosted on NT.
    null

    Histon FTM wrote:
    ORA-04063: package body "LAZARUS.LAZARUS" has errors Above, obviously conflicts with the statement that follows:
    >
    The procedure and package have both compiled without errors and the statement on its own works fine in SQL*Plus.I suggest you take a look in the USER_ERRORS view to see, what the errors are.
    And just checking:
    You have schema called LAZARUS, which holds a package named LAZARUS, which holds a procedure called POPULATEGRIDPOSITIONS?
    Edited by: Toon Koppelaars on Oct 1, 2009 5:55 PM

  • Error while executing Java Stored Procedure.

    Hi,
    When I'm trying to execute my java stored procedure i'm getting the following error:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ExceptionInInitializerError
    Does anybody has idea why this error comes and how can be resolved.
    Thanks in advance.
    Uday

    Hi Uday,
    My guess is that there is a problem with your java stored procedure that is causing the "ExceptionInInitializer" error to be thrown. According to the javadoc:
    is thrown to indicate that an exception occurred during
    evaluation of a static initializer or
    the initializer for a static variable
    Since I didn't see any of your code in your post, I can't help you much more, I'm afraid. Perhaps if you would provide some more details, I may be able to help you some more. I think the following details would be helpful:
    1. Complete error message and stack trace you are getting.
    2. The section of your java code that you think is causing the problem.
    3. Oracle database version you are using.
    Good Luck,
    Avi.

  • ODBC 8.1.7 Error when calling a stored procedure that owned by an other user

    I am testing my application VB for certified to use the
    Client 8 with ODBC Driver 8.1.7.0 , because today this application
    have been working with Client 7 and ODBC driver 7.3 version 2.5.
    But i have some surprises:
    Set qy = con.CreateQuery("", "{CALL OFS.INSERT_DEPT (?,?,?)}")
    OFS is the owner of the proc
    (other combinations {BEGIN ...;END;} also doesn't work, except the owner executes the stmt)
    qy(0) = "6"
    qy(1) = "ABCDEF"
    qy(2) = "L88"
    at this point it gives an VB error:
    40041 Object Collection: Couldn't find item indicated by text.
    PS: With previous ODBC Driver 7.3 v2.5 this error doesn4t occur.
    I have the rights to execute the procedure
    GRANT EXECUTE ON OFS.DEPT TO OFS_USERS;
    Is there any other way to get this procedure work? Its a BUG ?
    My Procedure:
    create or replace procedure INSERT_DEPT(
    in_deptno in number,
    in_dname in varchar2,
    in_loc in varchar2)
    is
    begin
    insert into dept(deptno, dname, loc)
    values(in_deptno, in_dname, in_loc);
    end;
    show errors;
    GRANT EXECUTE ON OFS.INSERT_DEPT TO OFS_USERS;
    Environment:
    Client:
    VB 5.0 SP3 (using RDO 2.0)
    NT 4.0 SP6
    Oracle8i Client 8.1.7.0.0
    Oracle ODBC Driver 8.1.7.0.0
    PS: This error already occured with Oracle ODBC Driver 8.1.7.7.0
    Server:
    Oracle8i Enterprise Edition Release 8.1.7.4.1
    Win 2000 SP2
    Thanks in advance.

    I have no problem executing that statement from ODBCTest on my machine
    Client:
    Win2k,
    Oracle ODBC driver 8.1.7.7
    Oracle client 8.1.7.0
    Server:
    Oracle 8.1.7.0
    First, can you try replacing the ?'s with explicit parameters? I can't imagine that an error binding the variables would cause an error like this, but I'd just like to rule it out.
    Second, can you grab the ODBC SDK from Microsoft <http://www.microsoft.com/data> if you haven't already and try that statement from within the ODBCTest sample application? If that works for you, then there must be something in the layers between your application and the ODBC driver which are confusing things. Which API are you actually using from VB? I'm guessing ADO, but I'd like confirmation on that.
    Third, did you set any parameters to non-default values when you configured your DSN? I left everything as-is on my machine, so I'll try to replicate any changes you might have made to see if that changes anything.
    Finally, can you post the connection string you're using?
    Justin

  • Error while executing the stored procedure

    Hi All,
    When I try to execute the store procedure .The store procedure does not have parameter. I am getting the following error. The store procedure has been successfully complied.
    Thanks for all your help.
    uday
    ORA-01422: exact fetch returns more than requested number of rows
    01422. 00000 - "exact fetch returns more than requested number of rows"
    *Cause:    The number specified in exact fetch is less than the rows returned.
    *Action:   Rewrite the query or change number of rows requested                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi All,
    Here is the store proc and version. I do not have much exposure to pl sql store proc .
    Thanks for all your support and help.
    uday
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE     11.2.0.3.0     Production"
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    Here is the store proc .
    create or replace
    PROCEDURE TEST AS
    R_REGION VARCHAR2(5);
    R_listing2rifs_count number;
    R_listing2rifs number;
    listing2iag_count number; /* mentioned already: rp0428 */
    listing2iag number;
    R_rod2iag_count number;
    R_rod2iagnumber;
    R_rod2ra_count number;
    R_rod2ra number;
    begin
    select Region,
    sum(listing2rifs_count) as listing2rifs_count,
    round((sum(listing2rifs) / sum(listing2rifs_count))/30.4,1) as listing2rifs,
    sum(listing2iag_count) as listing2iag_count,
    round((sum(listing2iag) / sum(listing2iag_count))/30.4,1) as listing2iag,
    sum(rod2iag_count) as rod2iag_count,
    round((sum(rod2iag) / sum(rod2iag_count))/30.4,1) as rod2iag,
    sum(rod2ra_count) as rod2ra_count,
    round((sum(rod2ra) / sum(rod2ra_count))/30.4,1) as rod2ra
    into R_REGION,R_listing2rifs_count,R_listing2rifs,listing2iag_count,listing2iag,
    R_rod2iag_count,R_rod2iag,R_rod2ra_count,R_rod2ra
    from (select site.FK_REF_REGION_CODE Region,
    site.site_id,
    site.EPA_ID,
    site.name site_name,
    FEDERAL_FACILITY_DETER_CODE,
    NPL_STATUS_CODE,
    site.BRAC_TYPE_NAME,
    sis.FT_FLAG,
    listing_action,
    rifs_action,
    iag_action,
    rod_action,
    ra_action,
    listing.ACTUAL_COMPLETION_DATE as listing_date,
    iag.ACTUAL_COMPLETION_DATE as iag_date,
    first_rifs.ACTUAL_START_DATE as first_rifs_start_date,
    first_rod.ACTUAL_COMPLETION_DATE as first_rod_date,
    ra_start.ACTUAL_START_DATE as first_ra_start_date,
    case when first_rifs.ACTUAL_START_DATE is not null
    and listing.ACTUAL_COMPLETION_DATE is not null
    then 1
    else 0
    end as listing2rifs_count,
    first_rifs.ACTUAL_START_DATE - listing.ACTUAL_COMPLETION_DATE as listing2rifs,
    case when first_rifs.ACTUAL_START_DATE is not null
    and listing.ACTUAL_COMPLETION_DATE is not null
    then 1
    else 0
    end as listing2iag_count,
    iag.ACTUAL_COMPLETION_DATE - listing.ACTUAL_COMPLETION_DATE as listing2iag,
    case when first_rifs.ACTUAL_START_DATE is not null
    and listing.ACTUAL_COMPLETION_DATE is not null
    then 1
    else 0
    end as rod2iag_count,
    iag.ACTUAL_COMPLETION_DATE - first_rod.ACTUAL_COMPLETION_DATE as rod2iag,
    case when first_rifs.ACTUAL_START_DATE is not null
    and listing.ACTUAL_COMPLETION_DATE is not null
    then 1
    else 0
    end as rod2ra_count,
    ra_start.ACTUAL_START_DATE - first_rod.ACTUAL_COMPLETION_DATE as rod2ra
    from site
    LEFT OUTER JOIN
    (select fk_site_id,
    SPECIAL_INITIATIVE_CODE as FT_FLAG
    from SPECIAL_INITIATIVE_SITE sppi
    where SPECIAL_INITIATIVE_CODE = 'FT'
    ) SIS
    ON site.site_id = sis.fk_site_id
    LEFT OUTER JOIN
    (select fk_site_id,
    TYPE_SEQUENCE_CODE as listing_action,
    ACTUAL_COMPLETION_DATE
    from action
    where TYPE_CODE = 'NF'
    and (ANOMALY_CODE is null or ANOMALY_CODE not in ('PC','PB','OA','OC','TO','TT'))
    and ACTUAL_COMPLETION_DATE is not null
    and TO_CHAR(action.ACTUAL_COMPLETION_DATE,'YYYYMMDD') || action.TYPE_SEQUENCE_CODE =
    (SELECT min(TO_CHAR(ACTUAL_COMPLETION_DATE,'YYYYMMDD') || B.TYPE_SEQUENCE_CODE)
    from action b
    WHERE ACTION.FK_SITE_ID = b.FK_Site_ID
    and b.TYPE_CODE = 'NF'
    and b.ACTUAL_COMPLETION_DATE is not null
    ) listing
    ON SITE.SITE_ID = LISTING.FK_site_id
    LEFT OUTER JOIN
    (select FK_site_id,
    TYPE_SEQUENCE_CODE as rifs_action,
    ACTUAL_START_DATE,
    ACTUAL_COMPLETION_DATE
    from action
    where TYPE_CODE in ('NH','LW') /*('RI','NA','NH','FS','NK','NI','CO','BD','LW') */
    and LEAD_CODE = 'FF'
    and (ANOMALY_CODE is null or ANOMALY_CODE not in ('PS','PB','OA','OS','TN','TT'))
    and ACTUAL_START_DATE is not null
    and TO_CHAR(action.ACTUAL_START_DATE,'YYYYMMDD') || TYPE_SEQUENCE_CODE =
    (SELECT min(TO_CHAR(ACTUAL_START_DATE,'YYYYMMDD') || B.TYPE_SEQUENCE_CODE)
    from action b
    WHERE ACTION.FK_SITE_ID = b.FK_Site_ID
    and b.TYPE_CODE in ('NH','LW') /*('RI','NA','NH','FS','NK','NI','CO','BD','LW') */
    and b.ACTUAL_START_DATE is not null
    ) first_rifs
    ON site.site_id = first_rifs.FK_site_id
    LEFT OUTER JOIN
    (select FK_site_id,
    TYPE_SEQUENCE_CODE as iag_action,
    ACTUAL_COMPLETION_DATE
    from action
    where TYPE_CODE = 'FI'
    and action.LEAD_CODE = 'FE'
    and (ANOMALY_CODE is null or ANOMALY_CODE not in ('PC','PB','OA','OC','TO','TT'))
    and ACTUAL_COMPLETION_DATE is not null
    and TO_CHAR(action.ACTUAL_COMPLETION_DATE,'YYYYMMDD') || action.TYPE_SEQUENCE_CODE =
    (SELECT min(TO_CHAR(ACTUAL_COMPLETION_DATE,'YYYYMMDD') || B.TYPE_SEQUENCE_CODE)
    from action b
    WHERE ACTION.FK_SITE_ID = b.FK_Site_ID
    and b.TYPE_CODE = 'FI'
    and b.ACTUAL_COMPLETION_DATE is not null
    ) iag
    ON site.site_id = iag.FK_site_id
    LEFT OUTER JOIN
    (select FK_site_id,
    TYPE_SEQUENCE_CODE as rod_action,
    ACTUAL_COMPLETION_DATE
    from action
    where TYPE_CODE = 'RO'
    and (ANOMALY_CODE is null or ANOMALY_CODE not in ('PC','PB','OA','OC','TO','TT'))
    and ACTUAL_COMPLETION_DATE is not null
    and TO_CHAR(action.ACTUAL_COMPLETION_DATE,'YYYYMMDD') || action.TYPE_SEQUENCE_CODE =
    (SELECT min(TO_CHAR(ACTUAL_COMPLETION_DATE,'YYYYMMDD') || B.TYPE_SEQUENCE_CODE)
    from action b
    WHERE ACTION.FK_SITE_ID = b.FK_Site_ID
    and b.TYPE_CODE = 'RO'
    and b.ACTUAL_COMPLETION_DATE is not null
    ) first_rod
    ON site.site_id = first_rod.FK_site_id
    LEFT OUTER JOIN
    (select FK_site_id,
    TYPE_SEQUENCE_CODE as ra_action,
    ACTUAL_START_DATE
    from action
    where TYPE_CODE = 'LY'
    and (ANOMALY_CODE is null or ANOMALY_CODE not in ('PS','PB','OA','OS','TN','TT'))
    and ACTUAL_START_DATE is not null
    and TO_CHAR(action.ACTUAL_START_DATE,'YYYYMMDD') || action.TYPE_SEQUENCE_CODE =
    (SELECT min(TO_CHAR(ACTUAL_START_DATE,'YYYYMMDD') || B.TYPE_SEQUENCE_CODE)
    from action b
    WHERE ACTION.FK_SITE_ID = b.FK_Site_ID
    and b.TYPE_CODE = 'LY'
    and b.ACTUAL_START_DATE is not null
    ) ra_start
    ON site.site_id = ra_start.FK_site_id
    WHERE site.FEDERAL_FACILITY_DETER_CODE = 'Y'
    and site.NPL_STATUS_CODE in (/*'P',*/'F','D','A')
    ) durations
    group by Region
    order by 1;
    end;
    errors:
    ORA-01422: exact fetch returns more than requested number of rows
    01422. 00000 - "exact fetch returns more than requested number of rows"
    *Cause: The number specified in exact fetch is less than the rows returned.
    *Action: Rewrite the query or change number of rows requested                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SQL Developer Bug: NVL() function error when debug/run stored procedure

    Version:
    SQL Developer: 1.5.3 (build main-5783)
    Oracle DB connected: Oracle9i Enterprise Edition Release 9.2.0.6.0
    Stored procedure code like this:
    procedure search(V_STATUS_IN IN CHAR(1)) is
    begin
    declare
    V_STATUS CHAR(1) := NULL;
    begin
    V_STATUS := NVL(V_STATUS_IN, '%'); -- error line
    end;
    end;
    The stored procedure runs well (I mean no oracle exception) when called through Java code (and in TOAD). But when debug/run in SQL Developer, following error at the error line:
    $Oracle.EXCEPTION_ORA_6502:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    --------------------------------------------------*/

    What parameter are you passing in? It is possible you are trying to cram a multibyte character into a singlebyte container. What are the nls settings for the database and for sqldeveloper?

  • ORA-21700 Error when running C# stored procedure to do a spatial query

    Hi All
    I'm having trouble running a C# stored procedure that (via another object) that falls over running a spatial query with the following error.
    OAR-21700 object does not exist or is marked for delete
    If I take the sql of the spatial query out and run it separately in SqlPlus it runs as expected.
    If I use the object that executes the spatial query via NUnit (i.e. executed on the client, rather than the server) it also works as expected.
    Can anyone help? Is there some issue using Oracle Spatial queries with the Oracle Database Extensions for .NET?

    I can indeed. Here is a slightly simplified version:
    SELECT secondary_catch.mi_prinx AS primarykey
    FROM mapinfo_data.secondary_catch
    WHERE sdo_relate (secondary_catch.geoloc,
    (SELECT geoloc
    FROM training_6.building_polygons
    WHERE building_id = 10002507117),
    'mask=anyinteract querytype=WINDOW'
    ) = 'TRUE'
    Interestingly, if I attempt to run this query inside a C# stored procedure using the implicit context connection (i.e. OracleConnection.ConnectionString = "context connection=true") it fails with the error I described above.
    If however I create a new connection and connect as a regular user on my database, the query works correctly.
    So in that sense I have a workaround, but I'd like to avoid using it if I can as creating a new explicit connection is an overhead I can do without.

Maybe you are looking for