ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

SQL Table In Use

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

  • SQL Table In Use

    I have created a SQL Table that is used only in one program. This table will be populated by the program and then email from the SQLRPGLE program. I do have imbedded within the program to do a CLRPFM for this table. I also have the table defined as USROPN and also use a SQL Cursor. Both of these are closed prior to the *INLR = *ON.

    The first time that I process the program, everything works correctly. However, when I try to test the program a second time, I get a CPF3130 file in use error. Is there some other command that I'm missing that I need to use to close this table?


  • #2
    Hi Eddie,

    Do you have committment control in use? By default, it is turned on, so the changes will remain pending (and the table locked) until you commit or rollback. Could that be what's happening here? Another possibility is that you forgot to close the cursor (exec SQL close CURSOR-NAME).

    I'm curious why you use both SQL and native I/O in the program? (CLRPFM and USROPN are both native I/O).

    Comment


    • #3
      Yes I have commit set to *none. I did figure out the issue. I had 2 cursors and was only closing 1 of them. Now closing both of them, I no longer am getting the CP3130 file in use.

      Thanks for the little push in the right direction!

      Comment

      Working...
      X