Getting the contents of a LONG RAW column

Hi, I'm using Oracle 8.1.7 with JDK 1.4.0, and I've got a dilemma. I have a table that has several columns, one column is a LONG RAW, the rest are just NUMBER or VARCHAR2. I need to transer the contents of particular rows to another table with the same structure. I've got a query the gets the correct rows, and I create and use a ResultSet to getInt(), getString(), and set the parameters of a PreparedStatement. Here's my problem, when I try to do a getBytes() on the LONG RAW column, it says "Stream already closed."
I was able to get around this in the past by just doing another query where the only column I selected was the LONG RAW column. Then it would let me do the getBytes(). Unfortunately, besides being inefficient, it is not possible to have 2 queries any longer. I was reading a little about this in the documentation, but I couldn't get a very good feel for it. Is there a way I can do one query and select all the rows, and still be able to pull out that data? Is there anything I'm missing? It seems like it's harder than it should be. Any advice? Thanks!
Tobin Juday

OK, I may have spoken too soon. I still seem to have the problem. Here's a chunk of my code, am I missing something dumb? Thank you...
resultSet1 = query1.getResultSet();
insert = conn.prepareStatement("INSERT....?,?,?)");
while (resultSet1.next())
insert.setBytes(23,resultSet1.getBytes("progtxt"));
insert.setInt(1, version);
insert.executeUpdate();
}

