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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:57:00+00:00 2026-06-15T07:57:00+00:00

I have cursor which is selecting data and it is running quite fine CURSOR

  • 0

I have cursor which is selecting data and it is running quite fine

CURSOR Crs_c1 IS
SELECT a.GLOBAL_ACCOUNT_CODE,
       a.LOCAL_ACCOUNT_CODE,
       a.LOCAL_ACCOUNT_NAME,
       c.GLOBAL_ACCOUNT_TYPE  t_conto,
       ltrim(rtrim(a.GLOBAL_ACCOUNT_CODE))||ltrim(rtrim(a.LOCAL_ACCOUNT_CODE)) GLOBAL_LOCAL
 FROM  V_LOCAL_ACCOUNTS@GDW_LIVE  a,V_GLOBAL_ACCOUNTS@GDW_LIVE  c --V_LOCAL_ACCOUNTS@GDWPP_ANY  a,V_GLOBAL_ACCOUNTS@GDWPP_ANY  c
 WHERE a.enabled_flag = 'Y'
 AND a.GLOBAL_ACCOUNT_CODE=c.GLOBAL_ACCOUNT_CODE
 AND not exists (SELECT 1
                 FROM conto_gdw b   -- considero solo i conti nuovi
                 WHERE a.LOCAL_ACCOUNT_CODE = b.c_conto_local_gdw
                AND   a.GLOBAL_ACCOUNT_CODE=b.C_CONTO_GLOBAL_GDW);

But at the time of insertion the code fails….

INSERT INTO conto_gdw
                    (C_CONTO_LOCAL_GDW,
                     S_CONTO_LOCAL_GDW,
                     C_CONTO_GLOBAL_GDW,
                     T_CONTO,
                     D_INIZIO,
                     GLOBAL_LOCAL)
             VALUES (Rec_Crs_c1.LOCAL_ACCOUNT_CODE,
                     nvl(Rec_Crs_c1.LOCAL_ACCOUNT_NAME,'.'),
                     Rec_Crs_c1.GLOBAL_ACCOUNT_CODE,
                     Rec_Crs_c1.t_conto,
                     (v_anno_in * 100) + v_mese_in,
                     Rec_Crs_c1.GLOBAL_LOCAL);

May be this problem is occuring because of a single tuple (dataset). How can I find that culprit data?
I have checked all the data from cursor selection by taking it in a excel sheet, I could not find anything manually. Is there any way ORACLE would return me the failed data?

  • 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-15T07:57:02+00:00Added an answer on June 15, 2026 at 7:57 am

    You need to have a proper exception handling while inserting data .Provide the output of the pl sql block .After than we can help you.

    DECLARE
       CURSOR Crs_c1
       IS
          SELECT   a.GLOBAL_ACCOUNT_CODE,
                   a.LOCAL_ACCOUNT_CODE,
                   a.LOCAL_ACCOUNT_NAME,
                   c.GLOBAL_ACCOUNT_TYPE t_conto,
                   LTRIM (RTRIM (a.GLOBAL_ACCOUNT_CODE))
                   || LTRIM (RTRIM (a.LOCAL_ACCOUNT_CODE))
                      GLOBAL_LOCAL
            FROM   V_LOCAL_ACCOUNTS@GDW_LIVE a, V_GLOBAL_ACCOUNTS@GDW_LIVE c 
           WHERE   a.enabled_flag = 'Y'
                   AND a.GLOBAL_ACCOUNT_CODE = c.GLOBAL_ACCOUNT_CODE
                   AND NOT EXISTS
                         (SELECT   1
                            FROM   conto_gdw b     -- considero solo i conti nuovi
                           WHERE   a.LOCAL_ACCOUNT_CODE = b.c_conto_local_gdw
                                   AND a.GLOBAL_ACCOUNT_CODE =
                                         b.C_CONTO_GLOBAL_GDW);
    
    Rec_Crs_c1 Crs_c1%ROWTYPE;
    BEGIN
       OPEN Crs_c1;
    
       LOOP
          FETCH Crs_c1 INTO   Rec_Crs_c1;
    
          EXIT WHEN Crs_c1%NOTFOUND;
    
          INSERT INTO conto_gdw (C_CONTO_LOCAL_GDW,
                                 S_CONTO_LOCAL_GDW,
                                 C_CONTO_GLOBAL_GDW,
                                 T_CONTO,
                                 D_INIZIO,
                                 GLOBAL_LOCAL)
            VALUES   (Rec_Crs_c1.LOCAL_ACCOUNT_CODE,
                      NVL (Rec_Crs_c1.LOCAL_ACCOUNT_NAME, '.'),
                      Rec_Crs_c1.GLOBAL_ACCOUNT_CODE,
                      Rec_Crs_c1.t_conto,
                      (v_anno_in * 100) + v_mese_in,
                      Rec_Crs_c1.GLOBAL_LOCAL);
       END LOOP;
    
       CLOSE Crs_c1;
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line ('Error Message' || SQLERRM);
          DBMS_OUTPUT.put_line(   'GLOBAL_ACCOUNT_CODE :'
                               || Rec_Crs_c1.LOCAL_ACCOUNT_CODE
                               || 'LOCAL_ACCOUNT_CODE '
                               || Rec_Crs_c1.LOCAL_ACCOUNT_NAME
                               || 'GLOBAL_ACCOUNT_CODE :'
                               || Rec_Crs_c1.GLOBAL_ACCOUNT_CODE
                               || 'GLOBAL_ACCOUNT_TYPE '
                               || Rec_Crs_c1.t_conto
                               || 'GLOBAL_LOCAL'
                               || Rec_Crs_c1.GLOBAL_LOCAL);
    END;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored procedure in oracle which is using cursor.Its fetching the data
I have a cursor which works fine but when it gets to this part
I am creating a Control Library project. I have some Cursor files which i
I have a stored procedure which returns a ref cursor as follows: CREATE OR
If I have a function which returns a reference cursor for a query, how
So I have my MainDisplayActivity which implements both Activity and LoaderManager.LoaderCallbacks<Cursor> . Here I
I have the cursor with the query statement as follows: cursor.execute(select rowid from components
After querying the data I wanted, I now have a cursor holding all the
I have following method in my class which extends JTable: protected void setTableCursor(Cursor cursor)
i have cursor which selects records from my CarProfile table and use custom adapter

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.