To use LOB

hi!
Im new to oracle.Can u tell me how to use lob and how to insert a picture or file in database.
Thanx.
Prashanthan.K

Within MetaLink do an Advanced search on DocID 66046.1
This is a note that will help explain the use of LOBS and how to insert data in a table containing LOBs.
Doc ID: Note:66046.1
Subject: Oracle8i: LOBs
null

Similar Messages

  • PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables

    Dear ALL,
    My O/S is Redhatlinux 5.2 and i had Migrated my Oracle databse to 11g2. But after that while i am retrieving records through dblinks from one of my other Oracle 9.2.0.8 databse it's throwing the error : PL/SQL: ORA-22992: cannot use LOB locators selected from remote tables.* This error i am getting in TOAD as well as SQL Developer.
    Can anybody tell me how to fix this error ? Because am not able to get the records.
    Also am getting another error during retrieving data from some of my tables after migrating i.e the table which having CLOB data type while am accessing to retrieve the records using select query it's throwing the error :
    +(The following error has occurred:+
    A query with LOB's requires OCI8 mode, but OCI7 mode is used.)
    If anyone having any idea kindly share.
    Thanks and Regards
    Biswa

    Hi,
    Ya what u sent that is fine. But already am using one procudure which is accessing LOB data from another databse through DBlink and working fine. But there Both the databse are 9.2.0.8.
    But while am executing the same procedure in oracle 11g where the Dblink accessing the data from Oracle 9i , there am getting this error.
    Kindly tell if u know any resolution.
    Thanks

  • ORA_22290 error while using LOB's

    "ErrMsg: ORA-22990: LOB locators cannot span transactions, Code: -22990"
    can somebody help what this error means, and how to resolve it.
    Regards,
    Mani

    ORA-22990: LOB locators cannot span transactions
    Cause: A LOB locator selected in one transaction cannot be used in a different transaction.
    Action: Re-select the LOB locator and retry the operation.
    For future, you can view
    http://tahiti.oracle.com/pls/db102/db102.error_search?

  • Why use OPEN before using LOB ???

    For example : when I use APPEND function like this
    DECLARE
    sour_clob CLOB:='APPENDING CONTENTS';
    dest_clob CLOB;
    BEGIN
    SELECT c_lob INTO dest_clob FROM lob_tbl FOR UPDATE;
    DBMS_LOB.APPEND( dest_clob , sour_clob );
    COMMIT ;
    END;
    since LOB is not open , I can still use it to do some operations.
    Is there anything I did wrong ? I don't know why or when to use open.
    Can anyboby tell me ? I 'll appreciate that so much .

    Thanks a lot , Raghu :>
    You mean that OPEN function is used for BFILE to open files.I can understand that now.
    Now OPEN funciton overrides for CLOB BLOB , which means sometimes we have to open CLOB BLOB outside database ?

  • How to use LOB/BLOB/BFILES

    Hi,
    How to Insert and Retrive LOB / BLOB data files into Oracle tables, give me an example.
    Regards,
    Paparao

    Big topic. Big reading ahead. This document gives lots of explanations AND sample

  • ORA-22992: cannot use LOB locators selected from remote tables

    Has anyone had this error msg before?
    Thx .

    If you want, you could facilitate your process with a global temporary table as follows:
    SQL> create global temporary table clob_temp (
      2  id         number,
      3  test_clob  clob)
      4  on commit delete rows;
    Table created.
    SQL> Create or Replace procedure run_clob (p_id in number, p_file_name in varchar2)
      2    AS
      3       l_clob          clob;
      4       l_bfile         bfile := BFILENAME ('TEMP_DIR', p_file_name);
      5  begin
      6      insert into clob_temp values (p_id, empty_clob() )
      7               returning test_clob into l_clob;
      8      DBMS_LOB.OPEN(l_bfile, DBMS_LOB.LOB_READONLY);
      9      DBMS_LOB.LOADFROMFILE(l_clob, l_bfile, DBMS_LOB.getlength(l_bfile));
    10      DBMS_LOB.CLOSE(l_bfile);
    11      insert into clob_table@dlog_link (id, test_clob)
    12               select * from clob_temp;
    13      commit;
    14  end;
    15  /
    Procedure created.
    SQL> select count(*) from clob_table@dlog_link;
      COUNT(*)
             0
    SQL> exec run_clob (1, 'clobtest.txt')
    PL/SQL procedure successfully completed.
    SQL> select count(*) from clob_table@dlog_link;
      COUNT(*)
             1

  • Can I fetch LOB data directly using OCIStmtFetch2 instead of lob locator?

    Is it possible to fetch Lob data using OCIStmtFetch2 instead of fetching lob locator? I think using lob locator can increase the round-trip between client and oracle server. Is it right?

    Senthil,
    have a look at JDeveloper 10g. You can use UIX instead of JSP simply by changing the file extension from jsp to uix when creating new forms. The form bean used is oracle.adf.controller.struts.forms.BindingContainerActionForm which is a generic form.
    Frank

  • Insert a blob in remote database using dblink

    i have a view (it has a BLOB column) from where i need to select the records. After selecting i need to insert it into a synonym in the remote database through a db link.
    if i execute the procedure i get error; ora-22992--cannot use LOB locators selected from remote table. My code is
    INSERT INTO [email protected]
    SELECT PID,RNO, PTYPE,blob_field
    FROM view;
    I dont wish to creat a temporary table and still wish to perform the above function.
    So is there any method to do this. I tried with DBMS_LOB.APPEND but it didnt work out. Any solution will be greatly appreciated.
    Thanks,
    -Nitin

    i have a view (it has a BLOB column) from where i need to select the records. After selecting i need to insert it into a synonym in the remote database through a db link.
    if i execute the procedure i get error; ora-22992--cannot use LOB locators selected from remote table. My code is
    INSERT INTO [email protected]
    SELECT PID,RNO, PTYPE,blob_field
    FROM view;
    I dont wish to creat a temporary table and still wish to perform the above function.
    So is there any method to do this. I tried with DBMS_LOB.APPEND but it didnt work out. Any solution will be greatly appreciated.
    Thanks,
    -Nitin

  • How can you SELECT via Database Link CLOB data using Application Express?

    Customer Issue:
    Developer using Oracle's Application Express 3.1. The Developer is trying to SELECT a CLOB datatype column from a remote (10.2.0.3) database, via a database link on her 10.2.0.4 based client Application. The Developer wants to be able to select CLOB data from the remote database which has limitation that she can't make any changes to the remote database.
    Developer's Comments:
    I do a select and get the error. Getting error ORA-22992: cannot use LOB locators selected from remote tables. So she feels she can't use dbms_lob.substr in this configuration I can do a "select into" but that is for one value. I am trying to run a select statement for a report that brings back more than one row. I do not have permission to change anything on the remote database. I want to access the remote database and multiple tables.
    This is not something I work with, would greatly appreciate help or ideas. Is this a limitation of the 3.1; or does she just not have this set up correctly; or should she be using a Collection (if yes, please share example)
    Thanks very much,
    Pam
    Edited by: pmoutrie on Jun 4, 2009 12:01 PM
    Hello???
    Would really appreciate an answer.
    Thanks,
    Pam

    This may not be a perfect solution for you but it worked for my situation.
    I wanted to grab some data from Grid Control's MGMT$JOB_STEP_HISTORY table but I couldnt' create an Interactive Report due to the existance of a CLOB column. I cheated this by creating a view on the GC DB, grabbing the first 4000 characters and turning it into a varchar2 column:
    create view test_job_step_history as
    select job_Name, target_name, status, start_time, end_time, to_char(substr(output,1,4000)) output
    from MGMT$JOB_STEP_HISTORY where trunc(end_time) > trunc(sysdate)-90
    In an APEX Interactive Report:
    select * from test_job_step_history@GCDB
    Granted, the output looks aweful right now but I am only looking for a very particular output (failed, denied, ORA-, RMAN-, etc) so the formatting isn't the most important thing to me right now.
    If anyone can improve -- and I'm sure you can -- on this I'd love to hear about it.
    Thanks,
    Rich

  • Trying to BLOB data from a 8idb to another 9i db using db link

    Hi,
    I am trying to move a custom table in a 8i database with a BLOB column to another oracle 9i database using a database link and I am getting the following error,
    ORA-22992: cannot use LOB locators selected from remote tables.
    Any pointers as to how can this be achieved will be greatly appreciated.
    Thanks,
    arun

    http://asktom.oracle.com/pls/ask/f?p=4950:8:3652840799982677461::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:5322964030684
    http://asktom.oracle.com/pls/ask/f?p=4950:8:3652840799982677461::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:950029833940
    http://asktom.oracle.com/pls/ask/f?p=4950:8:3652840799982677461::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:52297289480186
    Message was edited by:
    Kamal Kishore

  • Insert data 32K into a column of type LONG using the oracle server side jdbc driver

    Hi,
    I need to insert data of more than 32k into a
    column of type LONG.
    I use the following code:
    String s = "larger then 32K";
    PreparedStatement pstmt = dbcon.prepareStatement(
    "INSERT INTO TEST (LO) VALUES (?)");
    pstmt.setCharacterStream(1, new StringReader(s), s.length());
    pstmt.executeUpdate();
    dbcon.commit();
    If I use the "standard" oracle thin client driver from classes_12.zip ("jdbc:oracle:thin:@kn7:1521:kn7a") every thing is working fine. But if I use the oracle server side jdbc driver ("jdbc:default:connection:") I get the exception java.sql.SQLException:
    Datasize larger then max. datasize for this type: oracle.jdbc.kprb.KprbDBStatement@50f4f46c
    even if the string s exceeds a length of 32767 bytes.
    I'm afraid it has something to do with the 32K limitation in PL/SQL but in fact we do not use any PL/SQL code in this case.
    What can we do? Using LOB's is not an option because we have client software written in 3rd party 4gl language that is unable to handle LOB's.
    Any idea would be appreciated.
    Thomas Stiegler
    null

    In rdbms 8.1.7 "relnotes" folder, there is a "Readme_JDBC.txt" file (on win nt) stating
    Known Problems/Limitations In This Release
    <entries 1 through 3 omiited for brevity >
    4. The Server-side Internal Driver has the following limitation:
    - Data access for LONG and LONG RAW types is limited to 32K of
    data.

  • Using DBMS_DATAPUMP with LONG data type

    I've got a procedure below that calls the DBMS_DATAPUMP procedure using a REMOTE_LINK to move a schema from one database to another. However, a couple of the tables within that schema have columns with the LONG data type. And when I run it I get an error saying that you cannot move data with the LONG data type using a REMOTE LINK. So no data in those particular tables gets moved over.
    Has anyone else had this issue? If so, do you have a work around? I tried adding a CLOB column to my table and setting the new CLOB to equal the LONG, but I couldn't get that to work either...even when I tried using a TO_LOB. If I could get that to, then I could just drop the LONG, move the schema, then recreate the LONG column on the opposite side.
    Here's my procedure....
    DECLARE
         /* EXPORT/IMPORT VARIABLES */
         v_dp_job_handle                    NUMBER ;          -- Data Pump job handle
         v_count                              NUMBER ;          -- Loop index
         v_percent_done                    NUMBER ;          -- Percentage of job complete
         v_job_state                         VARCHAR2(30) ;     -- To keep track of job state
         v_message                         KU$_LOGENTRY ;     -- For WIP and error messages
         v_job_status                    KU$_JOBSTATUS ;     -- The job status from get_status
         v_status                         KU$_STATUS ;     -- The status object returned by get_status
         v_logfile                         NUMBER ;
         v_date                              VARCHAR2(13) ;
         v_source_server_name          VARCHAR2(50) ;
         v_destination_server_name     VARCHAR2(50) ;
    BEGIN
         v_project := 'TEST' ;
         v_date := TO_CHAR(SYSDATE, 'MMDDYYYY_HHMI') ;
         v_source_server_name := 'TEST_DB' ;
         v_dp_job_handle := DBMS_DATAPUMP.OPEN(
              OPERATION     => 'IMPORT',
              JOB_MODE     => 'SCHEMA',
              REMOTE_LINK => v_source_server_name,
              JOB_NAME     => v_project||'_EXP_'||v_date,
              VERSION          => 'LATEST') ;
         v_logfile := DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE ;
         DBMS_DATAPUMP.ADD_FILE(
              HANDLE          => v_dp_job_handle,
              FILENAME     => v_project||'_EXP_'||v_date||'.LOG',
              DIRECTORY     => 'DATAPUMP',
              FILETYPE     => v_logfile) ;
         DBMS_DATAPUMP.METADATA_FILTER(
              HANDLE          => v_dp_job_handle,
              NAME          => 'SCHEMA_EXPR',
              VALUE          => '= '''||v_project||''' ') ;
         DBMS_DATAPUMP.START_JOB(v_dp_job_handle) ;
         v_percent_done := 0 ;
         v_job_state := 'UNDEFINED' ;
         WHILE (v_job_state != 'COMPLETED') AND (v_job_state != 'STOPPED')
         LOOP
              DBMS_DATAPUMP.GET_STATUS(
                   v_dp_job_handle,
                   DBMS_DATAPUMP.KU$_STATUS_JOB_ERROR + DBMS_DATAPUMP.KU$_STATUS_JOB_STATUS + DBMS_DATAPUMP.KU$_STATUS_WIP,
                   -1,
                   v_job_state,
                   v_status) ;
                   v_job_status := v_status.JOB_STATUS ;
              IF v_job_status.PERCENT_DONE != v_percent_done THEN
                   DBMS_OUTPUT.PUT_LINE('*** Job percent done = '||TO_CHAR(v_job_status.PERCENT_DONE)) ;
                   v_percent_done := v_job_status.PERCENT_DONE ;
              END IF ;
              IF BITAND(v_status.MASK, DBMS_DATAPUMP.KU$_STATUS_WIP) != 0 THEN
                   v_message := v_status.WIP ;
              ELSIF BITAND(v_status.mask, DBMS_DATAPUMP.KU$_STATUS_JOB_ERROR) != 0 THEN
                   v_message := v_status.ERROR ;
              ELSE
                   v_message := NULL ;
              END IF ;
              IF v_message IS NOT NULL THEN
                   v_count := v_message.FIRST ;
                   WHILE v_count IS NOT NULL
                   LOOP
                        DBMS_OUTPUT.PUT_LINE(v_message(v_count).LOGTEXT) ;
                        v_count := v_message.NEXT(v_count) ;
                   END LOOP ;
              END IF ;
         END LOOP ;
         DBMS_OUTPUT.PUT_LINE('Job has completed') ;
         DBMS_OUTPUT.PUT_LINE('Final job state = '||v_job_state) ;
         DBMS_DATAPUMP.DETACH(v_dp_job_handle) ;
    END ;

    But the application we have that uses the database cannot be changed to read from a CLOBWhy can't you change the application?
    Well, anyway you should point out to your superiors that Oracle documented years ago to not use LONGS anymore...
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3806
    It clearly states:
    LONG Datatype
    Note:
    Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility.
    Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.
    How do I go from CLOB to LONG?I'm sorry, cannot help you on that one, I don't think you can do that at all (Oracle wants us to stop using LONGS, so, it's a one-way conversion...):
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1037232794454#15512131314505
    So: NO built_in, you'll need to write a program if the clob is ALWAYS LESS THAN 32k in size, you can use plsql..but is that the case in your case? Only you know that.
    I believe that question is still unanswered on this forum, but you might try searchin for answers on this forum, and
    the 'Database-General' forum: General Database Discussions
    Perhaps you can google a Q&D workaround...
    ( And consider convincing your collegues to just convert your LONGS to LOBS)
    Edited by: hoek on Apr 8, 2009 5:43 PM

  • How to use non-Unicode mode in VB6 with ADO.

    I'm using ADO on top of OraOLEDB to connect to Oracle 9.2. The database characterset is AL32UTF8. Since my client can't handle Unicode characters, I need a character conversion. However, arcording to the OraOLEDB document( which can be obtained here http://download-west.oracle.com/docs/cd/B10501_01/win.920/a95498/using.htm#1010255):
    "How Oracle Unicode Support Works
    OraOLEDB works in two modes, Unicode mode and non-Unicode mode. When the client character set is not a superset of
    the server character set, OraOLEDB automatically enables the Unicode mode. In this mode, OraOLEDB stores the data in its cache in the UCS2 encoding scheme. The user should ensure that the database's character set is UTF8 in order to prevent any data loss.
    If the client character set is a superset of the server's, the provider operates in the non-Unicode mode. This mode provides slightly better performance as it does not have to deal with larger character buffers required by the UCS2 encoding."
    My client can only use NLS_LANG VN8VN3, which is NOT a superset of AL32UTF8, so "OraOLEDB automatically enables the Unicode mode". So if I code like this:
    Text1.Font="Some Vietnamese Font"
    Text1.Text= rs1.Fields("Name").Value
    the display is bad ('?' all over the place). This is because rs1.Fields("Name").Type is adVarWChar, so rs1.Fields("Name").Value is encoded in UCS2. What I need is to make rs1.Fields("Name").Type is adVarChar, but it seems to be impossible since Field.Type is readonly.
    When I use MS provider for Oracle, I found out that rs1.Fields("Name").Type is adVarChar, so Oracle do the conversion from/to AL32UTF8 (database character set) and VN8VN3(NLS_LANG) for me.
    Since I use LOB and things that MS does not support, I want to use OraOLEDB, so anyone can help me out? It's ugent.
    I can see that some 3rd program like SQLNavigator4.3 work well with NLS_LANG = VN3VN8 and DATABASE_CHARACTERSET=AL32UTF8 (i.e the program convert between the 2 characterset).
    Please correct me if I misunderstood anything.
    I need this ugently. Any help would be appreciated. If I don't make myself clear enough, please let me know.
    Thanks in advance.

    Thank you for your reply. I started to think that everybody is out on holidays...
    The Oracle9i Client version is 9.2.0.1.0
    Oracle Provider for OLEDB version is 9.2.0.4.0
    Oracle Net version is 9.2.0.1.0, in case you need it.
    The Oracle9i Database version is 9.2.0.1.0
    But I don't think it is a version problem, is it?

  • Copying table data accross a dblink using dbms_datapump

    Hi Friends,
    I need to copy a table data accross a dblink into another table of same structure.
    There is a requirement to use 10g dbms_datapump package to copy the data.
    The problem is that I can export into a dump file and then import it into the other database, But we do not need the dump file. We need directly exportimg and simultaneously importing into the table through dblink without generating the intermediate dump file.
    If any one have a sample code or document link, Please do help.
    cheers

    But the application we have that uses the database cannot be changed to read from a CLOBWhy can't you change the application?
    Well, anyway you should point out to your superiors that Oracle documented years ago to not use LONGS anymore...
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#sthref3806
    It clearly states:
    LONG Datatype
    Note:
    Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility.
    Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.
    How do I go from CLOB to LONG?I'm sorry, cannot help you on that one, I don't think you can do that at all (Oracle wants us to stop using LONGS, so, it's a one-way conversion...):
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1037232794454#15512131314505
    So: NO built_in, you'll need to write a program if the clob is ALWAYS LESS THAN 32k in size, you can use plsql..but is that the case in your case? Only you know that.
    I believe that question is still unanswered on this forum, but you might try searchin for answers on this forum, and
    the 'Database-General' forum: General Database Discussions
    Perhaps you can google a Q&D workaround...
    ( And consider convincing your collegues to just convert your LONGS to LOBS)
    Edited by: hoek on Apr 8, 2009 5:43 PM

  • Problem using writeToSource from ORDDoc

    Hi
    I have some problem using writeToSource
    it works it writs on the source but not at the end
    it writes at 1st starting position
    how i can handle that problem
    tanx

    Hi larry
    Thanx for cooperation
    i am using some way to use lob data but
    not pointer execption is really great problem for me
    i am giving code an exception too read an give me some suggestions
    public void append(String sid)
    throws SQLException, ServletException, IOException
    String comm1="";
    if (conn == null)
         getConnection();
         conn.setAutoCommit(false);
    stmt =(OraclePreparedStatement)conn.prepareStatement(
    "select doc from doc_table where doc_number = ? for update");
    stmt.setString(1,sid);
    if (rset.next())
    doc1 = (OrdDoc)rset.getCustomDatum(1,OrdDoc.getFactory() );
         }else
                             rset.close();
                             stmt.close();
    stmt.close();
    stmt =(OraclePreparedStatement)conn.prepareStatement(
    "select comm from doc_table where doc_number = ?");
    stmt.setString(1,sid);
    if (rset.next())
              comm1 = rset.getString(1);
    else
         rset.close();
              stmt.close();
    stmt.close();
    byte [][]ctx = new byte[1][64];
    byte[] buf = new byte[comm1.length()];
    buf = comm1.getBytes();
    BLOB doc2 = doc1.getContent();
    OracleCallableStatement open_st =
    (OracleCallableStatement) conn.prepareCall(
    "BEGIN " +          
    " DBMS_LOB.CREATETEMPORARY(doc2,TRUE,DBMS_LOB.SESSION); "+
    " DBMS_LOB.OPEN(doc2,DBMS_LOB.LOBREADWRITE);"+
    " DBMS_LOB.WRITEAPPEND(doc2,comm1.length(),comm1);" +
    " END;");
    //open_st.registerOutParameter(1,doc2);
    //open_st.registerOutParameter(2,comm1.length());
    // open_st.registerOutParameter(3,comm1);
    open_st.execute();
    close_st =(OracleCallableStatement)conn.prepareCall(
    "BEGIN DBMS_LOB.CLOSE(?); END;");
    BLOB temp = open_st.getBLOB(1);
    InputStream in = temp.getBinaryStream();
    doc1.loadDataFromInputStream(in);
    in.close();
    //close_st.setBLOB(1,temp);
    stmt = (OraclePreparedStatement)conn.prepareStatement(
    "update doc_table set doc = ? where doc_number = ? ");
    stmt.setCustomDatum(1,doc1);
    stmt.setString(2,sid);
    stmt.execute();
    rset.close();
    stmt.close();
    conn.commit();                     
    java.lang.NullPointerException
    at SQLObject.append(SQLObject.java:64)
    at demo.sample._comments._jspService(_comments.java:136)

Maybe you are looking for

  • Can't drag images into new album page

    Just started using iWeb because it seems easy to produce good looking basic pages. I may be missing something obvious, but having trawled all through this forum and iWeb help, I can't work out why the album page won't accept images dragged from the i

  • Playing local sound file

    I need to play an mp3 file in my AIR app. But I won't necessarily know the path to the file because I need to use things like the storage directory. So, would I have to do something like this to get that done: var file:File = File.applicationStorageD

  • Implementing internationalization in ADF

    hi , is there any tutoriel to implmente intenationalisation in oracle adf my jdev version 11 release 2 thanks

  • How to use SRT file with MP4

    I want to use soft subtitles with video so I still have the option to play them without subtitles if I wish. How can I enable QuickTime Player to play MP4 with soft subtitles SRT extension? I can play AVI with subtitles in QuickTime (QT doesn't have

  • Interface from 4.7 version to ECC 6.0

    Hi all,    We are having HR system in 4.7 version. We are implementing FI and Travel management in ECC 6.0 version. we need to have an interface from HR system to ECC 6.0 travel system. Which method is suitable for this?? Can we go for BAPIs?? Thanks