Similar Messages

  • Restrict the LONG RAW Column with less than 32760 bytes in the SELECT

    When i am trying to access a LONG RAW Dataype wchich has characters greter than 32760 bytes i am getting this error.
    Error -6502: ORA-06502: PL/SQL: numeric or value error
    I came to know that PL/SQL will only be able to access the first 32760 bytes of a LONG RAW. If we try to fetch a LONG RAW from the database into PL/SQL variable which exceeds the 32760 byte limit then we encountered the above error.
    Can anyone tell to avoid this error can we write a query to restrict the output to get only those records which has LONG RAW length less than 32760 bytes.
    Since we canot use utl_raw.length() in the Select Statement, is there any function to restrict the the records for less than 32760 Bytes only for LONG RAW datatype, so that i will not get any records for more than 32760 bytes and we will not get this error.
    REquest you to please help.

    Hi
    we do not have an option of migrating the LONG RAW to BLOB or any kind of ALTER to the table.
    We want to restrict the use of Records from the Table which has data for LONG RAW column less than 32760 bytes, so that we will not get the PL/SQL numberic Error
    any function for LONG RAW that can be used in SQL like for varchar2 we can use
    select length(NAME) < 100 from tb_emp+
    i.e it will get records only which has NAME less than 100 characters.

  • My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

    My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

    My iTunes library is on an old PC that no longer works. I purchased a new iPod Touch.  How can I get the contents of my library to the new iPod?

  • I am trying to burn a DVD with a 50 minute video.  I repeatedly get the message that the content is too long.  What have I done wrong??

    I am trying to burn DVD with a 50 minute video.  I repeatedly get the message that the content is to long.  What am I doing wrong??

    Is this using iDVD?
    iDVD encoding settings:
    http://support.apple.com/kb/HT1502?viewlocale=en_US
    Short version:
    Best Performance is for videos of up to 60 minutes
    Best Quality is for videos of up to 120 minutes
    Professional Quality is also for up to 120 minutes but even higher quality (and takes much longer)
    That was for single-layer DVDs. Double these numbers for dual-layer DVDs.
    Professional Quality: The Professional Quality option uses advanced two-pass technology to encode your video (The first pass determines which parts of the movie can be given greater compresson without quality loss and which parts can’t.  The second pass then encodes those different parts accordingly) , resulting in the best quality of video possible on your burned DVD. You can select this option regardless of your project’s duration (up to 2 hours of video for a single-layer disc and 4 hours for a double-layer disc). Because Professional Quality encoding is time-consuming (requiring about twice as much time to encode a project as the High Quality option, for example) choose it only if you are not concerned about the time taken.
    In both cases the maximum length includes titles, transitions and effects etc. Allow about 15 minutes for these.
    You can use the amount of video in your project as a rough determination of which method to choose. If your project has an hour or less of video (for a single-layer disc), choose Best Performance. If it has between 1 and 2 hours of video (for a single-layer disc), choose High Quality. If you want the best possible encoding quality for projects that are up to 2 hours (for a single-layer disc), choose Professional Quality. This option takes about twice as long as the High Quality option, so select it only if time is not an issue for you.
    Use the Capacity meter in the Project Info window (choose Project > Project Info) to determine how many minutes of video your project contains.
    NOTE: With the Best Performance setting, you can turn background encoding off by choosing Advanced > “Encode in Background.” The checkmark is removed to show it’s no longer selected. Turning off background encoding can help performance if your system seems sluggish.
    And whilst checking these settings in iDVD Preferences, make sure that the settings for NTSC/PAL and DV/DV Widescreen are also what you want.
    http://support.apple.com/kb/HT1502?viewlocale=en_US

  • Inserting into long raw column type

    Hello,
    We tried to insert into a bmp file into the a column of type long raw and got the following error: "invalid value stored in pcbValue". There was no ORA message code assign to this error.
    Willy

    Thanks !
    JDeveloper Team (guest) wrote:
    : Hi,
    : You need to use streams to do this. In the JDBC User's Guide
    and
    : Reference, there is a whole chapter on using streams. Here is
    : some example code from the 8.1.5 JDBC User's Guide:
    : The following Java code snippet writes the data from the
    LESLIE
    : LONG RAW column into a file called
    : leslie.gif:
    : ResultSet rset = stmt.executeQuery ("select GIFDATA from
    : streamexample where
    : NAME='LESLIE'");
    : // get first row
    : if (rset.next())
    : // Get the GIF data as a stream from Oracle to the client
    : InputStream gif_data = rset.getBinaryStream (1);
    : try
    : FileOutputStream file = null;
    : file = new FileOutputStream ("leslie.gif");
    : int chunk;
    : while ((chunk = gif_data.read()) != -1)
    : file.write(chunk);
    : } catch (Exception e) {
    : String err = e.toString();
    : System.out.println(err);
    : } finally {
    : if file != null()
    : file.close();
    : In this example the contents of the GIFDATA column are
    : transferred incrementally in chunk-sized pieces between
    : the database and the client. The InputStream object returned
    by
    : the call to getBinaryStream() reads the data
    : directly from the database connection.
    : Zvonimir Vukovi (guest) wrote:
    : : Zvonimir Vukovic (guest) wrote:
    : : : Hi !
    : : : I have a problem when inserting an image (eg. GIF file)
    : into
    : : : Long Raw column. I am using JDeveloper 1.1, and I need to
    : read
    : : : images from my local hard drive and insert them into
    Oracle
    : : : DBMS. I've done a reverse thing (copying image from Long
    Raw
    : : : column to my HDD). I would be very thankful for a piece of
    : : JDBC
    : : : code which would solve my problem.
    : : : Thanks,
    : : : Zvonimir Vukovi
    : : I've forgotten to say that I need to use na Applet to do
    the
    : : job. I can read the image into AWT Image control, but I
    don't
    : : know how to get it into the Long Raw column
    : : Thanks again.
    : : Z.V.
    null

  • Problems with LONG RAW column

    We have a LONG RAW column.
    JDev mapped it to Raw and LONGVARBINARY as SQL type.
    Reading data (even huge amounts) works alright, but when we try to insert or update we get:
    Data size bigger than max size for this type
    I did some reading on the internet and found that I had to stream data into JDBC which Raw apparently cannot handle.
    So how can I solve this?
    And please, don't just write "Create a domain". I tried. It's not that easy for me. It should be a bit more specific.
    Thanks in advance!
    Sascha

    You not only have to create a Domain but also implement either BlobDomainInterface or one of it's subclassed interfaces.
    See oracle.jbo.domain.BlobDomainInterface (source in bc4jdomorcl-src.zip) for an example of how various interface methods are implemented.
    When a domain implements BlobDomainInterface, it's called during load/save Entity data to setup it's transaction context (if it needs to during load) and to save it's content into the db using the given transaction context.
    These interfaces are written with the assumption that there's an oracle.sql.* class that knows how to use transaction to fetch data using SQL-locator objects. In this case I believe you will need to extend the domain from oracle.sql.RAW class.

  • ORA-22835: buffer too small when trying to save pdf file in LONG RAW column

    Hi,
    I get "ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (real : 125695, maximum : 2000)" when i trying to save a 120k pdf file in an Oracle Long Raw column using dotnet 4.0 and Entity FrameWork.
    Dim db As New OracleEntities
    Try
    Dim myEntity = (From e In db.TEXTE _
    Where e.TEXT_ID = txtTextId.Text _
    Select e).Single
    With myEntity
    If txtTextypeId.Text <> "" Then
    .TEXTYPE_ID = txtTextypeId.Text
    Else
    .TEXTYPE_ID = Nothing
    End If
    .TEXT_NUM = txtTextNum.Text
    .TEXT_NAME = txtTextName.Text
    .TEXT_DATE = dtTextDate.SelectedDate
    If DocAdded Then
    .TEXT_DOC = Document
    ElseIf DocDeleted Then
    .TEXT_DOC = Nothing
    End If
    End With
    db.SaveChanges()
    Document is an array of Byte and TEXT_DOC also (mapped to a long row column).
    is it possible to increase the size of the buffer ? how may i do it ?
    Thx in advance.
    Regards.

    Using a custom UPDATE or INSERT stored procedure for LONG RAW column with
    exceed-limit data may still get the following error.
    "ORA-01460: unimplemented or unreasonable conversion requested".
    One option is to use BLOB instead of LONG RAW in your table and regenerate your
    data model from the table. Then using the default UPDATE or INSERT statement
    (created by EF) should work.
    The following will modify your LONG RAW column to BLOB column.
    Disclaimers:
    1. It's irreversible--you cannot modify BLOB back to LONG RAW.
    2. I have not tried that when there are huge data in LONG RAW column.
    So be careful.
    alter table <your_table_name> modify <your_long_raw_type_column> blob;

  • Long Raw Column

    Hi Everybody,
    I am using Oracle 9i ver 9.1 & Developer 6. My requirement is to store documents in the database. For that I have created a Long RAW column in the table where I have to store that. On forms I have made an OLE Container whose OLE Class property is set to "Word.Document.8". When I run the form, everyting goes fine. I insert the record, with word documents, it saves. I cleared the form & when I query it gets back the document, ie I can open it by double clicking it. But, once I exit the screen, run it again & try to query, it fetches all other columns except the OLE container value. I mean when I query it after exiting once & running the screen again, it does not fetch that OLE container base table items value, which it displays if I query it, without exiting, ie, the time when I inserted the document in OLE container, saved it & cleared the screen.
    Anyone having a work around pls, reply.
    Thanks in Advance.
    [email protected]

    Hi,
    Yes the data is getting saved. As, when i clear the screen & then query again it displays the data. At SQL promp, when i qureied the table, it displays on a single "D" as the column values for all the rows, whether I had inserted any value for that row or not. I mean it was displaying "D" in all the rows, though, I have not inserted value in all rows in the Long Raw Column.
    Rgds,
    [email protected]

  • Memory Leak with Oracle ODBC Driver for Long Raw columns

    Oracle version : 8.1.7
    Platform : Win2K
    Oracle ODBC Driver version : 8.0.1.7.5.0.0
    Hi,
    I've got an Oracle database upgraded from
    V8.0.5 to V8.1.7 which has a table having one long raw +
    normal columns. I was able to observe distinct memory
    leaks (approx 80K) when using ODBC interface calls (thro C++ code) that referenced a combination of normal & long raw columns in a select statement. However, this leak was not observed when only normal columns were present in the
    select statement. Is there any known restriction for using
    long raw columns with other columns? Or do long raw columns have a known memory leak problem thro ODBC?
    Thanks!
    Regards
    Sanchayan

    Did you ever get an answer on this issue?
    Thanks in advance

  • LONG RAW Columns and  Replication Set-up

    we are working to set-up a replicated environment for all of
    our Oracle Applications.
    I could not get a clear understanding which Version Oracle will
    support BLOB/CLOB/LONG RAW replication support or
    Whether we can plan for Replicating such kind of Applications.
    I read from one of Oracle Press book - "Oracle Backup &
    Recovery" it is documented
    that Oracle doesn't replication support for columns that use
    BLOBs,CLOBs ( Page
    no. 434 )
    As one of our application was designed using LONG RAW Column, I
    was wondering
    about carrying the existing LONG RAW column to be replicated
    like a CLOB/BLOB, if oracle supports Replication of BLOB/CLOB.
    It will be of great help, if you can provide some insight in the
    complexity of
    having BLOBs in the applications to go further on making our
    efforts to have a
    Replicated environment set-up.
    Thanking you in anticipation.
    Bhanu Prakash
    < [email protected]>

    1) LONG and LONG RAW have been depricated since 8i so you shouldn't be using them ever for anything.
    2) LONG and LONG RAW don't even have decent support to be manipulated from PL/SQL so there is essentially no SQL support.
    3) It would be very rare that you would have anything to index in a LONG or a LONG RAW from a functionality standpoint. You're not likely, for example, to want to store more than 4k of data in a LONG and then do things like search for strings that start with a particular phrase. You're very very unlikely to want to search a binary LONG RAW to look for rows where the binary data starts with a particular string of bytes. You'd potentially want to be able to use Oracle Text on a LONG field to search for particular words and phrases in the text but I'm not sure that existed prior to LONGs being depricated.
    Justin

  • URGENT - Extract Image Files From Long Raw Column

    Hi.
    I have to extract image files (tif and wmf format) from "long raw" column and put them in a directory, using a PL/SQL procedure.
    Can anyone help me.
    Thanks

    Well that is interesting, that ORA returns no records on Metalink. Anyway, that was for my own curiosity.
    As you are on 10g, this is how I would write a long raw to a file if I had no choice:
    1) create a gtt with a column of type blob
    2) insert into the gtt the long raw column using the to_lob conversion function
    3) you now have a lob!
    4) open a binary file for writing using utl_file (binary mode was introduced in 10g)
    4) use dbms_lob to read through the blob and write it in chunks to the file
    You will have to do this row by row. It will be painfully excrutiatingly slow.
    This is basically your only choice unless you have a OCI programmer to hand. In which case I would be getting them to write the C code to read the long raw column and write it to a file. This could then be compiled into a library and called as an external procedure from PL/SQL.
    HTH
    Chris

  • Updating a LONG RAW column

    I have a table with a column of type LONG RAW that can take binary content of arbitrary length (up to 2 GB). I try to copy content from one row to another using the following SQL:
    UPDATE TEAM_ADM.Content SET (Content, ContentType) =
    (SELECT Content, ContentType FROM Content WHERE ContentId = in_SourceContentID)
    WHERE ContentID = in_TargetContentID;
    Content.Content is the column in question.
    Oracle returns with error ORA-00997:
    ORA-00997 illegal use of LONG datatype
    Cause: A value of datatype LONG was used in a function or in a DISTINCT, WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be used in a SELECT clause.
    Action: Remove the LONG value from the function or clause.
    Question: How can I copy a LONG RAW column from one row to another?
    Regards,
    Kjell Tangen

    Hello,
    It seems that the Long datatypes in Oracle have a lot of restrictions. According to
    this blog:LONG and LONG RAW columns cannot be used in distributed SQL statements.
    In that case, you should update the long raw column on the Oracle side. You can try to use openquery as Rick post above to send the SQL statment to Oracle and execute.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Ctxload ( LONG RAW column export error)

    Hi,
    Does any one know why CTXLOAD utility would generates this error:
    NLS_LANG not set - using defaults.
    Connected to Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
    DRG-11513: unable to open or write to file prodpic.dat
    ORA-20000: interMedia Text error:
    DRG-10502: index ECPRODUCTS.PRODUCTS does not exist
    ORA-06512: at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.DRILOAD", line 180
    ORA-06512: at line 1
    for this ctxload line
    ctxload -user system/****** -export -name ecproducts.products -file prodpic.dat -pk 1153
    The context information is setup correctly because we are using the intermedia text
    indexing and that process is working fine. Our environment is Oracle 8.1.6 under SUN Solaris 8.
    any insight will be appriciated.
    Regards,
    Kumar

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Omar Alonso:
    You can use the export utility.<HR></BLOCKQUOTE>
    I did use export utility to export data from one database and used the import utility to load data into another database. But for some reason the application (Aiba) is not seeing the picture stored in the LONG RAW column (my presumption is that exp/imp utility can not handle LONG RAW columns). Everything else seems to load file (although I did not get any error during the import process). Is there a bug in the export/import utility that I am not aware of for exporting/importing LONG RAW columns???.
    Thanks a bunch!
    Regards,
    Kumar.
    null

  • Long Raw column in ADF Form

    Hi!
    I have a long raw column and I would like show it in a ADF Form. The column content is an image.
    Thanks

    Hi,
    you will have to stream the image using a servlet that you reference from an image object. If you Google for this then you find recent blog posts and forum entries about this
    Frank

  • In wunderlust-brown content slideshow I cannot get the content to show in IE 8

    I am using wunderlust-brown content slideshow. I cannot get the content to show in IE 8. The picture shows but no content. I narrowed down the problem to a missing CSS attribute - .WLBSlideShow .article
    If I add .article to the end of the .story attribute (.WLBSlideShow .story .article) then I get content in IE 8 but the page no longer works properly in Firefox or Chrome.
    I want to know what CSS code is supposed to be in this file for the .article attribute. It is a simple problem and I hope I can get a resolution quickly.
    Thanks.

    Thank you for the URL, this makes it a lot easier.
    Change your DOCTYPE and HTML declarations form
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    to
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    Move
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
    to just below the link to style.css, but above the links to Spry-UI-1.7

Maybe you are looking for

  • Hard Disk Installation, from other OS with Grub 2

    Hi all. I'm quite new to Arch, but not very new to Linux / Unix / BSD. Currently - on my laptop (not a very new one ... ) -  I have other distro (One of the Canonical distro's ). But I have few gigabytes left - and really want to try Arch. Now I want

  • What settings give the BEST audio quality (original audio CD to iTunes)

    Further to my last post, can ya'll PLEASE help me get the bottom of this? I have heard so many different opinions & need to resolve ASAP.... What pref' settings will give me the VERY BEST audio quality, when importing original audio CD's into iTunes

  • Does the mozilla OS support sony xperia tipo(single sim)?

    Does the mozilla OS support sony xperia Tipo(single sim) ? If yes how would i be able to install it in my mobile phone and will it function properly and smoothly ?

  • Zen vision M Video -

    Is it possible to plug your zen vision m to the tv to record off it's Is there a cable? I thought you could record off the telivision or cant you? And why doesnt the converter work well with wmp formats? It wont convert the videos i try to put on tha

  • New Desktop s/w 7.0xx bundle 044

    Well RIM did it again, I loaded the new B044 desktop software last night and I can't complete a full sync. How do I go back to the previous version?