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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:07:16+00:00 2026-06-08T12:07:16+00:00

Hi guys I have a pl/sql statement which is supposed to fetch data from

  • 0

Hi guys I have a pl/sql statement which is supposed to fetch data from one table to another through a cursor but some fields are empty and am thinking that is why it is exiting the line

exit when cursor%not found;

I have googled around and I have seen the suggestion to use the line after fetch statement but that seems to be the case when You have two cursors but in Mycase I have one cursor. Please some one help me tune up this query

CREATE OR REPLACE procedure TBAADM.MIGR_EIT
AS
CURSOR cur_eit  IS SELECT entity_id, nrml_accrued_amount_cr,nrml_accrued_amount_dr,   nrml_booked_amount_cr, nrml_booked_amount_dr, nrml_interest_amount_cr,
nrml_interest_amount_dr,
next_int_run_date_cr ,next_int_run_date_dr ,interest_calc_upto_date_cr,   interest_calc_upto_date_dr,xfer_min_bal
,xfer_min_bal_date, booked_upto_date_cr,booked_upto_date_dr FROM TBAADM.eit_temp  ;
tempeit1  TBAADM.EIT%ROWTYPE;
number_of_rows_updated number;
BEGIN
number_of_rows_updated:=0;

update tbaadm.eit_temp set entity_id=(select gam.acid from tbaadm.gam where gam.foracid=eit_temp.act_num);

OPEN cur_eit;

LOOP
FETCH cur_eit INTO  tempeit1.entity_id,tempeit1.nrml_accrued_amount_cr,tempeit1.nrml_accrued_amount_dr,tempeit1    .nrml_booked_amount_cr,tempeit1.nrml_booked_amount_dr,
tempeit1.nrml_interest_amount_cr, tempeit1.nrml_interest_amount_dr,
tempeit1.next_int_run_date_cr ,tempeit1.next_int_run_date_dr  ,tempeit1.interest_calc_upto_date_cr,  tempeit1.interest_calc_upto_date_dr,tempeit1.xfer_min_bal
,tempeit1.xfer_min_bal_date, tempeit1.booked_upto_date_cr,tempeit1.booked_upto_date_dr;
exit when cur_eit%notfound;
  • 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-08T12:07:17+00:00Added an answer on June 8, 2026 at 12:07 pm

    Explicit cursors are not required (and IMHO advisible) anymore since Oracle 8. I’d rewrite your code to use an implicit cursor in a FOR ... LOOP:

    CREATE OR REPLACE PROCEDURE tbaadm.migr_eit
    AS
      number_of_rows_updated   NUMBER;
    BEGIN
      number_of_rows_updated := 0;
    
      UPDATE tbaadm.eit_temp
         SET entity_id =
               (SELECT gam.acid
                  FROM tbaadm.gam
                 WHERE gam.foracid = eit_temp.act_num);
    
      FOR tempeit1 IN (SELECT entity_id
                             ,nrml_accrued_amount_cr
                             ,nrml_accrued_amount_dr
                             ,nrml_booked_amount_cr
                             ,nrml_booked_amount_dr
                             ,nrml_interest_amount_cr
                             ,nrml_interest_amount_dr
                             ,next_int_run_date_cr
                             ,next_int_run_date_dr
                             ,interest_calc_upto_date_cr
                             ,interest_calc_upto_date_dr
                             ,xfer_min_bal
                             ,xfer_min_bal_date
                             ,booked_upto_date_cr
                             ,booked_upto_date_dr
                         FROM tbaadm.eit_temp)
      LOOP
        /* do what ever you need to do with 
          tempeit1.entity_id,tempeit1.nrml_accrued_amount_cr,tempeit1.nrml_accrued_amount_dr,tempeit1    .nrml_booked_amount_cr,tempeit1.nrml_booked_amount_dr,
          tempeit1.nrml_interest_amount_cr, tempeit1.nrml_interest_amount_dr,
          tempeit1.next_int_run_date_cr ,tempeit1.next_int_run_date_dr  ,tempeit1.interest_calc_upto_date_cr,  tempeit1.interest_calc_upto_date_dr,tempeit1.xfer_min_bal
          ,tempeit1.xfer_min_bal_date, tempeit1.booked_upto_date_cr,tempeit1.booked_upto_date_dr;
        */
        NULL; -- do something useful
      END LOOP;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I have an SQL query like this: SELECT * FROM PEOPLE P
I have the following code in one of my Sql (2008) Stored Procs which
In postgresql, I need to insert data to, say table B from sql query
hey guys, i have a query in sql server which takes atleast 10-15 seconds
Hey guys, I have a column in an sql server table that is nvarchar(max).
Hey guys I know that this is probably just a simple sql statement but
Hey guys I have the following sample. I have navigation which is loaded from
Python list comprehensions are nice, but near impossible to debug. You guys have any
Guys I have an activity which has a home button, when the button is
guys i have arrays in which i have to match this kind of text

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.