Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » PSP with ORDDoc
PSP with ORDDoc [message #138057] Mon, 19 September 2005 12:56 Go to next message
herry.roby
Messages: 10
Registered: September 2005
Junior Member
Hi,

I want to build PSP Web Application but I got a problem.

create table docstab (id numeric primary key, title varchar2(4000), doc ordsys.orddoc);

LOAD DATA
INFILE 'loader.dat'
INTO TABLE docstab
APPEND
FIELDS TERMINATED BY ';'
(id INTEGER,
title CHAR,
doc COLUMN OBJECT
(
mimetype,
source column object
(
localData_fname FILLER CHAR(12),
localData LOBFILE(doc.source.localData_fname) raw TERMINATED BY EOF
)
)
)

% sqlldr userid=scott/tiger control=loader.ctl

CREATE INDEX idx_tab ON docstab(document.source.localdata)
INDEXTYPE IS CTXSYS.CONTEXT;
COMMIT;

-- when i create search_htmlservices.sql --
set define off
create or replace package search_htmlServices as
procedure showHTMLDoc (p_id in docstab.id%type);
procedure showDoc (p_id in varchar2, p_query in varchar2);
end;
/
show errors;

create or replace package body search_htmlServices as

procedure showHTMLDoc (p_id in docstab.id%type) is
v_clob_selected CLOB;
v_read_amount integer;
v_read_offset integer;
v_buffer RAW(32767);

begin
select text into v_clob_selected from docstab where id = p_id;
v_read_amount := 32767;
v_read_offset := 1;
begin
loop
dbms_lob.read(v_clob_selected,v_read_amount,v_read_offset,v_buffer);
htp.print(v_buffer);
v_read_offset := v_read_offset + v_read_amount;
v_read_amount := 32767;
end loop;
exception
when no_data_found then
null;
end;
end showHTMLDoc;


procedure showDoc (p_id in varchar2, p_query in varchar2) is

v_clob_selected CLOB;
v_read_amount integer;
v_read_offset integer;
v_buffer RAW(32767);
v_query varchar(2000);
v_cursor integer;

begin
htp.p('<html><title>HTML version with highlighted terms</title>');
htp.p('<body bgcolor="#ffffff">');
-- htp.p('<b>HTML version with highlighted terms</b>');

begin
ctx_doc.markup (index_name => 'idx_tab',
textkey => p_id,
text_query => p_query,
restab => v_clob_selected,
starttag => '<i><font color=red>',
endtag => '</font></i>');

v_read_amount := 32767;
v_read_offset := 1;
begin
loop
dbms_lob.read(v_clob_selected,v_read_amount,v_read_offset,v_buffer);
htp.print(v_buffer);
v_read_offset := v_read_offset + v_read_amount;
v_read_amount := 32767;
end loop;
exception
when no_data_found then
null;
end;

exception
when others then
null; --showHTMLdoc(p_id);
end;
end showDoc;
end;
/
show errors


set define on

returns:

Package created.

No errors.

Warning: Package Body created with compilation errors.
Errors for PACKAGE BODY SEARCH_HTMLSERVICES:
LINE/COL ERROR
10/6 PL/SQL: SQL Statement ignored
10/13 PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got OR DSYS.ORDDOC

can anyone help me?

Herry
Re: PSP with ORDDoc [message #138231 is a reply to message #138057] Tue, 20 September 2005 16:23 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
when you declare LOB as CLOB in DBMS_LOB then you should define length and offset interms of charaters not interms on Integers.
You have defined v_read_amount,v_read_offset as integers.I think so only you are getting that error.

for more info check this.

--Kiran.
Re: PSP with ORDDoc [message #138522 is a reply to message #138231] Thu, 22 September 2005 06:21 Go to previous message
herry.roby
Messages: 10
Registered: September 2005
Junior Member
Hi Kiran,

Thanks for the reply.
I'll try it.

Regards,

Herry
Previous Topic: ORA-12560 TNS:protocol adapter error
Next Topic: oralce 8
Goto Forum:
  


Current Time: Wed Nov 25 14:14:38 CST 2020