Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6324407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:41:50+00:00 2026-05-24T16:41:50+00:00

So i am working on an installer where the installer connects to a database

  • 0

So i am working on an installer where the installer connects to a database and creates tables and populates them.
Every aspect of this works correctly except when i attempt to add rows to a certian table.

declare
  retVal INTEGER;
  rptID INTEGER;
  catID INTEGER;
  wsID INTEGER;
  paramID INTEGER;
  dtID INTEGER;
begin

  select PK into catID from RPT_CATEGORY where KEYVALUE = 'ProductivityReportsCategory';
  select PK into rptID from RPT_REPORT where KEYVALUE = 'ProductivitySummaryReport2';
  select PK into wsID from RPT_WEBSVC where KEYVALUE = 'NotApplicable' and category_fk = catID;

The select statements that populate the database look like this:

  select PK into wsID from RPT_WEBSVC where KEYVALUE = 'GetMachineNameList' and category_fk = catID;
  paramID := RPT_CONFIGURATION.ADD_PARAMETER( rptID, wsID, dtID, 'Machine', 'parameters.GetProductivityDataSet3.inserterid', 4, NULL, NULL, NULL, 0, 0, 0, 'Y', 'Y', 'N', 'N', 'Y' );

There are 13 more select statements structured like this (i won’t add them since they are all similar and the only difference is the stored values that would go into the table.)

My problem is that when i run the installer, i get this error in the logs upon completion:

ORA-01422: exact fetch returns more than requested number of rows 
ORA-06512: at line 30

What i would like to know is what exactly is the reason for this error to occur, and what would be the means to fix this error?

I’ve done some research on the topic, and found this to be the common theme of my search:

1.There’s a bug in the code and the developer did not realise that you could get more than one row returned;

2.The data has been hacked rather than using the API so that validation has been broken;

3.The software is OK, what the user did was OK, but two parallel updates occurred at the same time and neither could see the uncommitted change that the other did – hence not validated correctly.

I’m positive it is not #2, but i do not quite understand what exactly the other 2 reasons mean, or how to fix them.

Any help or suggestions are greatly appreciated.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T16:41:52+00:00Added an answer on May 24, 2026 at 4:41 pm

    ORA-01422: exact fetch returns more than requested number of rows

    This exception is raised whenever a SELECT INTO statement is executed and finds more than one row. A SELECT INTO statement expects to find exactly one row, no more or less – otherwise an exception is raised.

    In your example:

    select PK into wsID from RPT_WEBSVC
    where KEYVALUE = 'GetMachineNameList'
    and category_fk = catID;
    

    it appears that there should only be one row per (KEYVALUE, CATEGORY_FK) combination, but in fact that is not the case. If there should be only one then the table should have a unique constraint on those columns:

    alter table RPT_WEBSVC add constraint RPT_WEBSVC_UK
        unique (KEYVALUE, CATEGORY_FK);
    

    That would prevent someone (or some process) adding the same row again. Of course you would need to de-duplicate the table before you could add that constraint.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a script to creates a database and installs WordPress. I
I am working on an application that connects to a Firebird database through a
I'm working on an installer project, during the install process I'd like the user
We are currently working on designing the installer for our product. We are currently
I'm working on an Excel Addin (VSTO) in .NET that connects to an Oracle
I am working on an android application for my company which connects to a
I had a local database used to connect with sql server authentication, every thing
I create SQL CE 3.5 database dynamically in asp.net webservice. I can create tables,
I installed ASP.NET Membership tables into a remote database using aspnet_regsql.exe. It seems to
I installed TeamCity and got it working against my project. However, I have since

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.