Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Length of BLOB file

Re: Length of BLOB file

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 14 Jul 2001 06:06:52 -0700
Message-ID: <9ipg5c01dop@drn.newsguy.com>

In article <9ip37l$jrs$03$1_at_news.t-online.com>, "Damir says...
>
>I have tried and it doesn't work.
>I'm using Oracle 8.05 on Win2k (no SP installed).
>

you asked how to see the length of a BLOB field -- that is dbms_lob.getlength.

Your examples uses the deprecated LONG RAW type -- you are using the wrong datatype.

Change your create table to have a BLOB field, not long raw.

>Table is created throgh the script:
>-- TABELLE TMS_SYSBenutzerMenus
>CREATE TABLE TMS_SYSBenutzerMenus (
> nAppId NUMBER (5,0),
> sLoginName VARCHAR2(32),
> sAppVer VARCHAR2(32) CONSTRAINT TMS_SYSBenutzerMenus_NN_sVer
>NOT NULL,
> blMenus LONG RAW,
> sEingabe VARCHAR2(32) DEFAULT USER,
> dtEingabe DATE DEFAULT SYSDATE,
> sAenderung VARCHAR2(32) DEFAULT USER,
> dtAenderung DATE DEFAULT SYSDATE
>) TABLESPACE TMS_DATEN;
>
>ALTER TABLE TMS_SYSBenutzerMenus
> ADD CONSTRAINT TMS_SYSBenutzerMenus_PK PRIMARY KEY (nAppId,sLoginName)
> USING INDEX TABLESPACE TMS_INDEX;
>ALTER TABLE TMS_SYSBenutzerMenus
> ADD CONSTRAINT TMS_SYSBenutzerMenus_FK_nAppId FOREIGN KEY (nAppId)
>REFERENCES TMS_SYSApps(nAppId);
>ALTER TABLE TMS_SYSBenutzerMenus
> ADD CONSTRAINT TMS_SYSBenutzerMenus_FK_sLName FOREIGN KEY (sLoginName)
>REFERENCES TMS_SYSBENUTZER(sLoginName);
>----------------------------------------------------------------------------
>--------
>grant all on TMS_SYSBenutzerMenus to TMS_PRG;
>grant select on TMS_SYSBenutzerMenus to TMS_PRG_RO;
>create public synonym TMS_SYSBenutzerMenus for TMS.TMS_SYSBenutzerMenus;
>
>and the query I tried to execute is:
>"select dbms_lob.getlength(BLMENUS) from tms_sysbenutzermenus;"
>
>The error I get is:(from SQL workshop)
> SQLWKS> select dbms_lob.getlength(BLMENUS)
>
> 2> from tms_sysbenutzermenus;
>
> select dbms_lob.getlength(BLMENUS)
>
> *
>
> ORA-00997: Unzulässige Verwendung des Datentyps LONG
>
> SQLWKS>
>
>What is wrong?
>THX!
>
>"Damir Vadas" <Damir.Vadas_at_trinity.de> schrieb im Newsbeitrag
>news:9imp4u$ocf$00$1_at_news.t-online.com...
>> Hi!
>> How to see through SQL statement how much bytes does BLOB field occupied?
>> Regards
>> Damir!
>>
>>
>>
>
>

--
Thomas Kyte (tkyte@us.oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Sat Jul 14 2001 - 08:06:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US