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 7890827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:27:29+00:00 2026-06-03T06:27:29+00:00

In a procedure, I need to decide about the value of a column using

  • 0

In a procedure, I need to decide about the value of a column using many if-else conditions. The script starts with a

FOR rec IN (SELECT….) LOOP Begin

and decides on many different values the rec sub-records can obtain in each iteration. for some cases, there might be just 2 or 3 variable assignments and some cases include running a separate procedure or doing an INSERT operation.

Does this approach the best approach for decision making from the aspect of performance where there are many records as the result of loop’s SELECT statement, or there might be better alternatives? What if I adapt Chain-of-responsibility pattern in writing this procedure? Will this approach increase performance or just makes things even worse?

Regards.

  • 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-03T06:27:30+00:00Added an answer on June 3, 2026 at 6:27 am

    If possible stay inside SQL.
    For bigger volumes, avoid “if” as you will be serialized on your PL/SQL side.
    Have it better as CASE inside your SELECT if possible.
    For example, in case of SQL paralelization it can be handled by multiple processes for different rows at the same time.

    Hope it helps,
    Igor

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

Sidebar

Related Questions

I need to write a generic procedure that set value for one column or
I need to have stored procedure where I can run multiple cursors. Loop over
I need to access the result of a stored procedure within a select statement,
I need to call a stored procedure using JPA and found this article: http://www.oracle.com/technology/pub/articles/vasiliev-jpql.html
I am having a procedure where i need to check the status in the
I need to make a stored procedure or function that returns a set of
I need to write a stored procedure for which the input is a string.
Need to make a stored procedure that will do a simple search on a
I need to make some changes to an old Oracle stored procedure on an
I need to branch my T-SQL stored procedure (MS SQL 2008) control flow to

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.