Upgrade 4gl-RDS V.4.0 to V.6.05
Posted in 1999
I have a problem with this code:
#####################################################################
DECLARE c_kst CURSOR FOR
SELECT bkto_kto,
bkto_ums,
bj_belnr,
bj_bchtxt,
bj_beldate
FROM buch_kto,
buch_jrn
WHERE bj_bchnr = bkto_nr
# AND bkto_kto[6,8] BETWEEN v_kst AND b_kst
AND bkto_kto[6,8] >= v_kst # v_kst = char(3)
AND bkto_kto[6,8] <= b_kst # b_kst = char(3)
AND bkto_kto[1,5] MATCHES "?????"
ORDER BY bkto_kto[1,5], bkto_kto[6,8],bj_belnr
######################################################################
the table-definition:
######################################################################
create table buch_jrn # Buchungs-Journale
(
bj_bchnr serial not null, # laufende Buchungs-Nr.
# ...
bj_belnr integer not null, # Beleg-Nr.
bj_bchtxt char(40), # Buchungstext
bj_ums decimal(14,2) not null, # Buchungsumsatz
bj_bchdate date not null, # Buchungstag
bj_beldate date, # Belegdatum
bj_susb smallint, # Anzahl der Sollbuchungen
bj_suhb smallint, # Anzahl der Habenbuchungen
bj_bchlnr smallint # Buchungslaufnr. am 31.12
);
create index ibjrn on buch_jrn (bj_bchnr); ######################################################################
create table buch_kto # Buchungsverteilung
(
bkto_nr integer not null, # Buchungs-Nr.
bkto_kto char(8), # Konto-Nr.
bkto_ums decimal(14,2) # Betrag H = - , S = +
);
create index ibkto on buch_kto (bkto_nr);
create index ibuch_kto on buch_kto (bkto_nr,bkto_kto); ######################################################################
With 4GL-RDS Version 4.0 it works fine for more then 8 years. With
Version 6.05 the c_kst-cursor isn't sort by bj_belnr. Why??
--
-----------------------------------------------------------------------
Gerhard Quell eMail: gquell@skequell.de web: http://www.skequell.de
-----------------------------------------------------------------------