Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2013
    Posts
    2

    DSNUTILB LOAD and NEXTVAL

    Hi,
    Is it possible to code NEXTVAL to get a sequence number from a sequence object in the Load control statement while loading using DSNUTILB?

    The fol. does not work

    LOAD DATA RESUME YES LOG YES INDDN SYSREC00 INTO TABLE
    SCHEMA.TABLE
    (
    USER_UID (NEXTVAL for SCHEMA.SEQOBJECT), PIN POSITION( 1 )
    CHAR( 6)
    NULLIF( 7)='?',

    Thanks in advance

  2. #2
    Join Date
    Apr 2012
    Posts
    135
    Try using an import, I am pretty sure load bypasses that sort of thing.
    IBM DB2 9.7 Information Center for Linux, UNIX, and Windows

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,261
    sorry azready : DSNUTILB sounds like Z/OS
    that is what you get when people do not indicate platform and db2 version...
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  4. #4
    Join Date
    Jan 2013
    Posts
    2
    We are on z/OS platform and DB2 version 10. One of the tables is going to be dropped and recreated with USER_UID as the primary key and a sequence object is being built to get the UIDs. The problem is when I unload data from the old database, the sequence object does not exists. I need to somehow get the UIDs from the seq object during load. Don't know if it is possible. Tried the fol. during load and I get INVALID syntax error.

    LOAD DATA RESUME YES LOG YES INDDN SYSREC00 INTO TABLE
    SCHEMA.TABLE
    (
    USER_UID (NEXTVAL FOR SCHEMA.SEQOBJECT),
    INVALID KEYWORD - NEXTVAL PIN POSITION( 1 )
    CHAR( 6)
    NULLIF( 7)='?',

    LOAD DATA RESUME YES LOG YES INDDN SYSREC00 INTO TABLE
    SCHEMA.TABLE (
    USER_UID (SELECT NEXT VALUE FOR SCHEMA.SEQOBJECT),
    INVALID KEYWORD - SELECT
    PIN POSITION( 1 )
    CHAR( 6)
    NULLIF( 7)='?',

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,649
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •