Long and  clob datatype

Hello Gurus
we are working on oracle 8.1.4.0.in our database i have a table that contain a long column and a clob cloumn. i need backup of this table so that i can create the same table with data in other schema. Is there any recommmanded way. Can use copy or i need to use an export backup .
thanks

If possible, try to upgrade your long columns to lob. Working with long columns will severely limit the possibilities of adopting new features. It would have been easier to use the
ALTER TABLE MOVE ... command.
~ Madrid
http://hrivera99.blogspot.com/

Similar Messages

  • How to copy a table with LONG and CLOB datatype over a dblink?

    Hi All,
    I need to copy a table from an external database into a local one. Note that this table has both LONG and CLOB datatypes included.
    I have taken 2 approaches to do this:
    1. Use the CREATE TABLE AS....
    SQL> create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db;
    create table XXXX_TEST as select * from XXXX_INDV_DOCS@ext_db
    ERROR at line 1:
    ORA-00997: illegal use of LONG datatype
    2. After reading some threads I tried to use the COPY command:
    SQL> COPY FROM xxxx/pass@ext_db TO xxxx/pass@target_db REPLACE XXXX_INDV_DOCS USING SELECT * FROM XXXX_INDV_DOCS;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    CPY-0012: Datatype cannot be copied
    If my understanding is correct the 1st statement fails because there is a LONG datatype in XXXX_INDV_DOCS table and 2nd one fails because there is a CLOB datatype.
    Is there a way to copy the entire table (all columns including both LONG and CLOB) over a dblink?
    Would greatelly appriciate any workaround or ideas!
    Regards,
    Pawel.

    Hi Nicolas,
    There is a reason I am not using export/import:
    - I would like to have a one-script solution for this problem (meaning execute one script on one machine)
    - I am not able to make an SSH connection from the target DB to the local one (although the otherway it works fine) which means I cannot copy the dump file from target server to local one.
    - with export/import I need to have an SSH connection on the target DB in order to issue the exp command...
    Therefore, I am looking for a solution (or a workaround) which will work over a DBLINK.
    Regards,
    Pawel.

  • Using long vs. clob datatype with Oracle 8.1.7 and interMedia

    I am trying to determine the best datatype to use for a column I
    wish to search using the interMedia contains() function. I am
    developing a 100% java application using Oracle 8.1.7 on Linux.
    I'd prefer to use the standard JDBC API's for PreparedStatement,
    and not have to use Oracle extensions if possible. I've
    discovered that there are limitations in the support for LOB's
    in Oracle's 100% java driver. The PreparedStatement methods
    like setAsciiStream() and setCharacterStream() are documented to
    have flaws that may result in the corruption of data. I have
    also noticed that socket exceptions sometimes occur when a large
    amount of data is transferred. If I use the long datatype for
    my table column, the setCharacterStream() method seems to
    transfer the data correctly. When I try to search this column
    using the interMedia contains() function, I get strange
    results. If I run my search on Oracle 8.1.6 for Windows, the
    results seem to be correct. If I run the same search on Oracle
    8.1.7 for Linux, the results are usually incorrect. The same
    searches seem to work correctly on both boxes when I change the
    column type from long to clob. Using the clob type may not be
    an option for me since the standard JDBC API's to transfer data
    into internal clob fields are broken, and I may need to stick
    with standard JDBC API's. My customer wishes to purchase a
    version of Oracle for Linux that will allow us to implement the
    search capability he requires. Any guidance would be greatly
    appreciated.

    I've finally solved it!
    I downloaded the following jre from blackdown:
    jre118_v3-glibc-2.1.3-DYNMOTIF.tar.bz2
    It's the only one that seems to work (and god, have I tried them all!)
    I've no idea what the DYNMOTIF means (apart from being something to do with Motif - but you don't have to be a linux guru to work that out ;)) - but, hell, it works.
    And after sitting in front of this machine for 3 days trying to deal with Oracle's, frankly PATHETIC install, that's so full of holes and bugs, that's all I care about..
    The one bundled with Oracle 8.1.7 doesn't work with Linux redhat 6.2EE.
    Don't oracle test their software?
    Anyway I'm happy now, and I'm leaving this in case anybody else has the same problem.
    Thanks for everyone's help.

  • Problem with Long and BigDecimal DataType convertion

    HI,
    I have an application which talk to MySQL database with Spring JDBC layer and everything runs like a champ :)
    Now I am converting the same application with the same DAO implementation to communicate with oracle database and I am having some trouble converting DataType from database to my java code.
    For example before with MySQL I would convert any Integer coming from the database to Long datatype and it worked. Now it seems that Int datatype from oracle comes as a BigDecimal type.
    I am thinking about two approaches writing an additional implementation to implement my dao interfaces or if there is some trickery that I can bypass doing that and work around these datatype incompatibility from MYSQL to Oracle.
    I can also put bunch of try and catch statements and if fails with Long try with BigDecimal, but still don't buy it as the best solution.
    Here use also code snippet:
    User u = new User();
                        u.setObjectId((Long) m.get("oid"));//This works with MYSQL backend but not with Oracle so the raw object seem to be coming as BigDecimal datatype
                        u.setLogon((String) m.get("logon"));
                        u.setPassword((String) m.get("password"));
                        u.setName((String) m.get("uname"));
                        u.setCompany(companyDAO.getById((Long) m.get("cOid")));Any help will be appreciated.
    Edited by: kminev on Mar 3, 2010 12:25 PM

    //This is my entity class
    public class User implements Comparable<User>  {
        private Long objectId = 0L;
        private Company company;
        private String logon = "";
        private String password = "";
        private String name = "";
        private boolean hasAdminRights=false;
        private boolean hasMaintenanceRights=false;
    //This is my bean class
    <bean id="userDAO" class=" com.myorg.myapp.dao.jdbc.UserImpl">
            <property name="transactionManager">
                <ref local="transactionManager"/>
            </property>
            <property name="companyDAO">
                <ref local="companyDAO"/>
            </property>
            <property name="companyAccessDAO">
                <ref local="companyAccessDAO"/>
            </property>
        </bean>

  • CLOB datatype question

    Hi,
    I have a question regarding CLOB datatypes.
    The scenario is as follows:
    In our existing oracle 8i database, we have a tables say "inquiry" and another table "inq_details". The details table has a LONG field where we create a new record every time details for a specific inquiry is logged. The length of details can be any where from few characters to the field length.
    We are planning to move the DB to oracle 9i and I heard it is better to move from LONG to CLOB datatype.
    The question is If we log a new record (as it is today) for every detail record, should we be concerned with the data field size and retrieval performance?
    Am I better of appending the details to the same column instead of creating new record? (Only diff between two diff records is the details section nothing more than that). When we display the record, we always get all the details in the order in which they are logged.
    thank you

    A quick look in the manual would have shown you that LPAD returns the same datatype as its first argument : LPAD
    The string returned is of VARCHAR2 data type if expr1 is a character data type, NVARCHAR2 if expr1 is a national character data type, and a LOB if expr1 is a LOB data type.
    So, this works :
    SQL> declare
      2    r clob;
      3  begin
      4    r := lpad(to_clob('0'), 32768, '0');
      5  end;
      6  /
    PL/SQL procedure successfully completed

  • MS sql test converted to long and job log states that 1 row read at time

    I am going from ms sql to ms sql server. The source text datatype is being covnerted to a long. No problem there. However, when the job runs, there is a warning: Rows per committ has been reset to 1 because table conatins a long column.
    11.7 of DI
    How can I get around this?

    Michael,
    This is indeed a limitation in the DI 11.7 (and earlier) releases which might result in a slower performance when loading data with long or CLOB datatypes.
    In DI XI 3.0 (or version 12.0) we significantly improved the large object support. Main improvements were supporting BLOB (in addition to CLOB), extending support to more BLOB/CLOB datatypes for all databases and an optimized intermediate storage of the large objects. Removing the commit=1 restriction was a side effect of these optimizations.
    Ben.

  • QUERYING CLOB DATATYPE

    Hello Everyone,
    Before I go to my question let me give you the context. I wanted to upload the description of a set of products with their IDs into my database. Hence I created a table 'demo' with two columns of INT and CLOB datatypes using the following script. *create table demo ( id int primary key, theclob Clob );*
    Then I create a directory using the following script, *Create Or Replace Directory MY_FILES as 'C:\path of the folder.......\';*
    In the above mentioned directory I create one .txt file for each product with the description of the product. Using the below script I created a procedure to load the contents of the .txt files into my 'demo' table.
    *CREATE OR REPLACE*
    *PROCEDURE LOAD_A_FILE( P_ID IN NUMBER, P_FILENAME IN VARCHAR2 ) AS*
    *L_CLOB CLOB;*
    *L_BFILE BFILE;*
    *BEGIN*
    *INSERT INTO DEMO VALUES ( P_ID, EMPTY_CLOB() )*
    *RETURNING THECLOB INTO L_CLOB;*
    *L_BFILE := BFILENAME( 'MY_FILES', P_FILENAME );*
    *DBMS_LOB.FILEOPEN( L_BFILE );*
    *DBMS_LOB.LOADFROMFILE( L_CLOB, L_BFILE,*
    *DBMS_LOB.GETLENGTH( L_BFILE ) );*
    *DBMS_LOB.FILECLOSE( L_BFILE );*
    *END;*
    After which I called the procedure using, *exec load_a_file(1, 'filename.txt' );*
    When I queried the table like, select * from demo; I am getting the following output..... which is all fine.
    ID THECLOB
    1 "product x is an excellent way to improve your production process and enhance your turnaround time....."
    _*QUESTION*_
    When I did the exact same thing in my friend's machine and query the demo table, I get garbage value in the 'theclob' column (as shown below). The only difference is that mine is an enterprise edition of Oracle 11.2.0.1 and my friends is an Express edition of Oracle 11.2.0.2. Does this has anything to do with the problem?
    1 ⁦     猺⁁摶慮捥搠摡瑡潬汥捴楯渠捡灡扩汩瑩敳㨠扡牣潤攠獣慮湩湧Ⱐ灡湩挠慬敲琬⁷潲欠潲摥爠浡湡来浥湴Ⱐ睩牥汥獳⁦潲浳湤⁳異敲癩獯爠瑩浥⁥湴特⸊੃潭整⁍潢楬攠坯牫敲㨠周攠浯獴⁲潢畳琠灡捫慧攮⁐牯癩摥猠扵獩湥獳敳⁷楴栠愠捯浰汥瑥汹⁷楲敬敳猠潰敲慴楯湡氠浡湡来浥湴⁳祳瑥洮⁉湣汵摥猠慬氠潦⁃潭整⁔牡捫敲❳⁦敡瑵牥猠灬畳㨠䍡汥湤慲猬畴潭慴敤畳瑯浥爠捯浭畮楣慴楯湳Ⱐ睯牫牤敲⽩湶潩捥⁵灤慴楮朠晲潭⁴桥⁦楥汤Ⱐ睯牫牤敲⁳敱略湣楮本⁥硣敳獩癥⁳瑯瀠瑩浥汥牴猬⁷楲敬敳猠景牭猬⁴畲渭批⵴畲渠癯楣攠湡癩条瑩潮Ⱐ慮搠浯牥⸊ੁ摶慮捥搠坩
    2     ≁否吠潦晥牳摶慮捥搠睩牥汥獳⁦潲浳慰慢楬楴礠睩瑨⁃潭整⁅娠䍯浥琬⁔牡捫敲湤⁃潭整⁍潢楬攠坯牫敲ਊ䍯浥琠䕚㨠周攠浯獴⁲潢畳琬潳琠敦晥捴楶攠睥戠扡獥搠䵒䴠慰灬楣慴楯渠楮⁴桥⁩湤畳瑲礮⁃慰慢楬楴楥猠楮捬畤攠䝐匠汯捡瑩潮⁴牡捫楮本⁷楲敬敳猠瑩浥汯捫Ⱐ来漭晥湣楮朠睩瑨汥牴猬⁳灥敤湤⁳瑯瀠瑩浥汥牴猬湤渭摥浡湤爠獣桥摵汥搠牥灯牴楮朮ਊ䍯浥琠呲慣步爺⁁⁰潷敲晵氠捬楥湴ⵢ慳敤⁰污瑦潲洠瑨慴晦敲猠慬氠瑨攠晥慴畲敳映䍯浥琠䕚⁰汵猺⁁摶慮捥搠摡瑡潬汥捴楯渠捡灡扩汩瑩敳㨠扡牣潤攠獣慮湩湧Ⱐ灡湩挠慬敲琬⁷潲欠潲摥爠浡湡来浥湴Ⱐ睩牥汥獳⁦潲浳湤⁳異敲癩獯爠瑩浥⁥湴特⸊੃潭整⁍潢楬攠坯牫敲㨠周攠浯獴⁲潢畳琠灡捫慧攮⁐牯癩摥猠扵獩湥獳敳⁷楴栠愠捯浰汥瑥汹⁷楲敬敳猠潰敲慴楯湡氠浡湡来浥湴⁳祳瑥洮⁉湣汵摥猠慬氠潦⁃潭整⁔牡捫敲❳⁦敡瑵牥猠灬畳㨠䍡汥湤慲猬畴潭慴敤畳瑯浥爠捯浭畮楣慴楯湳Ⱐ睯牫牤敲⽩湶潩捥⁵灤慴楮朠晲潭⁴桥⁦楥汤Ⱐ睯牫牤敲⁳敱略湣楮本⁥硣敳獩癥⁳瑯瀠瑩浥汥牴猬⁷楲敬敳猠景牭猬⁴畲渭批⵴畲渠癯楣攠湡癩条瑩潮Ⱐ慮搠浯牥⸊ੁ摶慮捥搠坩牥汥獳⁆潲浳㨠呵牮湹⁰慰敲⁦潲洠楮瑯⁷楲敬敳猠捬潮攠潦⁴桥⁳慭攠楮景牭慴楯渠ⴠ湯慴瑥爠桯眠捯浰汩捡瑥搮⁓慶攠瑩浥礠瑲慮獦敲物湧⁩湦潲浡瑩潮慣欠瑯⁴桥晦楣攠睩瑨⁷楲敬敳猠獰敥搮⁓慶攠灡灥爠慮搠敬業楮慴攠摵慬•ഊ
    3     ≁䥒呉䵅⁍慮慧敲⁦牯洠䅔♔⁰牯癩摥猠愠浯扩汥灰汩捡瑩潮猠摥獩杮敤⁴漠瑲慣欠扩汬慢汥⁨潵牳⸠⁔桥⁁㑐⁳潬畴楯湳畴潭慴楣慬汹潧⁷楲敬敳猠敭慩氬慬汳Ⱐ慮搠扩汬慢汥⁥癥湴猬獳潣楡瑥猠瑨敭⁷楴栠捬楥湴爠灲潪散琠捯摥猠慮搠摩牥捴猠扩汬慢汥⁲散潲摳⁴漠扩汬楮朠獹獴敭献†周攠呩浥乯瑥⁳潬畴楯湳⁰牯癩摥⁳汩浭敤潷渠數灥物敮捥Ⱐ慬汯睩湧⁦潲牥慴楯渠潦慮畡氠扩汬慢汥⁥癥湴献†周敲攠慲攠瑷漠癥牳楯渠潦⁁㑐湤⁔業敎潴攮ਊ䭥礠䙥慴畲敳㨊⨠䥮捬畤攠捡灴畲攠慤⵨潣楬污扬攠敶敮瑳ਪ⁃慰瑵牥潢楬攠灨潮攠捡汬湤⁥浡楬†慳楬污扬攠敶敮瑳Ⱐਪ⁁扩汩瑹⁴漠慳獩杮楬污扬攠敶敮琠瑯汩敮琠慮搠灲潪散琊⨠䅢楬楴礠瑯⁳敡牣栠慮搠獣牯汬⁴桲潵杨楬污扬攠敶敮瑳Ⱐ潰瑩潮⁴漠楮瑥杲慴攠睩瑨楬汩湧⁳祳瑥浳 ⨠偯瑥湴楡氠扥湥晩瑳⁩湣汵摥⁩湣牥慳敤⁰牯摵捴楶楴礠慮搠牥摵捥搠慤浩湩獴牡瑩癥癥牨敡搠湤⁩湣牥慳敤⁲敶敮略略⁴漠浯牥捣畲慴攠捡灴畲楮朠潦楬污扬攠敶敮瑳•ഊ
    4     ≁灲楶慐慹⁁乄⁁灲楶慐慹⁐牯晥獳楯湡氠晲潭⁁否吠瑵牮⁹潵爠浯扩汥敶楣攠楮瑯⁰潲瑡扬攠捲敤楴慲搠瑥牭楮慬⸠坩瑨潭灡瑩扬攠䅔♔⁳浡牴灨潮攬⁁灲楶慐慹爠䅰物癡偡礠偲潦敳獩潮慬⁳潦瑷慲攬湤敲捨慮琠慣捯畮琬⁹潵爠浯扩汥⁷潲武潲捥慮⁰牯捥獳牥摩琠潲敢楴慲搠灡祭敮瑳⁦牯洠瑨攠晩敬搮ਊ䭥礠䙥慴畲敳㨠 ⨠卭慲瑰桯湥ⵢ慳敤⁳潬畴楯渠⁴漠灲潣敳猠捲敤楴慲搠灡祭敮瑳 ⨠䙵汬ⵦ敡瑵牥搠灯楮琭潦⵳慬攠獯汵瑩潮⁳異灯牴楮朠慬氠浡橯爠瑲慮獡捴楯渠瑹灥ਠ⨠卵灰潲瑳牥摩琠慮搠摥扩琠瑲慮獡捴楯湳 ਊ∍
    To make sure that the .txt files are accessible in the directory I executed the following script, Host Echo Hello World > C:\...path...\1.Txt
    After which I found the contents of the file changed to "Hello World". Later I loaded the .txt file with "Hello World" and queried the table. Still I am getting some garbage value. However since the string "Hello World" is much smaller than the previous contents, the garbage size is also smaller for ID 1. I don't get any errors, but you can see the output as follows.
    1      䠀攀氀氀漀 圀漀爀氀搀  ഀ਀
    2     ≁否吠潦晥牳摶慮捥搠睩牥汥獳⁦潲浳慰慢楬楴礠睩瑨⁃潭整⁅娠䍯浥琬⁔牡捫敲湤⁃潭整⁍潢楬攠坯牫敲ਊ䍯浥琠䕚㨠周攠浯獴⁲潢畳琬潳琠敦晥捴楶攠睥戠扡獥搠䵒䴠慰灬楣慴楯渠楮⁴桥⁩湤畳瑲礮⁃慰慢楬楴楥猠楮捬畤攠䝐匠汯捡瑩潮⁴牡捫楮本⁷楲敬敳猠瑩浥汯捫Ⱐ来漭晥湣楮朠睩瑨汥牴猬⁳灥敤湤⁳瑯瀠瑩浥汥牴猬湤渭摥浡湤爠獣桥摵汥搠牥灯牴楮朮ਊ䍯浥琠呲慣步爺⁁⁰潷敲晵氠捬楥湴ⵢ慳敤⁰污瑦潲洠瑨慴晦敲猠慬氠瑨攠晥慴畲敳映䍯浥琠䕚⁰汵猺⁁摶慮捥搠摡瑡潬汥捴楯渠捡灡扩汩瑩敳㨠扡牣潤攠獣慮湩湧Ⱐ灡湩挠慬敲琬⁷潲欠潲摥爠浡湡来浥湴Ⱐ睩牥汥獳⁦潲浳湤⁳異敲癩獯爠瑩浥⁥湴特⸊੃潭整⁍潢楬攠坯牫敲㨠周攠浯獴⁲潢畳琠灡捫慧攮⁐牯癩摥猠扵獩湥獳敳⁷楴栠愠捯浰汥瑥汹⁷楲敬敳猠潰敲慴楯湡氠浡湡来浥湴⁳祳瑥洮⁉湣汵摥猠慬氠潦⁃潭整⁔牡捫敲❳⁦敡瑵牥猠灬畳㨠䍡汥湤慲猬畴潭慴敤畳瑯浥爠捯浭畮楣慴楯湳Ⱐ睯牫牤敲⽩湶潩捥⁵灤慴楮朠晲潭⁴桥⁦楥汤Ⱐ睯牫牤敲⁳敱略湣楮本⁥硣敳獩癥⁳瑯瀠瑩浥汥牴猬⁷楲敬敳猠景牭猬⁴畲渭批⵴畲渠癯楣攠湡癩条瑩潮Ⱐ慮搠浯牥⸊ੁ摶慮捥搠坩牥汥獳⁆潲浳㨠呵牮湹⁰慰敲⁦潲洠楮瑯⁷楲敬敳猠捬潮攠潦⁴桥⁳慭攠楮景牭慴楯渠ⴠ湯慴瑥爠桯眠捯浰汩捡瑥搮⁓慶攠瑩浥礠瑲慮獦敲物湧⁩湦潲浡瑩潮慣欠瑯⁴桥晦楣攠睩瑨⁷楲敬敳猠獰敥搮⁓慶攠灡灥爠慮搠敬業楮慴攠摵慬•ഊ
    3     ≁䥒呉䵅⁍慮慧敲⁦牯洠䅔♔⁰牯癩摥猠愠浯扩汥灰汩捡瑩潮猠摥獩杮敤⁴漠瑲慣欠扩汬慢汥⁨潵牳⸠⁔桥⁁㑐⁳潬畴楯湳畴潭慴楣慬汹潧⁷楲敬敳猠敭慩氬慬汳Ⱐ慮搠扩汬慢汥⁥癥湴猬獳潣楡瑥猠瑨敭⁷楴栠捬楥湴爠灲潪散琠捯摥猠慮搠摩牥捴猠扩汬慢汥⁲散潲摳⁴漠扩汬楮朠獹獴敭献†周攠呩浥乯瑥⁳潬畴楯湳⁰牯癩摥⁳汩浭敤潷渠數灥物敮捥Ⱐ慬汯睩湧⁦潲牥慴楯渠潦慮畡氠扩汬慢汥⁥癥湴献†周敲攠慲攠瑷漠癥牳楯渠潦⁁㑐湤⁔業敎潴攮ਊ䭥礠䙥慴畲敳㨊⨠䥮捬畤攠捡灴畲攠慤⵨潣楬污扬攠敶敮瑳ਪ⁃慰瑵牥潢楬攠灨潮攠捡汬湤⁥浡楬†慳楬污扬攠敶敮瑳Ⱐਪ⁁扩汩瑹⁴漠慳獩杮楬污扬攠敶敮琠瑯汩敮琠慮搠灲潪散琊⨠䅢楬楴礠瑯⁳敡牣栠慮搠獣牯汬⁴桲潵杨楬污扬攠敶敮瑳Ⱐ潰瑩潮⁴漠楮瑥杲慴攠睩瑨楬汩湧⁳祳瑥浳 ⨠偯瑥湴楡氠扥湥晩瑳⁩湣汵摥⁩湣牥慳敤⁰牯摵捴楶楴礠慮搠牥摵捥搠慤浩湩獴牡瑩癥癥牨敡搠湤⁩湣牥慳敤⁲敶敮略略⁴漠浯牥捣畲慴攠捡灴畲楮朠潦楬污扬攠敶敮瑳•ഊ
    4     ≁灲楶慐慹⁁乄⁁灲楶慐慹⁐牯晥獳楯湡氠晲潭⁁否吠瑵牮⁹潵爠浯扩汥敶楣攠楮瑯⁰潲瑡扬攠捲敤楴慲搠瑥牭楮慬⸠坩瑨潭灡瑩扬攠䅔♔⁳浡牴灨潮攬⁁灲楶慐慹爠䅰物癡偡礠偲潦敳獩潮慬⁳潦瑷慲攬湤敲捨慮琠慣捯畮琬⁹潵爠浯扩汥⁷潲武潲捥慮⁰牯捥獳牥摩琠潲敢楴慲搠灡祭敮瑳⁦牯洠瑨攠晩敬搮ਊ䭥礠䙥慴畲敳㨠 ⨠卭慲瑰桯湥ⵢ慳敤⁳潬畴楯渠⁴漠灲潣敳猠捲敤楴慲搠灡祭敮瑳 ⨠䙵汬ⵦ敡瑵牥搠灯楮琭潦⵳慬攠獯汵瑩潮⁳異灯牴楮朠慬氠浡橯爠瑲慮獡捴楯渠瑹灥ਠ⨠卵灰潲瑳牥摩琠慮搠摥扩琠瑲慮獡捴楯湳 ਊ∍
    Edited by: Arunkumar Gunasekaran on Jan 3, 2013 11:38 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    >
    To make sure that the .txt files are accessible in the directory I executed the following script, Host Echo Hello World > C:\...path...\1.Txt
    After which I found the contents of the file changed to "Hello World". Later I loaded the .txt file with "Hello World" and queried the table. Still I am getting some garbage value. However since the string "Hello World" is much smaller than the previous contents, the garbage size is also smaller for ID 1. I don't get any errors, but you can see the output as follows.
    >
    The most common problem I have seen using BFILEs is the character set; BFILEs do NOT handle character set conversion.
    That is the main reason I don't recommend using BFILEs for loading data like this. Either SQL*Loader or external tables can do the job and they both handle character set conversions properly.
    See the LOADFROMFILE Procedure of DBMS_LOB package in the PL/SQL Language doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_lob.htm#i998778
    >
    Note:
    The input BFILE must have been opened prior to using this procedure. No character set conversions are performed implicitly when binary BFILE data is loaded into a CLOB. The BFILE data must already be in the same character set as the CLOB in the database. No error checking is performed to verify this.
    Note:
    If the character set is varying width, UTF-8 for example, the LOB value is stored in the fixed-width UCS2 format. Therefore, if you are using DBMS_LOB.LOADFROMFILE, the data in the BFILE should be in the UCS2 character set instead of the UTF-8 character set. However, you should use sql*loader instead of LOADFROMFILE to load data into a CLOB or NCLOB because sql*loader will provide the necessary character set conversions.
    >
    I suggest you use an external table definition to do this load. You can do an ALTER to change the file name for each load.
    See External Tables Concepts in the Utilities doc for the basics
    http://docs.oracle.com/cd/B28359_01/server.111/b28319/et_concepts.htm
    See Altering External Tables in the DBA doc for detailed information
    http://docs.oracle.com/cd/B28359_01/server.111/b28310/tables013.htm
    >
    DEFAULT DIRECTORY
    Changes the default directory specification
    ALTER TABLE admin_ext_employees
    DEFAULT DIRECTORY admin_dat2_dir;
    LOCATION
    Allows data sources to be changed without dropping and re-creating the external table metadata
    ALTER TABLE admin_ext_employees
    LOCATION ('empxt3.txt',
    'empxt4.txt');
    >
    You can also load in parallel if you have licensed that option.

  • Migration of LONG and LONG RAW datatype

    Just upgraded a DB from 8.1.7.4 to 10.2.0.1.0. In the post-upgrade tasks, it speaks of migrating tables with LONG and LONG RAW datatypes to CLOB's or BLOB's. All of my tables in the DB with LONG or LONG RAW datatypes are in the sys, sysman, mdsys or system schemas (as per query of dba_tab_columns). Are these to be converted? Or, does Oracle want us to convert user data only (user_tab_columns)?

    USER_TAB_COLUMNS tells you the columns in the tables owned by the current user. There may well be many users on your system that you created that contain objects. I suppose you could log in to each of those schemas and query their USER_TAB_COLUMNS table, but it's probably easier to query DBA_TAB_COLUMNS with an appropriate WHERE clause on the owner of the objects.
    Justin

  • Importing and Exporting Data with a Clob datatype with HTML DB

    I would like to know what to do and what to be aware of when Importing and Exporting data with a Clob Datatype with HTML DB?

    Colin - what kind of import/export operation would that be, which pages are you referring to?
    Scott

  • VLD-2550 and 2551: CLOB datatype errors

    Hi All
    I've been trying to solve thi sproblem but have not been able to find a solution.
    Basically I have a Col1 (of table A) of clob datatype which is to be mapped to Col2 (table B).
    But when I validate the map I get the error:
    VLD-2550 : BLOB,CLOB or NBLOB data from remote source cannot have transformations (validation details : If you have CLOB,BLOB as remote data source, it must be directly mapped to a target entity)
    and
    VLD-2551: BLOB LCOB or NBLOB from remote data source must have generation mode set to SET-BASED.
    My map has a one to one mapping between the cols of tables A and B. Col1 is directly linked to Col2 (if thats what is meant by no transformations for CLOb types)
    Thanks a lot

    Hi ,
    If your source table (which have the CLOB ) is in remote machine then you need to configure the mapping in SET base mode and you should directly connect that source column to the target column .
    If you still get those kind of validation waring then simple ignore them .
    It is a defect in OWB . Refer Bug 5989066 : VALIDATION OF MAP WITH BLOB OBJECTS THROWS VLD-2550 AND VLD-2551 WARNINGS , which is yet to be fixed .
    Thanks,
    Sutirtha

  • A clob datatype and LogMiner question?

    HI,
    I am using Logminer to caputer all DMLs agaist rows with clob datatype, find a problem.
    --log in as scott/tiger
    conn scott/tiger
    SQL> desc clobtest
    Name Null? Type
    SNO NUMBER
    CLOBTYPE CLOB
    --make a update
    update clobtest set CLOBTYPE = 'Hello New York' where sno = 11;
    commit;
    after using LogMiner to analyze redo log files, to query.
    select sql_redo from v$logmnr_contents where username = 'SCOTT';
    update "SCOTT"."CLOBTEST" set "CLOBTYPE" = 'Hello New York' where and ROWID = 'AAD0ZqAAEAAAAhsAAC';
    My quesion:
    As to caputured DML
    update "SCOTT"."CLOBTEST" set "CLOBTYPE" = 'Hello New York' where and ROWID = 'AAD0ZqAAEAAAAhsAAC';
    it shows "where and", why there is missing after where clause????? --(anyway, I can overcome this by using REGEXP_REPLACE(sql_redo,'where and','where ')
    Thanks
    Roy
    Edited by: ROY123 on Mar 16, 2010 10:25 AM

    I checked logminer documetation:
    http://74.125.93.132/search?q=cache:19bBhYX3Xs4J:download.oracle.com/docs/cd/B19306_01/server.102/b14215/logminer.htm+NOTE:LogMiner+does+not+support+these+datatypes+and+table+storage+attributes:&cd=1&hl=en&ct=clnk&gl=us
    it says 10GR2 support LOB datatype.
    but why "where clause" omit the clob datatype column (becaume "where and rowid")????
    Edited by: ROY123 on Mar 16, 2010 2:12 PM

  • How we handle CLOB and BLOB Datatypes in HANA DB

    Dear HANA Gurus,
    We have would like to build EDW using HANA base on our source system Oracle and it's supports CLOB and BLOB datatypes
    Would you please suggest how do we handle in HANA DB.
    Let not say it's oracle specific.
    Regards,
    Manoj

    Hello,
    check SAP HANA SQL Reference Guide for list of data types:
    (page 14 - Classification of Data Types)
    https://service.sap.com/~sapidb/011000358700000604922011
    For this purpose might be useful following data types:
    Large Object (LOB) Types
    LOB (large objects) data types, CLOB, NCLOB and BLOB, are used to store a large amount of data such as text documents and images. The maximum size of an LOB is 2 GB.
    BLOB
    The BLOB data type is used to store large binary data.
    CLOB
    The CLOB data type is used to store large ASCII character data.
    NCLOB
    The NCLOB data type is used to store a large Unicode character object.
    Tomas

  • Clob DataType, NULL and ADO

    Hello,
    First, I'm french so my english isn't very good
    I have a problem with Oracle Clob DataType. When I try to put NULL value to
    CLOB DataType with ADO, changes aren't not made.
    rs.open "SELECT ....", adocn, adOpenKeyset, adLockOptimistic
    rs.Fields("ClobField") = Null ' In this case, the Update doesn't work
    rs.update
    rs.Close
    This code works if I try to write a value which is different than Null but
    not if is equal to Null. Instead of having Null, I have the old value
    (before changes), the update of the field doesn't work.

    I experience the same, did you find a solution to your problem?
    Kind regards,
    Roel de Bruyn

  • Clob datatype and JDBC

    JDBC does not support CLOB, as i figured out the hard way, or is
    the version of JDBC that i have that is not supporting it.
    Can someone advise me on how do i get around this problem?
    Database that i connecting to has clob types.
    Alex
    null

    Alex Korneyev (guest) wrote:
    : JDBC does not support CLOB, as i figured out the hard way, or
    is
    : the version of JDBC that i have that is not supporting it.
    : Can someone advise me on how do i get around this problem?
    : Database that i connecting to has clob types.
    : Alex
    Follow this link for a tutorial on JDBC and CLOB using the
    Oracle JDBC driver
    http://www.oracle.com/ideveloper/99article/ta010199.html
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Return CLOB datatype to Java

    Hello,
    Does anyone have any examples of how a CLOB datatype can be returned from a stored procedure and used in java?
    Currently we are building up strings and returning a VARCHAR2 datatype, but are running into the 32k size restriction as some of the strings are too long.
    It seems that converting the strings to CLOBs and then returning is the best solution. Has anyone had a similar problem and solved it?
    Regards,
    Eoin

    Create stored procedure like this :
    create or replace procedure getclob(var out clob) as
    str varchar2(20);
    templob CLOB;
    begin
    str :='mystring';
    DBMS_LOB.CREATETEMPORARY(templob, TRUE, dbms_lob.session);
    dbms_lob.write(templob,length(str),1,str);
    var :=templob;
    DBMS_LOB.FREETEMPORARY(templob);
    end;
    java program to call above stored procedure
    import java.sql.*;
    import oracle.jdbc.driver.*;
    class SPLobInJava
    public static void main(String args[]) throws Exception
    DriverManager.registerDriver(new
    oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@insn104:1521:ora9idb", "scott", "tiger");
    CallableStatement cs;
    cs = conn.prepareCall("{call getclob(?)}");
    cs.registerOutParameter(1,java.sql.Types.CLOB);
    cs.execute();
    Clob clob =cs.getClob(1);
    // do whatever you want with the clob
    System.out.println(clob.getSubString(1,5));
    cs.close();
    conn.close();
    }

Maybe you are looking for