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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:31:45+00:00 2026-05-29T10:31:45+00:00

The code block below is not running when executed from a batch file. It

  • 0

The code block below is not running when executed from a batch file. It just hangs (nothing happens). It sits there for hours. I am unable to track what the problem is or how to debug this. Please help.

declare
v_personrefid varchar2(50);
v_hiredt date;
v_loaddt date;
v_personid number;
v1_personrefid varchar2(50);
v_seq number :=0;

cursor get_row is
select distinct personrefid from ARCHIVE_PERSON;

cursor get_row1 is
select 
personrefid, 
hiredt,
loaddt,
personid
from 
ARCHIVE_PERSON 
where 
personrefid = v_personrefid 
order by hiredt, loaddt;

begin

v_seq:=0;
open Get_row;
loop
fetch get_row into v_personrefid ;
exit when get_row%notfound;

begin

open get_row1;
loop
fetch get_row1 into v1_personrefid, v_hiredt, v_loaddt, v_personid;
exit when get_row1%NOTFOUND;

v_seq:= v_seq+1;

update ARCHIVE_PERSON 
set version = v_seq 
where 
personrefid = v1_personrefid and 
personid =  v_personid and 
hiredt = v_hiredt and 
loaddt = v_loaddt;

commit;
end loop;

v_seq:=0;

close get_row1;
end;
end loop;
v_seq:=0;
close get_row;

end;
  • 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-29T10:31:46+00:00Added an answer on May 29, 2026 at 10:31 am

    One possibility is that you don’t have a slash / in your script following the end; statement, which would tell SQLPlus to execute the block. If you simply have end; followed by nothing, SQLPlus may be waiting for more input that it will never get.

    Aside from that, I’d suggest having your dba look at V$SESSION_WAIT while the block is running to see what your session is waiting on.

    Moreover, you might try a rewrite like the following, which I think will be more efficient:

    DECLARE
      CURSOR my_cur IS
        SELECT ROW_NUMBER() OVER (PARTITION BY personrefid ORDER BY hiredt, loaddt) seq
          FROM archive_person
          FOR UPDATE;
    BEGIN
      FOR my_rec IN my_cur LOOP
        UPDATE archive_person SET version = my_rec.seq
          WHERE CURRENT OF my_cur;
      END LOOP;
    END;
    /
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in the code below at first if statements block (there will be more than
Why does the code block below give a compile error of does not contain
I cannot understand why the block of code below is not passing even though
The simple code block below can be served up in a static HTML page
I am using the below code to block the taskbar which is working perfectly.
The code block below works but I would like to un-comment filename = os.path.basename(filename)
When my application loops through the first code block below, I get valid data
I'm getting the below error in a Magento PHP file running a CREATE TABLE
FINAL UPDATE: The second code block is working--I just miss-typed the URL. I'm trying
I have the following code block in my xslt; <xsl:when test=StatusData/Status/Temperature > 27> <td

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.