how to increase "tr_trnbr" field in the table "tr_hist"

hubnb

New Member
for each tr_hist no-lock
where tr_domain = "01":
disp tr_trnbr.
end.

display:
trans
212916
212917
......

how to increase the number.

Thanks & Regards.
 
to increase the tr_trnbr by one.

code to increase the tr_trnbr by 1:
------------------------------------
find last tr_hist exclusive-lock.
trnbr = tr_trnbr. /*take tr_trnbr in a variable */
create tr_hist.
assign tr_trnbr = trnbr + 1.


code to increase the tr_trnbr by 10:
------------------------------------
find last tr_hist exclusive-lock.
trnbr = tr_trnbr. /*take tr_trnbr in a variable */
do i = 1 to 10 :
create tr_hist.
assign tr_trnbr = trnbr + 1.
end.
 
Why would you want to increase the tr_trnbr?

MFG/PRO sets this using a sequence stored in the database. You shouldn't really change tr_trnbr as it is a unique value for that transaction.

The code that QAD uses to set the transaction number is:
{mfrnseq.i tr_hist tr_hist.tr_trnbr tr_sq01}
which is an include file that takes in a table, a field and a sequence (in this case tr_hist, tr_trnbr and tr_sq01) and calculates the next-value with some rudimentary error-trapping.

If you want to create new transactions, I'd use something like that to generate the tr_trnbr. If you already have old transactions then you shouldn't change tr_trnbr.
 
Back
Top