Hello:
I have an Oracle package which implements a number of functions for a webservice. The SendReturns function of the package is used by the webservice to deliver XML via p_ReturnsData which is stored in a CLOB in the database.
A TOraclePackage(EServicesPackage) is used to access the oracle function. The maximum size transmitted is 4000 bytes which corresponds to Varchar2 and not clob limitations.
What do I need to do to send the full XML and not just the first 4000 bytes?
Thanks, Sidney
Here is the pertinent coding in the Delphi program:
---------------------------------------------------
var
ReturnsData: String;
p_ReportDate: TDateTime;
Result: String;
begin
ReturnsData := edReturnData.Text;
p_ReportDate := StrToDate(edReportingDate.Text);
Result := EservicesPackage.CallStringFunction('SendReturnsData',[p_ReportDate,ReturnsData]);
end;
Here are the corresponding package definitions in Oracle 10:
------------------------------------------------------------
create or replace package Eservices as
function SendReturnsData (p_ReportDate IN date,p_ReturnsData IN clob) return varchar2;
end Eservices;
create or replace package body Eservices as
function SendReturnsData (p_ReportDate IN date,p_ReturnsData IN clob) return varchar2 is
v_ProcessedDateTime EservicesReports.ProcessedDateTime%type;
v_ReturnsDateTime EservicesReports.ReturnsDateTime%type;
v_ReturnsData EservicesReports.ReturnsData%type;
begin
select ProcessedDateTime,ReturnsDateTime,ReturnsData
into v_ProcessedDateTime,v_ReturnsDateTime,v_ReturnsData
from EservicesReports
where ReportDate = p_ReportDate;
if not v_ProcessedDateTime is NULL then
return 'Rejected';
elsif v_ReturnsDateTime is NULL then
update EServicesReports
set ReturnsData = p_ReturnsData,
ReturnsDateTime = SYSDATE
where ReportDate = p_ReportDate;
commit;
return 'Accepted '||Length(p_ReturnsData)||' bytes';
else
update EServicesReports
set ReturnsData = p_ReturnsData,
ReturnsDateTime = SYSDATE
where ReportDate = p_ReportDate;
commit;
return 'Updated '||Length(p_ReturnsData)||' bytes';
end if;
exception
when NO_DATA_FOUND then
insert into EservicesReports(ReportDate,ReturnsData,ReturnsDateTime)
values (p_ReportDate,p_ReturnsData,SYSDATE);
commit;
return 'Accepted '||Length(p_ReturnsData)||' bytes';
end SendReturnsData;
end Eservices;
I have an Oracle package which implements a number of functions for a webservice. The SendReturns function of the package is used by the webservice to deliver XML via p_ReturnsData which is stored in a CLOB in the database.
A TOraclePackage(EServicesPackage) is used to access the oracle function. The maximum size transmitted is 4000 bytes which corresponds to Varchar2 and not clob limitations.
What do I need to do to send the full XML and not just the first 4000 bytes?
Thanks, Sidney
Here is the pertinent coding in the Delphi program:
---------------------------------------------------
var
ReturnsData: String;
p_ReportDate: TDateTime;
Result: String;
begin
ReturnsData := edReturnData.Text;
p_ReportDate := StrToDate(edReportingDate.Text);
Result := EservicesPackage.CallStringFunction('SendReturnsData',[p_ReportDate,ReturnsData]);
end;
Here are the corresponding package definitions in Oracle 10:
------------------------------------------------------------
create or replace package Eservices as
function SendReturnsData (p_ReportDate IN date,p_ReturnsData IN clob) return varchar2;
end Eservices;
create or replace package body Eservices as
function SendReturnsData (p_ReportDate IN date,p_ReturnsData IN clob) return varchar2 is
v_ProcessedDateTime EservicesReports.ProcessedDateTime%type;
v_ReturnsDateTime EservicesReports.ReturnsDateTime%type;
v_ReturnsData EservicesReports.ReturnsData%type;
begin
select ProcessedDateTime,ReturnsDateTime,ReturnsData
into v_ProcessedDateTime,v_ReturnsDateTime,v_ReturnsData
from EservicesReports
where ReportDate = p_ReportDate;
if not v_ProcessedDateTime is NULL then
return 'Rejected';
elsif v_ReturnsDateTime is NULL then
update EServicesReports
set ReturnsData = p_ReturnsData,
ReturnsDateTime = SYSDATE
where ReportDate = p_ReportDate;
commit;
return 'Accepted '||Length(p_ReturnsData)||' bytes';
else
update EServicesReports
set ReturnsData = p_ReturnsData,
ReturnsDateTime = SYSDATE
where ReportDate = p_ReportDate;
commit;
return 'Updated '||Length(p_ReturnsData)||' bytes';
end if;
exception
when NO_DATA_FOUND then
insert into EservicesReports(ReportDate,ReturnsData,ReturnsDateTime)
values (p_ReportDate,p_ReturnsData,SYSDATE);
commit;
return 'Accepted '||Length(p_ReturnsData)||' bytes';
end SendReturnsData;
end Eservices;