Hello,
I have used Package wizard to make a wrapper around my package. It created this function:
// SHP_DOC_GEN.GET_DOCUMENT
function TShpDocGen.GetDocument(Document: Double): TLOBLocator;
begin
Result := TLOBLocator.Create(Session, otCLOB);
try
GetQuery;
OCPQuery.DeclareVariable('function_result', otCLOB);
OCPQuery.SetComplexVariable('function_result', Result);
OCPQuery.DeclareVariable('DOCUMENT', otFloat);
OCPQuery.SetVariable('DOCUMENT', Document);
OCPQuery.SQL.Add('begin');
OCPQuery.SQL.Add(' :function_result := "SHP_DOC_GEN"."GET_DOCUMENT"(DOCUMENT =>
OCUMENT);');
OCPQuery.SQL.Add('end;');
OCPQuery.Execute;
except
Result.Free;
raise;
end;
end;
When I call it from my code like this:
memo2.Lines.LoadFromStream(pckg.GetDocument(doc_id));
I am getting access violation at this line in
function wrapper:
GetQuery;
What am I doing wrong? I couldn't find any help what GetQuery is doing...
Where is GetQuery and OCPQuery declared?
Thanks,
Ivan
I have used Package wizard to make a wrapper around my package. It created this function:
// SHP_DOC_GEN.GET_DOCUMENT
function TShpDocGen.GetDocument(Document: Double): TLOBLocator;
begin
Result := TLOBLocator.Create(Session, otCLOB);
try
GetQuery;
OCPQuery.DeclareVariable('function_result', otCLOB);
OCPQuery.SetComplexVariable('function_result', Result);
OCPQuery.DeclareVariable('DOCUMENT', otFloat);
OCPQuery.SetVariable('DOCUMENT', Document);
OCPQuery.SQL.Add('begin');
OCPQuery.SQL.Add(' :function_result := "SHP_DOC_GEN"."GET_DOCUMENT"(DOCUMENT =>

OCPQuery.SQL.Add('end;');
OCPQuery.Execute;
except
Result.Free;
raise;
end;
end;
When I call it from my code like this:
memo2.Lines.LoadFromStream(pckg.GetDocument(doc_id));
I am getting access violation at this line in
function wrapper:
GetQuery;
What am I doing wrong? I couldn't find any help what GetQuery is doing...
Where is GetQuery and OCPQuery declared?
Thanks,
Ivan