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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:18:49+00:00 2026-06-01T08:18:49+00:00

My script below will use two external tables to fill two separate tables, but

  • 0

My script below will use two external tables to fill two separate tables, but am not sure if I am using my cursor the correct way. If I am using it in a incorrect way please help me to correct the mistake.

// update
It’s for an oracle database (ORACLE SQL)

DECLARE
L_volg_no1 NUMBER;
L_volg_no2 NUMBER;

CURSOR c_gip IS

SELECT
    artikelnummer,
    ingangsdatum,
    grossiersprijs
FROM dc_RMSSID_GIP;

CURSOR c_gip_promo IS

SELECT
    artikelnummer,
    ingangsdatum
    promo_nummer,
    actie_grossiersprijs    
FROM dc_RMSSID_GIPPromo;

     BEGIN
FOR r_sid1 in c_gip
LOOP

SELECT daa_imp_rms_gip_seq.NEXTVAL INTO L_volg_no1 FROM DUAL;

INSERT 
INTO daa_imp_rms_grossiersprijs (
    volg_nr
    ,importtijdstip
    ,importstatus
    ,artikelnummer
    ,ingangsdatum
    ,grossiersprijs         
)
VALUES (
    L_volg_no1,
    SYSDATE,
    'N',
    r_sid1.artikelnummer,
    r_sid1.ingangsdatum,
    r_sid1.grossiersprijs
);

END LOOP;

FOR r_sid2 in c_gip_promo
LOOP

SELECT daa_imp_rms_prm_gip_seq.NEXTVAL INTO L_volg_no2 FROM DUAL;

INSERT 
INTO daa_imp_rms_prm_grossiersprijs (
    volg_nr
    ,importtijdstip
    ,importstatus
    ,artikelnummer
    ,ingangsdatum
    ,promo_nummer
    ,grossiersprijs 
)
VALUES (
    L_volg_no2,
    SYSDATE,
    'N',
    r_sid2.artikelnummer,
    r_sid2.ingangsdatum,
    r_sid2.promo_nummer,
    r_sid2.grossiersprijs
);

END LOOP;

COMMIT;
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-06-01T08:18:50+00:00Added an answer on June 1, 2026 at 8:18 am

    The syntax looks fairly good but trust your testing more than my eyes 🙂

    But more importantly; why use cursors for this task? Two insert statements would do the same job and being set-based (rather than procedural) code is likely to perform better in most RDBMSes.

    Begin
        INSERT 
        INTO daa_imp_rms_grossiersprijs (
            volg_nr
            ,importtijdstip
            ,importstatus
            ,artikelnummer
            ,ingangsdatum
            ,grossiersprijs         
        )
            select  (
                daa_imp_rms_gip_seq.NEXTVAL,
                SYSDATE,
                'N',
                artikelnummer,
                ingangsdatum,
                grossiersprijs
        FROM dc_RMSSID_GIP;
    
        INSERT 
        INTO daa_imp_rms_prm_grossiersprijs (
            volg_nr
            ,importtijdstip
            ,importstatus
            ,artikelnummer
            ,ingangsdatum
            ,promo_nummer
            ,grossiersprijs 
        )
        select 
                daa_imp_rms_prm_gip_seq.NEXTVAL, 
                SYSDATE,
                'N',
                artikelnummer,
                ingangsdatum
                promo_nummer,
                actie_grossiersprijs    
        FROM dc_RMSSID_GIPPromo;
    
        commit;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the script below. It will launch two subprocesses, each one a CherryPy app
I'm trying to sum up all the values in this script below but not
The script below worked on my Mac OS X. I'm now using Ubuntu OS,
The script below should open all the files inside the folder 'pruebaba' recursively but
I'm using the script below, so user can upload their profile picture. The first
consider the below script. two arrays with only three values.when i compare these two
Will this script below work with the IPN Messages Sent with IPNs if the
I am putting an XSL together than will create a NAnt build script using
The script below, test.php, is intended to be placed in a specific directory of
The script below resides in my theme's functions.php file. It is designed to show

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.