ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

truncate sometimes silently failing?

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

  • truncate sometimes silently failing?

    I have some tables where "truncate myTable;" run from iACS Run SQL Scripts reports success but does not remove any records. Nothing in the job log either.

    Any thoughts?

  • #2
    Is it possible that it's actually working...BUT...not on the table you expected to be truncated? Without qualifying the table, Run SQL Scripts will use the current JDBC environment as it searches for the unqualified object.

    Comment


    • #3
      I am qualifying the table: "truncate myLib/myTable;"

      Apologies, bad description on my part - I should have specified that. It does work on some tables, so I assume it's something about the table itself that is blocking it

      Comment


      • #4
        Have you tried with the "debug mode"?.
        It could give you more information.

        You can set it in "options" (in the ACS run script window).
        And then, check again the joblog.



        To be sure the job you are checking is the correct one, you can run this sentence in the script window: values(qsys2.Job_Name);

        Comment


        • #5
          Thanks for the tip about debug, it never occurred to me to do that in iACS.
          Turns out it was an authority issue - apparently *GROUP *CHANGE is enough for "delete * from mytable;" and for "CLRPFM mytable", but not enough for "truncate mytable". Job log showed CPF9822 Not authorized to file mytable in library mylib. Weird that I can still do deletes inserts, and CLRPFM's, but not truncate - and that truncate did not report an error except in debug job log. I wonder if this is a bug?

          Comment


          • #6
            SQL authorities (ie TRUNCATE, etc) are different than IBM i authorities - enough to drive a sane person nutty LOL

            Comment

            Working...
            X