Registriert seit: 7. Feb 2006
429 Beiträge
|
sp lässt sich nicht erstellen
19. Mai 2006, 21:23
Datenbank: firebird 1.5 • Zugriff über: ibx, ibexpert
hallo!
ich wollte gerade wieder eine sp erstellen und auf einmal bekomm ich irgendeine meldung, dass ich irgendeinen unique index
doppelt belegen will...ist mir unerklärlich..blickt ihr das? ( db ist im anhang)
SQL-Code:
SET TERM ^ ;
create PROCEDURE GET_NEXT_20_DICENTRIES_BY_ID (
ID BIGINT)
RETURNS (
DATUM DATE,
AUT VARCHAR(3) CHARACTER SET WIN1252,
ZSDEF BLOB SUB_TYPE 1 SEGMENT SIZE 4096 CHARACTER SET WIN1252,
ZSSEM VARCHAR(80) CHARACTER SET WIN1252,
UPDAUT VARCHAR(3) CHARACTER SET WIN1252,
ZSQCODE VARCHAR(15) CHARACTER SET WIN1252,
ZSPRGM VARCHAR(20) CHARACTER SET WIN1252,
ASQCODE VARCHAR(15) CHARACTER SET WIN1252,
ZSVERW VARCHAR(80) CHARACTER SET WIN1252,
ZSABK VARCHAR(10) CHARACTER SET WIN1252,
UPDDATUM DATE,
ZSAUDIO VARCHAR(20) CHARACTER SET WIN1252,
ASVERW VARCHAR(80) CHARACTER SET WIN1252,
ZSTERM VARCHAR(80) CHARACTER SET WIN1252,
ZSVIDEO VARCHAR(20) CHARACTER SET WIN1252,
ZSABBILDUNG VARCHAR(20) CHARACTER SET WIN1252,
ASVIDEO VARCHAR(20) CHARACTER SET WIN1252,
ASABBILDUNG VARCHAR(20) CHARACTER SET WIN1252,
PROJ VARCHAR(20) CHARACTER SET WIN1252,
ASDEF BLOB SUB_TYPE 1 SEGMENT SIZE 4096 CHARACTER SET WIN1252,
ASAUDIO VARCHAR(20) CHARACTER SET WIN1252,
REV VARCHAR(1) CHARACTER SET WIN1252,
ASSEM VARCHAR(80) CHARACTER SET WIN1252,
ASPRGM VARCHAR(20) CHARACTER SET WIN1252,
ASABK VARCHAR(10) CHARACTER SET WIN1252,
ASTERM VARCHAR(80) CHARACTER SET WIN1252,
ID BIGINT)
AS
begin
for
select first 20 d.id, d.asterm, d.asabk, d.asprgm, d.assem, d.zsterm,
d.zsabk, d.zsprgm, d.zssem, d.datum, d.proj, d.rev, d.upddatum, d.asdef,
d.zsdef, d.asaudio, d.asvideo, d.asabbildung, d.zsabbildung, d.zsaudio,
d.zsvideo, asmain.asterm, zsmain.zsterm, a.aut, ua.aut,
aslit.qcode, zslit.qcode
from dicentries d
left join dicentries asmain on d.asverw = asmain.id
left join dicentries zsmain on d.zsverw = zsmain.id
left join aut a on d.aut = a.id
left join aut ua on d.updaut = ua.id
left join lit aslit on d.asqcode = aslit.id
left join lit zslit on d.zsqcode = zslit.id
where d.id > :id order by d.id
into :id, :asterm, :asabk, :asprgm, :assem, :zsterm, :zsabk, :zsprgm,
:zssem, :datum, :proj, :rev, :upddatum, :asdef, :zsdef, :asaudio, :asvideo,
:asabbildung, :zsabbildung, :zsaudio, :zsvideo, :asverw, :zsverw, :aut,
:updaut, :asqcode, :zsqcode
do
suspend;
end
^
SET TERM ; ^
Um Rekursion zu verstehen, muss man zunächst Rekursion verstehen.
|