Einzelnen Beitrag anzeigen

josef-b

Registriert seit: 6. Jun 2004
Ort: bei Jena in Thüringen
95 Beiträge
 
Delphi 11 Alexandria
 
#1

Containing in Firebird Stored Procedure

  Alt 8. Mär 2022, 07:59
Datenbank: Firebird • Version: 2.5 • Zugriff über: Delphi IBX
Ich habe eine Stored Procedure in Firebird 2.5



create or alter procedure R$EXEC (
ID type of column R$LOG.ID,
TBL_NAME type of column R$LOG.TBL_NAME,
TBL_ID type of column R$LOG.TBL_ID,
SQL type of column R$LOG.SQL,
BLB type of column R$LOG.BLB,
TS type of column R$LOG.TS,
USR type of column R$LOG.USR,
TID type of column R$LOG.TID,
CID type of column R$LOG.CID,
SRC type of column R$LOG.SRC)
as
declare variable R$DAT_KNOTEN integer;
begin
insert into R$LOG (ID, TBL_NAME, TBL_ID, SQL, BLB, TS, USR, TID, CID,SRC)
values (:ID, :TBL_NAME, :TBL_ID, :SQL, :BLB, :TS, :USR, :TID, :CID,:SRC);

if (sql containing '=:BLB WHERE ID=:ID')
then execute statement (:sql)(BLB:=BLB,ID:=TBL_ID)
else execute statement (:sql);

........



Dabei gehts mir um den Ausdruck mit Containing. So wie es da steht, geht es
natürlich nicht.

Wie muss ich das genau schreiben?

Wenn die Variable sql den Ausdruck '=:BLB WHERE ID=:ID' enthält mache dieses ansonsten jenes?

Ist in diesem Fall Containing eigenlich möglich?
  Mit Zitat antworten Zitat