BLOB Columns Inserts/Updates ???

Please let me know how SQL*Loader can run updates to just the blob columns without truncation/replace. We want to do incremental updates to the BLOB column without truncation/replace. If this is not possible please let me know any other process which can do this with the best performance we have huge amount of data that needs to be processed. Please let me know .......
e-mail from the developer.
Is there something that we or the DBA’s can do to improve performance on these types of inserts/updates with blobs? Currently we are executing batches of inserts/update to the 5 IMAGE_* tables and those are triggering inserts into the IMAGE*_HISTORY tables                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Handle:      user01
Status Level:      Newbie
Registered:      Jun 10, 2004
Total Posts:      252
Total Questions:      28 (24 unresolved)
so many questions & so few answers.
EXTERNAL TABLE is available option
How fast it is depends upon the SQL & design implementation

Similar Messages

  • JDBC를 이용해서 BLOB COLUMN 에 파일 INSERT하는 SAMPLE

    제품 : JAVA
    작성날짜 : 2003-01-15
    JDBC를 이용해서 BLOB COLUMN 에 파일 INSERT하는 SAMPLE
    ====================================================
    Purpose
    JDBC를 이용해서 BLOB COLUMN 에 파일 INSERT하는 방법을
    알아 봅니다.
    Explanation
    - 다음 sample은 Oracle DB v8.1.7에서 JDBC(V8.1.7)을
    이용해서 TEST한 것입니다.
    Example
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    //needed for new CLOB and BLOB classes
    import oracle.sql.*;
    public class Insert_File_BLOB
    public static void main (String args [])
    throws Exception
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn =
    DriverManager.getConnection ("jdbc:oracle:oci8:@krint-7", "scott", "tiger");
    conn.setAutoCommit (false);
    Statement stmt = conn.createStatement ();
    // Drop the basic_lob_table
    try
    stmt.execute ("drop table basic_lob_table");
    catch (SQLException e)
    // An exception could be raised here if the table did not exist already
    // but we gleefully ignore it
    // Create a table containing a BLOB and a CLOB
    stmt.execute ("create table basic_lob_table (x varchar2 (30), b blob, c clob)");
    // Populate the table
    stmt.execute ("insert into basic_lob_table values ('one',empty_blob(), 'clob column data !!!')");
    // Select the lobs
    OracleResultSet rset = (OracleResultSet)stmt.executeQuery("select b from basic_lob_table where x='one' for update");
    while (rset.next ())
    // Get the lobs
    BLOB blob = ((OracleResultSet)rset).getBLOB (1);
              try
    File file = new File("c:\\temp\\bokim.txt");
    long fileLength = (long) file.length();
    System.out.println("File Size : " + fileLength + " bytes");
    FileInputStream instream = new FileInputStream(file);
    OutputStream outstream = blob.getBinaryOutputStream();
    int size = blob.getBufferSize();
    System.out.println("BufferSize: " + size + " bytes (#)\n");
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    System.out.print("#");
    System.out.println();
    instream.close();
    outstream.close();
    System.out.println("\nUpdate Done.");
    catch (java.io.FileNotFoundException fe) {
    System.err.println ("thrown: java.io.FileNotFoundException\n");
    fe.printStackTrace ();
    System.err.println (fe.getMessage ());
    stmt.close();
    conn.commit();
    conn.close();
    결과
    SQL> select dbms_lob.getlength(b) from basic_lob_table;
    no rows selected
    SQL> /
    DBMS_LOB.GETLENGTH(B)
    4328
    Reference Documment
    ---------------------

  • BLOB column not updating using automated row processing

    I have fiddled around with creating a simple application to understand how APEX handles images stored in blobs - did a simple app that stores them, gets them, displays them. it all works great.
    so i have this existing table/application that i am trying to add a BLOB column to here's what i did:
    it's a pretty simple form on a table with report application. just one table.
    I added the BLOB to the table (and the other mimetype etc cols as well).
    i added the page items to the form page.
    i basically made everything identical in terms of page item settings and such to the working simple application.
    so here's the problem... when i run the application and update a row, the BLOB column isn't updating. neither are the mimetype or filename columns. the activity date col is.
    and here's another interesting thing. i quickly created another form and report pair on the same table, and when i ran it, it updates the blob col just fine.
    why is my original form not updating it? what can i do to remedy this? any ideas? i've gone though setting by setting for the blob page item and the one that works is identical to the one that doesn't.
    i'm using the automatic row processing to update the table.
    Edited by: moo on Jun 23, 2011 5:33 AM

    Gary,
    The DML processes (and the creation wizards for them) are for use with items having source type Database Column. If your page items don't use this source type, then neither the Automated Row Fetch nor the Automatic Row Processesing (DML) process types will work.
    Scott

  • BLOB column not updating

    i have two blob columns in my table say b1 and b2, that are used to store the images. the problem is, when i updates B1 column it works but as i try to update the B2 column only it the error 'ORA-100505 Oracle unable to update record' appears.
    but if i updates both the columns then it accepts the value in B2 as well.
    i am working with orcle 8i 6.1. i had faced this proble earlier agaisnt oracle 8, but as shifted to 8i the problem was solved, but it appeared again.
    the other strange problem is,if the coloumn is blank and i call this any coloumn in report the rports aborts displaying message 'unable to read the image format', how ever it was working very much fine earlier. I tried to recreate the column but no success, i also used EMPTY_BLOB() to initialize the coloum but of no avail.
    Any body could help please?
    thanks in advance

    i have two blob columns in my table say b1 and b2, that are used to store the images. the problem is, when i updates B1 column it works but as i try to update the B2 column only it the error 'ORA-100505 Oracle unable to update record' appears.
    but if i updates both the columns then it accepts the value in B2 as well.
    i am working with orcle 8i 6.1. i had faced this proble earlier agaisnt oracle 8, but as shifted to 8i the problem was solved, but it appeared again.
    the other strange problem is,if the coloumn is blank and i call this any coloumn in report the rports aborts displaying message 'unable to read the image format', how ever it was working very much fine earlier. I tried to recreate the column but no success, i also used EMPTY_BLOB() to initialize the coloum but of no avail.
    Any body could help please?
    thanks in advance

  • BLOB column inserts are slow

    Hi All,
    Have a table with 7 columns where 4 columns are of Varchar2 type, 2 columns are of NUMBER type and 1 column is of type BLOB.
    Myself inserting the values to the table from JAVA program. Insertion to VARCHAR2 and NUMBER type columns are very much fast. But insertion to BLOB column is dead slow(data to BLOB column values are about 10KB).
    Please help me in this regard to insert BLOB values fastly.
    Regards/Sreekeshava S

    Sreekeshava S wrote:
    Running JAVA program in the same server as that of DB. Connecting how? IPC? TCP? Dedicated server? Shared server?
    Calling Oracle how? Doing a SQL statement prepare per insert? Reusing the SQL cursor handle? Binding variables?
    And inserting 250 records/ sec(during peak load and 50 records/sec during normal load). where each record is having size of 10K(Blob column size).And what is slow? You have NOT yet provided ANY evidence that points to the actual INSERT being slow.
    As I have already explained, there are a number of layers from client to server - and any, or all of these, could be contributing to the problem.
    Use your web browser and look up what instrumentation is. Apply it. Instrument your code. On the client. On the server. So you have evidence (call stats and metrics) to use to determine what and where the performance problem is. And not have to guess - and like most developers point your finger at the database in the false belief that your client code, client design, and client usage of the database, are all perfect.

  • Inserting Hashtable into a BLOB column..

    Hi,
    Iam trying to store a hashtable object into a BLOB column..when i try to retrieve
    from hte blob column i get the following exception
    StreamCorruptedException:out of range is 0

    I could insert into database successfully,while retrieving I got this exception.
    I could able to insert and retrieve anyother java objects except Hashtable and
    HashMap...
    also I tried putting Hasttable into a Vector..that also didn'
    t work.
    thanks in advance.
    Muthu
    public void conn(){
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
              try {
                   ctx = new InitialContext(ht);
                   javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("WorkFlowDataSource");
                   java.sql.Connection connection = ds.getConnection();
              connection.setAutoCommit(false);
              Statement statement = connection.createStatement();
              rs = statement.executeQuery("select blob_data from test for update");
              while (rs.next()) {
                        myRegularBlob = rs.getBlob("blob_data");
              OutputStream os = ((weblogic.jdbc.common.OracleBlob)myRegularBlob).getBinaryOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(os);
              Hashtable hash = new Hashtable();
              hash.put("1","111111111hgfdhgkdkvalue");
              oos.writeObject(hash);
              oos.flush();
              connection.commit();
              System.out.println("Object inserted into persistence..");
              rs.close();
              statement.close();
              } catch(Exception ex){
                   ex.printStackTrace();
              retrieve();
              public void retrieve(){
              try {
                        ctx = new InitialContext(ht);
                        javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("WorkFlowDataSource");
                        java.sql.Connection connection = ds.getConnection();
                        Statement statement = connection.createStatement();
                        rs = statement.executeQuery("select blob_data from test ");
              while (rs.next()) {
              myRegularBlob = rs.getBlob("blob_data");
              ObjectInputStream oos1 = new ObjectInputStream(os1);
              Hashtable sections = (Hashtable)oos1.readObject();
              System.out.println("Obj retrieved..\n"+sections);
              statement.close();
              rs.close();
              connection.close();
         } catch(Exception ex){
              ex.printStackTrace();
    "Slava Imeshev" <[email protected]> wrote:
    Muthu,
    could you show us how you write/read the hashtable?
    Regards,
    Slava Imeshev
    "Muthu" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    Iam trying to store a hashtable object into a BLOB column..when i tryto
    retrieve
    from hte blob column i get the following exception
    StreamCorruptedException:out of range is 0

  • Insert Blob column in the client errors ClassCastException: oracle.sql.BLOB

    Hi,
    When I try to insert and commit a Blob column(picture) I am getting the following exception.
    Is there any jar I need to add or any other setup I need to do to accept the BLOB column in the olite client database.
    500 Internal Server Error
    javax.faces.FacesException: #{backing_XXPBWorkOrderResultsCreatePGBean.saveButton_action}: javax.faces.el.EvaluationException: java.lang.ClassCastException: oracle.sql.BLOB
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)
         at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
    Caused by: java.lang.ClassCastException: oracle.sql.BLOB
         at oracle.lite.poljdbc.LiteEmbPreparedStmt.setVal(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.poljdbc.POLJDBCPreparedStatement.setObject(Unknown Source)
         at oracle.lite.web.JupPreparedStatement.setObject(Unknown Source)
         at oracle.jbo.server.BaseSQLBuilderImpl.bindUpdateStatement(BaseSQLBuilderImpl.java:1765)
         at oracle.jbo.server.EntityImpl.bindDMLStatement(EntityImpl.java:7345)
    With regareds,
    Kali.
    OSSI.

    Here are examples if inserting into a Blob from text, file, and retrieving a blob.
    Insert into a Blob (Text)
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class InsertBlob {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            String letterText = "some letter text";
            long id = 100;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, EMPTY_BLOB())");
                stmt.setLong(1, id);
                stmt.executeUpdate();
                stmt = con.prepareStatement("SELECT BLOB_DATA FROM BLOB_TABLE WHERE BLOB_ID = ? FOR UPDATE");
                stmt.setLong(1, id);
                rs = stmt.executeQuery();
                if (rs.next()) {
                    try {
                        oracle.lite.poljdbc.BLOB oliteBlob = null;
                        oliteBlob = ((oracle.lite.poljdbc.OracleResultSet) rs).getBLOB(1);
                        byte[] byteLetterText = letterText.getBytes();
                        oliteBlob.putBytes(1, byteLetterText);
                        con.commit();
                    } catch (ClassCastException e) {
                        e.printStackTrace();
                    } finally {
                        rs = null;
                        stmt = null;
                        con.rollback();
                        con = null;
            } catch (SQLException e) {
                e.printStackTrace();
    }Insert Into a Blob (File)
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    public class InsertBlobFile {
        public static void main(String[] args) throws FileNotFoundException {
            Connection con = null;
            PreparedStatement stmt = null;
            long id = 200;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("INSERT INTO BLOB_TABLE (BLOB_ID, BLOB_DATA) VALUES (?, ?)");
                stmt.setLong(1, id);
                File fBlob = new File ( "C:\\BLOB_TEST_FILE.TXT" );
                FileInputStream is = new FileInputStream ( fBlob );
                stmt.setBinaryStream (2, is, (int) fBlob.length() );
                stmt.executeUpdate();
                con.commit();
            } catch (SQLException e) {
                e.printStackTrace();
    }Retrieve from Blob (Write to file)
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    public class RetrieveBlob {
        final static int bBufLen = 32 * 1024;
        final static String outFile = "C:\\BLOB_OUTPUT_FILE.TXT";
        public static void main(String[] args) throws IOException {
            Connection con = null;
            PreparedStatement stmt = null;
            ResultSet rs = null;
            try {
                DriverManager.registerDriver((Driver)(Class.forName("oracle.lite.poljdbc.POLJDBCDriver").newInstance()));
                try {
                    con = DriverManager.getConnection("jdbc:polite:polite", "system", "manager");
                } catch (SQLException sqle) {
                    sqle.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            try {
                stmt = con.prepareStatement("SELECT * FROM BLOB_TABLE");
                rs = stmt.executeQuery();
                while(rs.next()) {
                    int id = rs.getInt(1);
                    Blob value = rs.getBlob(2);
                    System.out.println(id + " | " + value);
                    writeBlobToFile(value);
            } catch (SQLException e) {
                e.printStackTrace();
        public static long readFromBlob(Blob blob, OutputStream out)
          throws SQLException, IOException {
            InputStream in = blob.getBinaryStream();
            int length = -1;
            long read = 0;
            byte[] buf = new byte[bBufLen];
            while ((length = in.read(buf)) > 0) {
                out.write(buf, 0, length);
                read += length;
            in.close();
            return read;
        public static long writeBlobToFile(Blob blob)
          throws IOException, SQLException {
            long wrote = 0;
            OutputStream fwriter = new FileOutputStream(outFile);
            wrote = readFromBlob(blob, fwriter);
            fwriter.close();
            return wrote;
    }

  • Insert Image to BLOB column

    Hi,
    How can i insert a image/largefile into table (having BLOB column) from sql plus?
    Thanks

    Hi!
    Do this with PL/SQL.
    CREATE TABLE image_tbl
      filename VARCHAR2(4000),
      image   BLOB
    DECLARE
          v_blob       BLOB;
          v_srcfile    BFILE;
    BEGIN
          DBMS_LOB.CreateTemporary(v_blob, TRUE);
          DBMS_LOB.Open(v_blob, dbms_lob.Lob_ReadWrite);
          v_srcfile := Bfilename('IMAGE_DIR', 'image.gif');
          DBMS_LOB.FileOpen (v_srcfile, dbms_lob.File_ReadOnly);
          DBMS_LOB.LoadFromFile(v_blob, v_srcfile, DBMS_LOB.GetLength(v_srcfile));
          INSERT INTO image_tbl (filename, image)
          VALUES ('image.gif', EMPTY_BLOB());
          UPDATE image_tbl
          SET image = v_blob
          WHERE filename LIKE 'image.gif';
          DBMS_LOB.FileClose(v_srcfile);
          COMMIT;
    END;I hope that one will help you.
    yours sincerely
    Florian W.

  • Update blob column

    dear all
    I am new to oracle database...
    and i create one BLOB column to insert the images..
    i can insert and retrieve the image data...
    but i cant update this column...
    can any one guide me to do this.
    i tried to empty the column and update but still fails..
    update tablename set columnname=empty_blob()
    i tried the above and its clear the data ...but again i cant update this ...
    i am using oracle 10g express edition.
    any suggestion
    thank you

    i tried to empty the column and update but still fails..How does it fail? Please describe the behaviour in more detail, including any error messages and related information.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Error when inserting  file 4KB in a BLOB column.

    Hello,
    I am getting the following error when I am trying to insert a file > 4KB in a
    BLOB column.
    ORA-01461: can bind a LONG value only for insert into a LONG column.
    We are using Weblogic5.1.0 sp10, Oracle 8.0.5 with WL OCI driver.
    There is no change even after setting the following property weblogic.oci.min_bind_size=660
    Please can anyone help?
    Thanks.

    Hello,
    I tried using the following sql stmts to override the NLS_LANG setting on both
    server and client for a session.
    ALTER SESSION SET NLS_LANGUAGE = AMERICAN;
    ALTER SESSION SET NLS_TERRITORY = AMERICA;
    It still gave the same error.
    I tried the same using Oracle thin driver.Even then the same problem.
    As I mentioned earlier, we are using oracle 8.0.5.
    and here is the code I am using for writing BLOB data
    java.sql.PreparedStatement prepstmt = conn.prepareStatement("Update TEST_BLOB
    set BLOBATTACH = ? where IDX =1");
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    ObjectOutputStream p = new ObjectOutputStream(ostream);
    p.writeObject(data);
    prepstmt.setBinaryStream(1, new ByteArrayInputStream(ostream.toByteArray()), ostream.size());
    prepstmt.executeUpdate();
    prepstmt.close();
    Any suggestions ?
    Thanks.
    "Slava Imeshev" <[email protected]> wrote:
    Latha,
    You need to make sure you have the same NLS_LANG setting both for the
    client
    and the server.
    Regards,
    Slava Imeshev
    "Latha Pusapaty" <[email protected]> wrote in message
    news:[email protected]...
    I Tried that. But still getting the same exception.
    java.sql.SQLException: ORA-01461: can bind a LONG value only for insertinto a
    LONG column
    at weblogic.db.oci.OciCursor.getCDAException(OciCursor.java:230)
    at weblogic.jdbcbase.oci.Statement.executeUpdate(Statement.java:980)
    atweblogic.jdbc20.pool.PreparedStatement.executeUpdate(PreparedStatement.java:
    47)
    atweblogic.jdbc20.rmi.internal.PreparedStatementImpl.executeUpdate(PreparedSta
    tementImpl.java:54)
    atweblogic.jdbc20.rmi.SerialPreparedStatement.executeUpdate(SerialPreparedStat
    ement.java:55)
    at fictx.TRServlet.doPost(TRServlet.java, Compiled Code)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, CompiledCode)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java, CompiledCode)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    Compiled Code)
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java,
    Compiled Code)
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java,
    Compiled Code)
    atweblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java,
    Compiled Code)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java,Compiled
    Code)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,Compiled
    Code)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
    Same code is working fine for files less than 4000 bytes.
    Oracle table has only one BLOB column.
    I have set weblogic.oci.selectBlobChunkSize=1200 .
    Where could be the problem?
    Andreas Bittorf <[email protected]> wrote:
    We resolved the problem as following:
    ps = con.prepareStatement
    ("update tq_businessmodel set
    businessmodel=?,lastupdate=?
    "WHERE taskid=?");
    ByteArrayOutputStream ostream = new ByteArrayOutputStream();
    ObjectOutputStream p = new ObjectOutputStream(ostream);
    p.writeObject(businessModel);
    ps.setBinaryStream(1, newByteArrayInputStream(ostream.toByteArray()),
    ostream.size());
    ps.setTimestamp(2,new Timestamp(System.currentTimeMillis()));
    ps.setLong(3,taskid);
    ps.executeUpdate();

  • Problem at update blob columns.

    Hi,i have a table like this.
    create table customer
    (id number,
    photo blob,
    sign blob,
    pass_view blob);
    I have a form based to this table (at 9i) which has 3 image item.
    By using webutil i read image files to this items and after commit i stored them to database.There is no problem up to this time,inserting data to database seems correct.
    Now i want to update an imge from database and I open form again and execute query.All 3 images was seen.I changed 3rd pass_view image again by reading another image file from file system.After commit and execute_query again i understood that photo column is now having new pass_view image and pass_view column is null.
    In trying different loading to different images,i have problems again.
    Only if i read 3 images from 3 files to image items again,i have no problem in updating.
    Is there a problem in having 3 blob columns in a table?

    I have the problem even with 2 images (2 BLOB fields in table).
    Forms application updates the first image if you replace only the second image. If you replace both images everything is correct.
    Honestly speaking I have this problem with 9.0.2 version and probably in couple weeks I'll test it on 9.0.4.
    Thanks
    Vitaliy

  • Insert/update japanese langunage data in a column of datatype varchar2(..)

    Hello,
    I am using ORACLE DATABASE 11g (EE) and RHEL 5.
    I want to insert/update japanese language data in a column which has the datatype as varchar2(256).
    I tried to change the NLS_LANGUAGE and NLS_TERRITORY parameters with 'ALTER SESSION set ...' command but no effect.
    I tried to bounce back ( shutdown and startup ) the DB but still no effect.
    I tried to inset the NLS_LANGUAGE and NLS_TERRITORY in init.ora file but still no use.
    If anybody knows the detail steps which i have mentioned above .... let me know. Might be that i am wrong in my method.
    Can you please guide me how to change the language of DB for a perticular session to japanese ???
    Thanks in advance...
    Edited by: VJ4 on May 9, 2011 6:21 PM

    VJ4 wrote:
    Thanks for the info.
    Yes i tried with UNISTR function and was able to insert the data successfully.
    but the point is that we can't remember unicode for each of the letter. It's their any method that we can directly insert japanese character using an insert.
    As you said :-
    Note that changing database character set is something complicated that requires many steps.
    Can you please provide me some links or some stuffs to study about the detail steps of chaining database character set.
    I have gone through the Oracle online documentation.. if you can pin point any good link in it you can else provide me some other stuff.
    Thanks .You will need to convert your database characterset to AL32UTF8. This is not a trivial exercise if your database already has data in it. See these MOS Docs
    Changing the NLS_CHARACTERSET to AL32UTF8 / UTF8 (Unicode)          (Doc ID 260192.1)
    AL32UTF8 / UTF8 (Unicode) Database Character Set Implications          (Doc ID 788156.1)
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10729/ch11charsetmig.htm#g1011430
    HTH
    Srini

  • How to insert a pdf or jpeg image into a blob column of a table

    How to insert a pdf or jpeg image into a blob column of a table

    Hi,
    Try This
    Loading an image into a BLOB column and displaying it via OAS
    The steps are as follows:
    Step 1.
    Create a table to store the blobs:
    create table blobs
    ( id varchar2(255),
    blob_col blob
    Step 2.
    Create a logical directory in the database to the physical file system:
    create or replace directory MY_FILES as 'c:\images';
    Step 3.
    Create a procedure to load the blobs from the file system using the logical
    directory. The gif "aria.gif" must exist in c:\images.
    create or replace procedure insert_img as
    f_lob bfile;
    b_lob blob;
    begin
    insert into blobs values ( 'MyGif', empty_blob() )
    return blob_col into b_lob;
    f_lob := bfilename( 'MY_FILES', 'aria.gif' );
    dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
    dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    Step 4.
    Create a procedure that is called via Oracle Application Server to display the
    image.
    create or replace procedure get_img as
    vblob blob;
    buffer raw(32000);
    buffer_size integer := 32000;
    offset integer := 1;
    length number;
    begin
    owa_util.mime_header('image/gif');
    select blob_col into vblob from blobs where id = 'MyGif';
    length := dbms_lob.getlength(vblob);
    while offset < length loop
    dbms_lob.read(vblob, buffer_size, offset, buffer);
    htp.prn(utl_raw.cast_to_varchar2(buffer));
    offset := offset + buffer_size;
    end loop;
    exception
    when others then
    htp.p(sqlerrm);
    end;
    Step 5.
    Use the PL/SQL cartridge to call the get_img procedure
    OR
    Create that procedure as a function and invoke it within your PL/SQL code to
    place the images appropriately on your HTML page via the PL/SQL toolkit.
    from a html form
    1. Create an HTML form where the image field will be <input type="file">. You also
    need the file MIME type .
    2. Create a procedure receiving the form parameters. The file field will be a Varchar2
    parameter, because you receive the image path not the image itself.
    3. Insert the image file into table using "Create directory NAME as IMAGE_PATH" and
    then use "Insert into TABLE (consecutive, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval,
    EMPTY_BLOB(), 'GIF' or 'JPEG') returning BLOB_OBJECT, consecutive into variable_blob,
    variable_consecutive.
    4. Load the file into table using:
    dbms_lob.loadfromfile(variable_blob, variable_file_name, dbms_lob.getlength(variable_file_name));
    dbms_lob.fileclose(variable_file_name);
    commit.
    Regards,
    Simma........

  • Sample insert into table with BLOB column

    This is my first opportunity to work with BLOB columns. I was wondering if anyone had some sample code that shows the loading of a blob column and inserted into the table with a blob column.
    I have to produce a report (including crlf) and place it into a blob column. The user will download the report at a later time.
    Any suggestions / code samples are greatly appreciated!!!!

    You can enable string binding in TopLink.
    login.useStringBinding(int size);
    or you could enable binding in general,
    login.bindAllParameters();

  • ORA-00600 error when inserting NULL in BLOB column

    Hi,
    I want to insert NULL value into a BLOB column w/o using empty_blob(), but I am getting the following error upon submission (both through program and upon directly executing it from TOAD/SQL*):
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kxtotolc_lobopt], [], [], [], [], [], [], []
    The query is as follows:
    insert into image_rendering r
    (r.Version_date_time, r.id, r.Name, r.Type, r.Image_url, r.Image_filesize, r.Html, r.Original_Text, r.Redirect_url, r.Version, r.Rendering_size) values
    (sysdate, '1963884', '468x60_1.gif', '0', '225/9-468x60_1.gif', '1471', null, null, null, '1', '30670908')
    In the table r.Html, r.Original_Text are blob and clob columns respectively.
    If I remove the column r.Html (blob) and its corresponding value the following query executes fine :
    insert into image_rendering r
    (r.Version_date_time, r.id, r.Name, r.Type, r.Image_url, r.Image_filesize, r.Original_Text, r.Redirect_url, r.Version, r.Rendering_size)
    values
    (sysdate, '1963884', '468x60_1.gif', '0', '225/9-468x60_1.gif', '1471', null, null, '1', '30670908')
    I know I can also insert the query using the string empty_blob(), but I dont want to do it without using empty_blob() since it will involve changing my generic DB classes.
    The strange thing is that I created another table involving blob and clob columns through TOAD.
    In this table I can insert NULL values in the blob column without any error.
    Is there anything that can be done to insert a NULL into my blob column? Am I missing anything?
    Is there a setting in the database that will allow me to do this? cuz one table accepts null and the other doesn't. Its strange.
    I am using Oracle8i Enterprise Edition Release 8.1.7.0.0
    The query doen't execute through toad or sql* plus or through program (I am using thin oracle drivers: the usual classes12.zip file)
    thanks in advance
    - Nilesh

    From metalink
    Oracle 9i Message~~~~~~~~~~~~~~~~~
    Error:     ORA-14400 (ORA-14400)
    Text:     inserted partition key does not map to any partition
    Cause:     An attempt was made to insert a record into, a Range or Composite
         Range object, with a concatenated partition key that is beyond the
         concatenated partition bound list of the last partition -OR- An
         attempt was made to insert a record into a List object with a
         partition key that did not match the literal values specified for
         any of the partitions.
    Action:     Do not insert the key. Or, add a partition capable of accepting
         the key, Or add values matching the key to a partition
         specification
    >
    So check the date .
    What is your insert statement.
    Anand
    Edited by: Anand... on Mar 4, 2009 5:42 PM

Maybe you are looking for

  • Contact Sheet II "Upgrade"

    Could someone please explain why Adobe took a perfectly good tool, Contact Sheet II, and made it more complicated and difficult to use, takes twice as long to get a final result, and then offers an unusable, optional plug in for those of us who were

  • SRVE0068E error!

    Hello, I'm using RAD 7.5 and connected to a remote WAS 7 Server. I'm developing a Web Application that retrieves data from an SQL Server 2005. I already did set up the JDBC and i use a java bean to connect through the JNDI name and execute the SQL st

  • Overdelivery tolerance with partial GRs

    Hi all, We have the following scenario in a  purchase order with the delivery tolerance indicator: Qty in th PO 1000, overdelivery tolerance 10%, so we can accept until 1100. We can do 2 partial GRs like Firts GR for 500 Second GR for 600 But if we d

  • Why my MacBook Pro's Spring 2011 Life span dropped from 1000 Cycles to 300 ?

    I have a 15" MacBook Pro, i7, 8GB Ram since i have done a System update , I have noticed in Watts application that my lifespan dropped from 1000 to 300 !!! How is that possible ???

  • Safari crashes on launch after Leopard install

    I have just installed Leopard after a fresh install with tiger so that I start with a blank canvas on my Macbook Pro Safari keeps crashing and giving the following error message: Process: Safari [531] Path: /Applications/Safari.app/Contents/MacOS/Saf