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

The Archive Base Latest Questions

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

Is it possible to execute c_emp%notfound after the following FOR loop or do I

  • 0

Is it possible to execute c_emp%notfound after the following FOR loop or do I have to open the cursor first?

declare
 cursor c_emp is select * from employee;
 begin
    for c_rec in c_emp
    loop
        dbms_output.put_line(r_emp.first_Name);
    end loop;
 end;
 /

I want to execute a statement a single UPDATE statement after the FOR loop but only if the FOR loop did process any of the rows on the cursor. I know i can set a flag but is there a cleaner way?

  • 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-26T16:08:42+00:00Added an answer on May 26, 2026 at 4:08 pm

    “Is it possible to execute c_emp%notfound after the following FOR
    loop”

    No, that’s going to hurl ORA-01001: invalid cursor. The cursor attributes only have scope while the cursor is open, which in this syntax is between the FOR and the END LOOP.

    This is an ugly aspect of PL/SQL but I’m afraid you’re stuck with a count.

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

Sidebar

Related Questions

Is it possible to execute mysql query like this? select (select A from B
Is it possible to execute a specific sub in a vbs file from a
As the title suggests is it possible to execute another java app from within
Is it possible to call Server.Execute with a .NET .aspx page from classic ASP?
How is it possible to get/use/return a thread from an execute queue ( =
Is this possible to execute a View from C# code. If it is then
I have 2 powershell scripts that I execute from c# which I'm using to
Possible Duplicate: How to execute sql statements from a C program? I'm creating a
I'd like to execute JavaScript code from within a C# assembly and have the
Is it possible to have a PartialView execute the jQuery ready function on load

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.