ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Sqlcode= -7008 - create table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sqlcode= -7008 - create table

    Hi,

    I get SQLCODE = -7008 when I try to create a table with SQL embedded in RPGLE program.. but I don't have any idea why, because initially it was all things OK, and now I supposed that was some changes regarding compilation options, options default.
    With the same source, but the object created 1 month ago, the table is created, and now, with the same source but new object, created now, SQLCODE=-7008 at create statement.
    Please help me with some advices, thanks in advance

  • #2
    DSPMSGD RANGE(SQL7008) MSGF(QSQLMSG) can show possibilities for SQLSTATE 55019 (relates to SQLCODE -7008 and others; you should consider using SQLSTATE rather than SQLCODE since it's more standardized). There are many possibilities depending on the message return code.

    Use the SQL GET DIAGNOSTICS statement to retrieve more error data.
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment


    • #3
      It was o problem with Commitment control . . . . . . . COMMIT, section from the command CRTSQLRPGI - (option 14 compile + F4)
      The default value was *CHG, and didn't work, I get -7008 sqlcode, after the CREATE statement I have also DROP & TRUNCATE for this table (all operations in QTEMP).. I changed to *NONE the compile option "Commitment control " and now it works, sqlcode=0 for create.. I suppossed it is ok for all the cases.

      Comment


      • #4
        In that case, it was potentially reason code '3' -- from the message description text "&1 not journaled, no authority to the journal, or the journal state is *STANDBY." Commitment control requires journaling in order to track and control potentially temporary changes.
        Tom

        There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

        Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

        Comment


        • #5
          You can put something like this as the first C-specs in your source, so that it won't matter if you forget to change COMMIT(*none) when you compile:
          Code:
          //-- Set SQL options        
          Exec sql                    
            SET OPTION commit = *none;

          Comment

          Working...
          X