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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:01:47+00:00 2026-05-22T15:01:47+00:00

I have some trouble when trying to update a table by looping cursor which

  • 0

I have some trouble when trying to update a table by looping cursor which select from source table through dblink.

I have two database DB1, DB2.

They are two different database instance.
And I am using this following statement in DB1:

CURSOR TestCursor IS
    SELECT  a.*, 'A' TEST_COL_A, 'B' TEST_COL_B
    FROM rpt.SOURCE@DB2  a;
BEGIN
    For C1 in TestCursor loop
        INSERT into  RPT.TARGET 
        (

           /*The company_name and cust_id are select from SOURCE table from DB2*/  
           COMPANY_NAME, CUST_ID, TEST_COL_A, TEST_COL_B

        ) 
        values
        (  
           C1.COMPANY_NAME, C1.CUST_ID, C1.TEST_COL_A , C1.TEST_COL_B
        ) ;

    End loop;

    /*Some code...*/

End

Everything works fine until I add a column “NEW_COL” to SOURCE table@DB2

The insert data got the wrong value.

The value of TEST_COL_A , as I expect, should be ‘A’.

However, it contains the value of NEW_COL which i add at SOURCE table.

And the value of TEST_COL_B contains ‘A’.

Have anyone encounter the same issue?
It seems like oracle cache the table columns when it compile.
Is there any way to add a column to source table without recompile?

  • 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-22T15:01:48+00:00Added an answer on May 22, 2026 at 3:01 pm

    According to this:

    Oracle Database does not manage
    dependencies among remote schema
    objects other than
    local-procedure-to-remote-procedure
    dependencies.

    For example, assume that a local view
    is created and defined by a query that
    references a remote table. Also assume
    that a local procedure includes a SQL
    statement that references the same
    remote table. Later, the definition of
    the table is altered.

    Therefore, the local view and
    procedure are never invalidated, even
    if the view or procedure is used after
    the table is altered, and even if the
    view or procedure now returns errors
    when used. In this case, the view or
    procedure must be altered manually so
    that errors are not returned. In such
    cases, lack of dependency management
    is preferable to unnecessary
    recompilations of dependent objects.

    In this case you aren’t quite seeing errors, but the cause is the same. You also wouldn’t have a problem if you used explicit column names instead of *, which is usually safer anyway. If you’re using * you can’t avoid recompiling (unless, I suppose, the * is the last item in the select list, in which case any extra columns on the end wouldn’t cause a problem – as long as their names didn’t clash).

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

Sidebar

Related Questions

I'm trying to work with PDO class on php but I have some trouble
I have some trouble trying to setup a template to solve address this situation:
I'm migrating to Nhibernate 2.0 GA but have some trouble with setting cache expirations
I am developing a small windows app, but have some trouble deciding whether to
I'm currently working on project with Haskell, and have found myself some trouble. I'm
I am having some trouble with the Google Maps API . I have an
I have created some rounded navigation tabs using CSS and am having trouble when
I have some ASP.NET web services which all share a common helper class they
I have some trouble with regex and php here: <span style=color: blue>word1</span> word by
I'm trying to write my first iPhone app and i'm having some trouble with

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.