Avatar of Alaska Cowboy
Alaska Cowboy
Flag for United States of America asked on

need to insert control record one time in sql loader

I want to insert a record in a control table at the beginning of the load (with NEXTVAL seqno), then with the regular load will use CURRVAL.

Can I say something like "where rownum = 1" ? so it only happens once ?

APPEND INTO TABLE medpartd.etl_file_load_det
        when (rownum = 1) <-- something line this ??
        etl_load_file_id "medpartd.etl_file_load_det.nextval",
        etl_file_nm constant 'MMR Load from CGI',
        etl_prcs_load_dt "sysdate"
        INTO TABLE MEDPARTD.cgdp_stg_mthly_membshp_det
        mthly_membshp_skey "medpartd.mor_rpt_det_seq.nextval",
        aud_insrt_id "user",
        aud_srce_sys_cd constant '194',
        aud_insrt_tmstp "localtimestamp",
        etl_load_file_id "medpartd.etl_file_load_det_seq.currval",
        MCO_CTRT_NBR  position (1:5) char,
        RUN_DT_OF_THE_FILE  position (6:13) char,
        PAYMT_DT  position (14:19) char,
        HIC_NBR  position (20:31) char,

Open in new window

Oracle DatabaseUnix OS

Avatar of undefined
Last Comment
Alaska Cowboy

8/22/2022 - Mon
no worries :-) no nothing

rownum is for records selection
Alaska Cowboy


is there any way to accomplish what I'm trying to do ?
Alaska Cowboy

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Alaska Cowboy

This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.