Well, let me be a bit more specific. I'm sorry if I wasn't more clear.
DB2 supports "execute immediate" but it was not clear if it is supported how we use it:
IBM DB2 9.7 for Linux, UNIX and Windows Information Center
Example -
begin
select a.* into thisEmbCont from embedded_content a where a.fiscal_years_id = yearId
and a.lookup_name = lookupName and a.status = 'ACTIVE' and a.embedded_content_id is null;
bfm_emb_cont.insertedContent := '';
codeblock := REPLACE (thisEmbCont.code, CHR (13) || CHR (10), CHR (10));
begin
execute immediate codeblock;
end;
An execute immediate codeblock example (full PL/SQL) -
declare
tempClob clob;
userName varchar2(80) := owa_custom.getUser;
orgAbbr varchar2(40);
startPos number := 1;
year number := 0;
pNames varchar2(32000);
pValues varchar2(32000);
begin
userName := owa_custom.getUser;
DBMS_LOB.CREATETEMPORARY(tempClob, TRUE, DBMS_LOB.CALL);
select fiscal_year into year from fiscal_years where id = bfm_emb_cont.yearId;
pNames :='orgId~setId~year~userSessionId';
pValues :=Bfm_emb_cont.orgId|| '~' ||bfm_emb_cont.setId|| '~'||year||'~DocEng';
tempClob:= FW_UTILITIES****njavareportbyname(
'gov.treas.bfm.rtf.doeReports.EnergyPMMReport',
'runReport',
pNames,
pValues
);
startPos := inStr(tempClob, '\par', startPos);
-- if startPos <> 0 then
if 2>1 then
Bfm_emb_cont.insertedContent := replace(substr(tempClob, startPos + 4, length(tempClob) - startPos - 4), '\clcbpat1', '');
Bfm_emb_cont.insertedContent := replace(Bfm_emb_cont.insertedContent, '\clcbpat2', '\clcbpat' || Bfm_emb_cont.colors('SKY_BLUE'));
Bfm_emb_cont.insertedContent := replace(Bfm_emb_cont.insertedContent, '\f3', '\f1');
else
Bfm_emb_cont.insertedContent := '\cf6\b ERROR: malformed document';
end if;
exception when others then
Bfm_emb_cont.insertedContent := '\cf6\b ERROR: ' || sqlerrm;
end;
----------------
Does this seem doable within this context for DB2??