Problem creating a new record

raptor

New Member
Hello Experts

I have a problem creating a new record in one table. At the moment, the next sequence number should be shown, nothing happens anymore. The client is not responding, the process 'prowin32.exe' is consuming a log of processor-capacity. The problem appears only in one table. Does anybody know how to solve this problem? Where are actual sequence-values stored?

Best regards
Troubleshooter
 
create table_xy.
assign field1 = "a".
assign field2 = "b".

running this, the client doesn't respond anymore. The problem appears only in one table. I think (...) that the problem is somewhere in sequences.
 
Are table / field triggers defined for this table? If so, what are they doing?

Both can be easily verified by running your code with the debugger.

Alternatively / additionally you can use logging (see help on log-manager system handle) to view all statements executed.
 
Thank you for your answer. I will check triggers as soon as I will be back in the office. But anyway, it cannot be a problem of the triggers. The problem appears since a 2 days, before it worked for years...
 
Thank you for your answer. I will check triggers as soon as I will be back in the office. But anyway, it cannot be a problem of the triggers. The problem appears since a 2 days, before it worked for years...

Triggers can contain all sorts of fun which can be data dependent - so how do you manage to rule this out this quickly?
 
This is the create-trigger of this table:
Code:
TRIGGER PROCEDURE FOR CREATE OF mailing.

def var l-ml_nr like mailing.ml_nr.
def buffer b-mailing for mailing.

{syvar.i}
{symon.i}

IF g-during_load = false
THEN DO:
    BLOCK:
  do while true:
    assign l-ml_nr = next-value(next-ml_nr).
    find b-mailing where 
         b-mailing.ml_nr = l-ml_nr
         no-lock no-error.
    if not available b-mailing then leave.
                               else next.
  end.
  if l-ml_nr = 0 then l-ml_nr = next-value(next-ml_nr).  
  assign mailing.ml_nr   = l-ml_nr
         mailing.sy_user = g-sb_code.
END.
The problem appears in the 'do while true' area. The line with 'if...' is executed anymore.


The Code
Code:
message next-value(next-ml_nr)
shows a value.


There are a few similar triggers for similar tables. Everything worked for years. Since yesterday this one table has this problem. :confused:
 
This is the create-trigger of this table:
Code:
TRIGGER PROCEDURE FOR CREATE OF mailing.

def var l-ml_nr like mailing.ml_nr.
def buffer b-mailing for mailing.

{syvar.i}
{symon.i}

IF g-during_load = false
THEN DO:
    BLOCK:
  do while true:
    assign l-ml_nr = next-value(next-ml_nr).
    find b-mailing where 
         b-mailing.ml_nr = l-ml_nr
         no-lock no-error.
    if not available b-mailing then leave.
                               else next.
  end.
  if l-ml_nr = 0 then l-ml_nr = next-value(next-ml_nr).  
  assign mailing.ml_nr   = l-ml_nr
         mailing.sy_user = g-sb_code.
END.

The problem appears in the 'do while true' area. The line with 'if...' is executed anymore.

See... lot's of fun in the trigger.


The Code
Code:
message next-value(next-ml_nr)
shows a value.


There are a few similar triggers for similar tables. Everything worked for years. Since yesterday this one table has this problem. :confused:

And which value is it showing? Has the sequence wrapped around (we do not use sequences, so no idea what happens when a sequence hits it's maximum) resulting in the DO WHILE TRUE loop racing through all your old mailing records.

Turn on clientlogging / use the debugger to see what's happening.
 
And which value is it showing? Has the sequence wrapped around (we do not use sequences, so no idea what happens when a sequence hits it's maximum)

Just for completeness, you can decide whether it wraps or not when you create the sequence, along with a few other options such as how it increments, where it starts and where it stops.
 
Back
Top