[ORACLE 10G] Extract Long Raw data to disc

Hi All,
I want to extract a column which contain long raw data (pdf file) into files on my disque, but i don't know how to do it in SQL or PL/SQL, any help ???

Or maybe just an alter table statement will do it for you...
SQL> create table xx (x long raw);
Table created.
SQL> desc xx;
Name                                                                   Null?    Type
X                                                                               LONG RAW
SQL> alter table xx modify (x blob);
Table altered.
SQL> desc xx;
Name                                                                   Null?    Type
X                                                                               BLOB
SQL>I've not really used LONG RAW's before but apparently (according to sources on the net) the simlple alter table statement above will do the job.

Similar Messages

  • Import/Export of LONG RAW data to/from Oracle 7.3.3

    Is it possible to export the table with LONG RAW data from one instance and then import the dump file to another instance? Does Oracle 7.3.3 support these, if yes, how can I verify the LONG RAW data is successfully imported? If possible, please also provide me with some sample codes. Thanks a lot.

    NO you do not have to run catexp7, export files are UPWARD compatable. 10G import can read a 7 export (however 7 export could NOT understand a 10g export.)

  • Issue with Oracle LONG RAW data type

    Hi All,
    I am facing some issues with Oracle LONG RAW DATA Type.
    We are using Oracle 9IR2 Database.
    I got a table having LONG RAW column and I need to transfer the same into another table having LONG RAW column.
    When I tried using INSERT INTO SELECT * command (or) CREATE TABLE as select * , it is throwing ORA-00997: illegal use of LONG datatype.
    I have gone through some docs and found we should not use LONG RAW using these operations.
    So I did some basic PLSQL block given below and I was able to insert most of the records. But records where the LONG RAW file is like 7O kb, the inserting is faliling.
    I tried to convert LONG RAW to BLOB and again for the record where the LONG RAW is big in size I am getting (ORA-06502: PL/SQL: numeric or value error) error.
    Appreciate if anyone can help me out here.
    DECLARE
    Y LONG RAW;
    BEGIN
    FOR REC IN (SELECT * FROM TRU_INT.TERRITORY WHERE TERRITORYSEQ=488480 ORDER BY TERRITORYSEQ ) LOOP
    INSERT INTO TRU_CMP.TERRITORY
    BUSINESSUNITSEQ, COMPELEMENTLIFETIMEID, COMPONENTIMAGE, DESCRIPTION, ENDPERIOD, GENERATION, NAME, STARTPERIOD, TERRITORYSEQ
    VALUES
    REC.BUSINESSUNITSEQ, REC.COMPELEMENTLIFETIMEID, REC.COMPONENTIMAGE, REC.DESCRIPTION, REC.ENDPERIOD, REC.GENERATION, REC.NAME,
    REC.STARTPERIOD, REC.TERRITORYSEQ
    END LOOP;
    END;
    /

    Maddy wrote:
    Hi All,
    I am facing some issues with Oracle LONG RAW DATA Type.
    We are using Oracle 9IR2 Database.
    I got a table having LONG RAW column and I need to transfer the same into another table having LONG RAW column.
    When I tried using INSERT INTO SELECT * command (or) CREATE TABLE as select * , it is throwing ORA-00997: illegal use of LONG datatype.
    I have gone through some docs and found we should not use LONG RAW using these operations.
    So I did some basic PLSQL block given below and I was able to insert most of the records. But records where the LONG RAW file is like 7O kb, the inserting is faliling.
    I tried to convert LONG RAW to BLOB and again for the record where the LONG RAW is big in size I am getting (ORA-06502: PL/SQL: numeric or value error) error.
    Appreciate if anyone can help me out here.
    DECLARE
    Y LONG RAW;
    BEGIN
    FOR REC IN (SELECT * FROM TRU_INT.TERRITORY WHERE TERRITORYSEQ=488480 ORDER BY TERRITORYSEQ ) LOOP
    INSERT INTO TRU_CMP.TERRITORY
    BUSINESSUNITSEQ, COMPELEMENTLIFETIMEID, COMPONENTIMAGE, DESCRIPTION, ENDPERIOD, GENERATION, NAME, STARTPERIOD, TERRITORYSEQ
    VALUES
    REC.BUSINESSUNITSEQ, REC.COMPELEMENTLIFETIMEID, REC.COMPONENTIMAGE, REC.DESCRIPTION, REC.ENDPERIOD, REC.GENERATION, REC.NAME,
    REC.STARTPERIOD, REC.TERRITORYSEQ
    END LOOP;
    END;
    /below might work
    12:06:23 SQL> help copy
    COPY
    Copies data from a query to a table in the same or another
    database. COPY supports CHAR, DATE, LONG, NUMBER and VARCHAR2.
    COPY {FROM database | TO database | FROM database TO database}
                {APPEND|CREATE|INSERT|REPLACE} destination_table
                [(column, column, column, ...)] USING query
    where database has the following syntax:
         username[/password]@connect_identifier

  • Select Long Raw data type is so slow?

    Hi
    I have a table having Long Raw data type field.It's store
    more than 2mb per record.But,I need to select others fields in this table without selecting Long Raw field.
    anyway,it's so slow for me. Any advise to me?
    thx a lot. :)

    I do not understand what you mean because if you have this table ( Example ):
    c1 number
    c2 number
    c3 long
    you can do this: select c1, c2 from <table_name>;
    Joel Pérez

  • Does oracle 8i can be able to export and import long raw data?

    Hi freinds,
    i m trying to export a user schema that includes emp_photo a long raw, it got exported with out errors (oracle 7 doesnt). when im tryuing to import it is getting failed, does it cant be imported? or this is becz of some other problems.
    thanks in advance

    Hi,
    Could you list the error messages that you are getting when you try to do an import.

  • Re:read  long raw  data in Oracle  and write to a file

    So we need an mechanism to read data from LONG RAW and convert into actual file.
    Regards

    I've branched your post off from the thread you posted on ({thread:id=620757}) as it was an old thread.
    When you have a question of your own, you should always start a new thread rather than tag onto old ones.
    Please read: {message:id=9360002} and post some relevant information so that people can help you.

  • Oracle: Expanded non LONG bind data supplied after actual LONG or LOB colum

    I am getting this error message when I try to insert clob into oracle table.
    ORA-24816: Expanded non LONG bind data supplied after actual LONG or LOB column. This error message is kind of misleading. For this error message, I should reorder the list of columns which means that the column with LONG RAW should come at end. So I reordered the list to make the LONG RAW column come at end. But I was still getting this error message. So I found out that data that needs to be inserted into the clob is causing this error.
    Here is my code for inserting clob.
                        byte[] bytes1 = .....
                        statement.setAsciiStream(index, new ByteArrayInputStream(bytes1), bytes1.length);I don't know what is wrong with this code. I have been using this for a while and now it is throwing an exception.
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)
         at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:952)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
    I am using JDK5 and Oracle 10g driver.
    Please help me.

    I have these columns,
    ROW_DESC - Char
    Table_id - Char
    Blob_desc - Char
    Blob1 - Blob
    LOB_DATE - Date
    CLOB1_DESC - Char
    CLOB1 - Clob
    CHAR_25_Col - Char
    VBIN_400_Col - Long Raw.
    But what I noticed is that the one causing the problem is not actually Long Raw column. "CLOB1" is the one causing a problem. The database is configured as unicode (AL32UTF8). When I tested it against another database with non-unicode, it works fine with same table description. So somehow it is unable to bind unicode large clob data.
    I ran into this problem while I was inserting data from the source table to the target table.
    Here is how I read from the resultset.
                        InputStream inputStream = resultSet.getAsciiStream(index + 1);
                        if (inputStream == null) {
                            return null;
                        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
                        byte[] buffer = new byte[1024];
                        int length;
                        do {
                            length = inputStream.read(buffer);
                            if (length > 0) {
                                outputStream.write(buffer, 0, length);
                        } while (length > 0);
                        byte[] resultBytes = outputStream.toByteArray();Here is how I bind parameters.
                        statement.setAsciiStream(index, new ByteArrayInputStream(resultBytes), resultBytes.length);If i use "((OraclePreparedStatement) statement).setStringForClob", then it works, but it will impact the performance, because I need to convert the clob to string.
    is there any way to do it without converting to string object?
    Thanks.

  • Extracting LONG RAW's (Off Topic)

    Hi all,
    Do you know of any function/SQL to extract a LONG RAW to a file
    from the Oracle Server 8.0.5 Linux?
    I.e. I've got records with an ID and a LONG RAW containing binary
    data. I want to export the binary data to a file on then
    server with the same name as the record ID.
    Sorry if this is a bit off-topic but no one else seems to
    know if it's even possible ...
    TIA, Ben.
    null

    Ben Cant (guest) wrote:
    : Hi all,
    : Do you know of any function/SQL to extract a LONG RAW to a file
    : from the Oracle Server 8.0.5 Linux?
    : I.e. I've got records with an ID and a LONG RAW containing
    binary
    : data. I want to export the binary data to a file on then
    : server with the same name as the record ID.
    : Sorry if this is a bit off-topic but no one else seems to
    : know if it's even possible ...
    : TIA, Ben.
    We use perl to do this and it works ok.
    Regards,
    Michael.
    null

  • Importing a file containing long raw data

    I have got a .dmp file which was exported from an oracle 8i database & contains a long raw column.Now, when i try to import this file in to oracle 9i database, the import says,
    C:\>imp
    Import: Release 9.2.0.1.0 - Production on Sat Aug 20 14:51:03 2005
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Username: sys@mydb2 as sysdba
    Password:
    Connected to: Personal Oracle9i Release 9.2.0.1.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - Production
    Import file: EXPDAT.DMP > invoice_content.dmp
    Enter insert buffer size (minimum is 8192) 30720>
    Export file created by EXPORT:V08.01.07 via conventional path
    Warning: the objects were exported by TPSYSADM, not by you
    import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
    export client uses US7ASCII character set (possible charset conversion)
    export server uses US7ASCII NCHAR character set (possible ncharset conversion)
    List contents of import file only (yes/no): no >
    Ignore create error due to object existence (yes/no): no >
    Import grants (yes/no): yes >
    Import table data (yes/no): yes >
    Import entire export file (yes/no): no >
    Username: tpsysadm
    Enter table(T) or partition(T:P) names. Null list means all tables for user
    Enter table(T) or partition(T:P) name or . if done:
    . importing TPSYSADM's objects into SYS
    Import terminated successfully without warnings.
    Now, when i query from the sys user, i dont find any object with the name invoice_contents.
    Can any 1 help me out of the above problem.
    Thanks in advance.

    The import seems OK, but it also seems that no rows have been imported, maybe no tables. What is the result of :
    SQL> select owner, table_name from dba_tables where table_name like '%INVOICE%';
    BTW, is the name invoice_content or invoice_contents ?
    If the query does not give result, then try to check the content of your dmp file
    C:\> imp user/password@db file=invoice_content.dmp full=y show=y
    Paul

  • LONG RAW Data Column

    Hi everybody,
    I have this table:
    CREATE TABLE ATTACHMENTS
        AREFITEM  NUMBER NOT NULL,
        ATTACHMENT LONG RAW ,
        CONSTRAINT ATTACHMENTS_PK PRIMARY KEY ( AREFITEM ) ENABLE
      );This sequence:
    CREATE SEQUENCE SATTACHMENTS INCREMENT BY 1 MAXVALUE 999999999999999999999999999 MINVALUE 1 CACHE 20;I have some data in the table... i will not show because it would looks awful posted in here (something like 53454C4543542..... in the ATTACHMENT column) :P
    How can i duplicate the data?
    INSERT INTO ATTACHMENTS(AREFITEM  , ATTACHMENT ) SELECT SATTACHMENTS.NEXTVAL, ATTACHMENT from ATTACHMENTS WHERE AREFITEM = 1;Gives me an error of : illegal use of LONG datatype.
    Is this even possible?
    1. I cannot unfortunately change to BLOB.
    2. Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    Corrected.
    Edited by: Vitor Rodrigues on 26/Mar/2012 14:57

    Hi,
    It seems like you've forgotten the from clause in the select statement :
    INSERT INTO ATTACHMENTS(AREFITEM  , ATTACHMENT ) SELECT SATTACHMENTS.NEXTVAL, ATTACHMENT WHERE AREFITEM = 1;

  • How to read LONG RAW data from one  table and insert into another table

    Hello EVERYBODY
    I have a table called sound with the following attributes. in the music attribute i have stored some messages in the different language like hindi, english etc. i want to concatinate all hindi messages and store in the another table with only one attribute of type LONG RAW.and this attribute is attached with the sound item.
    when i click the play button of sound item the all the messages recorded in hindi will play one by one automatically. for that i'm doing the following.
    i have written the following when button pressed trigger which will concatinate all the messages of any selected language from the sound table, and store in another table called temp.
    and then sound will be played from the temp table.
    declare
         tmp sound.music%type;
         temp1 sound.music%type;
         item_id ITEM;
    cursor c1
    is select music
    from sound
    where lang=:LIST10;
    begin
         open c1;
         loop
              fetch c1 into tmp; //THIS LINE GENERATES THE ERROR
              temp1:=temp1||tmp;
              exit when c1%notfound;
         end loop;
    CLOSE C1;
    insert into temp values(temp1);
    item_id:=Find_Item('Music');
    go_item('music');
    play_sound(item_id);
    end;
    but when i'm clicking the button it generates the following error.
    WHEN-BUTTON-PRESSED TRIGGER RAISED UNHANDLED EXCEPTION ORA-06502.
    ORA-06502: PL/SQL: numeric or value error
    SQL> desc sound;
    Name Null? Type
    SL_NO NUMBER(2)
    MUSIC LONG RAW
    LANG CHAR(10)
    IF MY PROCESS TO SOLVE THE ABOVE PROBLEM IS OK THEN PLESE TELL ME THE SOLUTION FOR THE ERROR. OTHER WISE PLEASE SUGGEST ME,IF ANY OTHER WAY IS THERE TO SOLVE THE ABOVE PROBLEM.
    THANKS IN ADVANCE.
    D. Prasad

    You can achieve this in many different ways, one is
    1. Create another VO based on the EO which is based on the dest table.
    2. At save, copy the contents of the source VO into the dest VO (see copy routine in dev guide).
    3. commiting the transaction will push the data into the dest table on which the dest VO is based.
    I understand that if we attach VO object instance to region/page, we only can pull and put data in to only one table.
    if by table you mean a DB table, then no, you can have a VO based on multiple EOs which will do DMLs accordingly.Thanks
    Tapash

  • Accessing LONG RAW data information

    Hi,
    Can anybody help me in knowing the information stored into a LONG RAW column. I would appreciate it in either SQL / PL SQL.
    Thanks in advance.
    Anil.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Anil Budhkar ([email protected]):
    Hi,
    Can anybody help me in knowing the information stored into a LONG RAW column. I would appreciate it in either SQL / PL SQL.
    Thanks in advance.
    Anil.<HR></BLOCKQUOTE>
    well you have DBMS_LOB functions. Tou can visit the website for documentation and try using them. But what type of data is it.
    null

  • Slow performance with long raw data

    Hi all,
    we are running a 8i on linux (suse 6.2). everything is fine, but
    when we try to select data from a table with two number and one
    long raw fields the performance is real low.
    data were exported from a 7.0.3 server running on a solaris box.
    the new server is much more performant then the sun box, only
    this one table doesnt work correct.
    Any ideas what i did wrong? more details could be supplied if
    needed.
    Li
    null

    Caitanya wrote:
    Blushadow,
    I thought this is how a Cursor loop works:
    ..cut..
    you need not fetch it again inside the loop? you fetch it once and the loop takes care of implicitly fetching one record at a time in the cursor.
    Please correct me if I am wrong.Yes, typically a cursor loop starts the loop, then fetches and then tests for exit condition before processing.
    The style the OP is using comes from the old BASIC style where we had REPEAT..UNTIL loops. The condition for these loops, due to their syntax, was specified on the UNTIL part e.g.
    REPEAT
      .. code ..
    UNTIL <condition>;This meant that the code would always be executed once and therefore, to prevent the code executing unecessarily you would have to code something like... (excuse my pseudo code)
    IF <condition> = TRUE THEN
      REPEAT
        .. code ..
      UNTIL <condition>
    END IF;So, in terms of what the OP is doing, they are fetching the first row outside the loop, using the condional check as the first thing inside the loop to prevent execution of the code if it's unnecessary, and then at the end of the loop fetching the next row before looping back around to the conditional check. Typically, you wouldn't do it that way, but it's fine and does work.

  • Sending Long Raw Data to Oracle database through Stored  Procedure

    Hi,
    I am trying to push data to Oracle 9i database through Stored Procedure via thin driver. It is going smoothly upto 29411 bytes. But it is not accepting for 53843 bytes and giving following error :
    java.sql.SQLException: Data size bigger than max size for this type: 53843
    Is it thin driver limitation? Can I solve it by using OCI driver? Or is there any other approach?
    I tried creating connection pool in weblogic 7.0 through OCI driver. But I am not able to configure it. Is there any special way of configuration.
    Quick response will be greatly appreciated.
    Thanks
    Sanjiv

    It happens to me. But I am using CMP of Weblogic 7. If you write your own jdbc code, the following link may be helpful.
    http://otn.oracle.com/sample_code/tech/java/codesnippet/xmldb/HowToLoadLargeXML.html

  • Oracle 10g XE and CLOB data type

    I am using Oracle 10.2.0.1.0 Express Edition and I wish to store large amounts of data in a CLOB column. I have created my table using a "standard" SQL statement similar to the following:
    CREATE TABLE LotsofData(
    id INT NOT NULL,
    data CLOB);
    The table is created successfully, so far so good.
    And I used a "standard" insert SQL statement to insert large amount of data into the before mentioned table, similar to the follwing:
    INSERT INTO LotsofData VALUES('4043', 'The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog <insert more iterations>');
    The data being inserted takes up 4043 bytes. Now when attempting, using among other programs the handy web interface, to execute the insert statement I get this error:
    Error starting at line 1 in command:
    INSERT INTO LotsofData VALUES('4043', 'The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog <insert more iterations>');
    Error at Command Line:1 Column:38
    Error report:
    SQL Error: ORA-01704: string literal too long
    Now if I reduce the size of the data to be inserted to 4000 bytes or below there is no problem. I have performed searches on google groups, google search engine, the oracle site, this forum but not found a way to solve it... I have found documentation stating that there is support for 4gb of user data, but well that doesn't really help.
    I have been on the trail of TABLESPACE and working with that, but with no luck. The data type BFILE will not work as I need to be able to change the data after it has been inserted into the table.
    Is the 4000 bytes a limitation in the Express Edition and I should just forget it, or is there a way I configure the database to accept large amounts of data. Should I be creating the table using a different SQL statement?
    kind regards
    Chris Nilsson

    Right... I found out how you can solve this, well not through the web interface... but oh well it is possible though...
    the error I was getting was: ORA-01704:     string literal too long.
    the keyword/phrase is "bind variables"... Did a little more searching and found this site:
    http://www.akadia.com/services/ora_bind_variables.html
    So basically you use bind variables to insert data which fills more than 4000 bytes...
    Since the data I will be inserting will be inserted via Java/.NET application I found the section called "Bind Variables in VB, Java and other applications" the most interesting... During my testing and I had neglected to use PreparedStatements in Java, and according to the site, using PreparedStatement provided an easier solution as the API does most of the work for you. My solution was to create a small program which read the large amounts of data from a file then feed this to a PreparedStatement, setObject or setASCIIStream/setCharacterStream, then execute it.
    Well I hope this helps other people who get the same error code.

Maybe you are looking for

  • Toshiba Regza 47" LCD via VGA adapter

    I'm plug the Mac into the TV via the PC VGA connection. I can see the video picture while the computer turns on but after it's on I get unsupported video signal on the screen. Any suggestins?

  • IMovie insertion of music won't play audio

    I am trying to insert music into my imovie project and I can't hear the audio. All the other tracts that I inserted are playing fine but not this one. Any other songs I try to insert won't pay either? I checked to see if things were muted but it does

  • How to buy imac 27 inch and ship it to iraq ?

    hi im ali jalal from iraq and i want to buy imac 27 inch from apple online store and ship it to iraq is there any way to do that ? cuz i cant see my country in the list thanks

  • Migrate of SCCM Console connection

    Hey, I installed a second MP and additional SMS_Provider to one of my SiteServer to be able to connect via SCCM AdminConsole to it. Unfortunately it is not working :P What I already checked is the existence of WMI keys Root\SMS\site_<site code> with

  • Thumbnails are not centering

    I'm a newbie to dreamweaver and I'm trying to create an auto-advancing portfolio gallery with thumbnails. I've got everything to work and can dupicate the gallery on another portfolio page simply by changing the links in the html. www.rodrice.net (5