🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.database
Article #8419

Re: ������û���ù�oracle��clob�ֶεģ�

#8419
From: �������
Date: Thu, 20 Nov 2003 08:49
79 lines
3403 bytes
����һ���ĵ���������ǵ�����ˣ����Ͳ�ƥ�� ��
ORA-22275 invalid LOB locator specified
Cause: There are several causes:
1The LOB locator was never initialized
2The locator is for a BFILE and the routine expects a BLOB/CLOB/NCLOB locato
r
3The locator is for a BLOB/CLOB/NCLOB and the routine expects a BFILE locato
r
4Trying to update the LOB in a trigger body -- LOBs in trigger bodies are re
ad-only
5The locator is for a BFILE/BLOB and the routine expects a CLOB/NCLOB locato
r
6The locator is for a CLOB/NCLOB and the routine expects a BFILE/BLOB locato
r
Action: For (1), initialize the LOB locator by selecting into the locator va
riable or by setting the LOB locator to empty. For (2),(3), (5), and (6),pas
s the correct type of locator into the routine. For (4), remove the trigger 
body code that updates the LOB value.


�� �� jiddy (�ƶ���) �Ĵ������ᵽ: ��
������������̣����ڴ��ļ�����ݵ�clob��о��˰���»���û�н�չ��������̳��


������Ҳû�á�
�洢������£�
create or replace procedure FileToClob(p_Directory IN VARCHAR2,p_FileName IN 
V

ARCHAR2,p_AccNum IN varchar2) is
  v_FileLocator BFILE;
  v_CLOBLocator CLOB;
begin
   SELECT sequence    --�����У�ֱ����exception!
    INTO v_CLOBLocator
    FROM jiao.seq_info
    where accession_id = p_AccNum
    FOR UPDATE;   
   -- Initialize the BFILE locator for reading.
    v_FileLocator := BFILENAME(p_Directory, p_FileName);
    DBMS_LOB.FILEOPEN(v_FileLocator, DBMS_LOB.FILE_READONLY);

    DBMS_LOB.LOADFROMFILE(v_CLOBLocator, v_FileLocator,DBMS_LOB.GETLENGTH(v_F
i

leLocator));
   
   DBMS_LOB.FILECLOSE(v_FileLocator);
   
EXCEPTION
  when no_data_found then 
    DBMS_LOB.FILECLOSE(v_FileLocator);
  when too_many_rows then 
    DBMS_LOB.FILECLOSE(v_FileLocator);

  WHEN OTHERS THEN
    DBMS_LOB.FILECLOSE(v_FileLocator);
    
    RAISE;

end FileToClob;

���ٳ��򣬷���ִ�е�select sequence�����ֱ����no data found��exception��
��

Ȼ�󱨴�˵��ORA-06502:PL/SQL:���ֻ�ֵ����invalid LOB locator specified:ORA-
2

2275��
˭�ܰ���ң���ָ�л��
ϣ�����qq��ϵ��12826075


--



--
�� ��Դ:������δ��վ bbs.pku.edu.cn��[FROM: 61.149.135.209]
Technical Details
Message-ID: <49L1Zf$ZC7@bbs.pku.edu.cn>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!west.cox.net!east.cox.net!filt01.cox.net!peer02.cox.net!cox.net!news3.optonline.net!maily.cic.tsinghua.edu.cn!news.happynet.org!PKU

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,GB
X-Google-Thread: 101948,55cb08bcbf4efe9c,start
X-Google-Attributes: gid101948,public
X-Google-ArrivalTime: 2003-11-20 00:50:18 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!elnk-pas-nf1!newsfeed.earthlink.net!west.cox.net!east.cox.net!filt01.cox.net!peer02.cox.net!cox.net!news3.optonline.net!maily.cic.tsinghua.edu.cn!news.happynet.org!PKU
From: maghaen@bbs.pku.edu.cn (�������)
Newsgroups: cn.bbs.comp.database
Subject: Re: ������û���ù�oracle��clob�ֶεģ�
Date: 20 Nov 2003 08:49:16 GMT
Organization: ����δ��վ
Message-ID: <49L1Zf$ZC7@bbs.pku.edu.cn>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: Database/M.1069318073.A
Lines: 79