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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to transfer varchar2 to long raw

Re: How to transfer varchar2 to long raw

From: Brian Peasland <dba_at_nospam.peasland.net>
Date: Thu, 31 Aug 2006 15:19:57 GMT
Message-ID: <J4vBxG.2Iy@igsrsparc2.er.usgs.gov>


> The real field name is YFBZYJ in table T1 and T2.
> I use Oracle 9i.
>
> Some one design the database, the field YFBZYJ is
> used for client to fill opinion which maybe
> 100 characters, or maybe 5,000 characters long.
> So the designer change the origin field type
> from varchar2(4000) to Long Raw.

As I have stated, LONG RAW is for BINARY data and you have character data. If you insist on storing character data in to a LONG RAW datatype, then you will have to store the character data in some sort of file (text file, MS Word doc, etc) and the insert that binary document into the column. Talk about a long way to go when LONG RAW is not meant to hold character data. And then you'd have to write a routine to pull binary data out of the LONG RAW column and represent it in the web app. It is much, much easier to use LONG or CLOB.

> Yes, Blob or Clob will be better.But web developers use
> a interface to operate database. This interface can only
> deal with long raw.

The interface "can only deal with long raw"?!?!?! That statement is going to be incorrect 99.9% of the time. Every development platform that I have worked with that supports LONG RAW also supports LONG. I am leaving open the possibility that some crazy development platform does not follow this, but I have yet to work with it. And I've worked with quite a few web development platforms that interact with an Oracle database....Java, ASP and ASP.NET, JSP, Cold Fusion, PHP, Perl/DBI, and the list goes on and on.

And unless this app is written in some archaic/old web development platform, it will also support BLOB and CLOB. In many cases, one doesn't even know the difference between 3,000 characters stored in VARCHAR2(4000) and CLOB. In many cases, the programming is the same.

HTH,
Brian

-- 
===================================================================

Brian Peasland
dba_at_nospam.peasland.net
http://www.peasland.net

Remove the "nospam." from the email address to email me.


"I can give it to you cheap, quick, and good.
Now pick two out of the three" - Unknown
Received on Thu Aug 31 2006 - 10:19:57 CDT

Original text of this message

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