troubleshooting Question

need to insert control record one time in sql loader

Avatar of Alaska Cowboy
Alaska CowboyFlag for United States of America asked on
Unix OSOracle Database
4 Comments1 Solution1881 ViewsLast Modified:
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,
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros