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

  • Home
  • SEARCH
  • 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 8573647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:17:58+00:00 2026-06-11T19:17:58+00:00

We have a problem with our software and in order to correct the issue,

  • 0

We have a problem with our software and in order to correct the issue, I have to write a stored procedure that will be run as part of the upgrade process for upgrade installs. This stored procedure needs to find every row in a particular table that matches certain conditions and update that row. For internal reasons, the update has to be done through a stored procedure we wrote specifically for inserting and updating data.

Here is the stored procedure I have written to fix this issue:

CREATE OR REPLACE FUNCTION FixDataProblem() RETURNS VOID AS $$
DECLARE
    FixCursor   NO SCROLL CURSOR FOR
        SELECT * FROM MyTable WHERE ProblemColumn IN ( '?', 'PR' );
    RowToUpdate         MyTable%ROWTYPE;
BEGIN
    -- Open the cursor
    OPEN FixCursor;

    -- Start a loop
    LOOP
        -- Fetch the next row from thr cursor
        FETCH FixCursor INTO RowToUpdate;

        -- Did we get anything back?
        IF RowToUpdate IS NULL THEN
            -- We didn't. Exit the loop
            EXIT;
        END IF;

        -- Call the UpsertMyTable stored procedure to set the ProblemColumn column to NULL
        SELECT CarSystem.UpsertMyTable( RowToUpdate.RowId,
                               RowToUpdate.ForeignId,
                               RowToUpdate.CountryId,
                               NULL,
                               RowToUpdate.Plate,
                               RowToUpdate.HashedData,
                               RowToUpdate.PlateClassId,
                               RowToUpdate.AlarmClassId,
                               RowToUpdate.BeginDate,
                               RowToUpdate.EndDate,
                               RowToUpdate.ListPriorityId,
                               RowToUpdate.VehicleTypeId,
                               RowToUpdate.MakeId,
                               RowToUpdate.ModelId,
                               RowToUpdate.Year,
                               RowToUpdate.ColorId,
                               RowToUpdate.Notes,
                               RowToUpdate.OfficerNotes,
                               NULL,
                               UUID_GENERATE_V4() );
    END LOOP;

    -- Close the cursor
    CLOSE ListDetailsCursor;
END;
$$ LANGUAGE plpgsql;

This stored procedure fine, but when I run it, I get:

ERROR:  query has no destination for result data
HINT:  If you want to discard the results of a SELECT, use PERFORM instead.
CONTEXT:  PL/pgSQL function "fixdataproblem" line 22 at SQL statement


********** Error **********

ERROR: query has no destination for result data
SQL state: 42601
Hint: If you want to discard the results of a SELECT, use PERFORM instead.
Context: PL/pgSQL function "fixdataproblem" line 22 at SQL statement

How do I fix this issue? I believe I am calling the stored procedure correctly. I really don’t know what the issue with this stored procedure is.

Thanks

Tony

  • 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-06-11T19:18:00+00:00Added an answer on June 11, 2026 at 7:18 pm

    It says right there:

    ERROR:  query has no destination for result data
    HINT:  If you want to discard the results of a SELECT, use PERFORM instead.
    CONTEXT:  PL/pgSQL function "fixdataproblem" line 22 at SQL statement
    

    And on line 22:

        -- Call the UpsertMyTable stored procedure to set the ProblemColumn column to NULL
        SELECT CarSystem.UpsertMyTable( RowToUpdate.RowId,
        ...
    

    Change it from SELECT to PERFORM. See PERFORM for why.

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

Sidebar

Related Questions

We have the problem that we have the open project files in our SVN
We have a problem that we're sure that it's already solved. Our research team
On the current project I'm working on, we have the following problem. Our software
Let's say we have an 'intrinsically parallel' problem to solve with our Erlang software.
I'm trying to write a python script that packages our software. This script needs
We have problem with our Qt based production server for our business application. When
I have a problem in our BTS production environment which we cannot reproduce in
We have a problem in our swing based application since we've upgraded our java
I'm trying to get a handle on whether we have a problem in our
So here is our problem: We have a small team of developers with their

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.