How to convert clob data type varchar2.

Hello
If select below questioning the data type must be varchar2 but I want to convert the text to a clob.


Select 'World' of double;


Kind regards
Fame
SQL> Select 'My_name is rajuvan' Vrchr,
2       TO_CLOB('My_name is rajuvan') clb
3      from dual; 

VRCHR                          CLB
------------------------------ ------------------------------
My_name is rajuvan             My_name is rajuvan

SQL>

Tags: Database

Similar Questions

  • Insert/update the column with the clob data type

    Hi all

    ORCL Version: 11g.

    I have a table with the clob data type.

    Test12

    (col1 clob);

    I'm trying to insert/update to update the column with more than 4000 characters.

    But due to the limitation of tank 4000, I could not Insert/Update.

    Need your help in resolving this issue.

    THX

    Rod.

    The limit of 4000 characters is incorrect.  That pertains only to the varchar2 data type.  A clob can hold more than 4 G.

    Here is an example that shows how to insert it, I found...

    Otherwise, here is a way 'dirty' to do.

    insert into your_table (COLA, COLB)

    values

    (PRIMARY_KEY, PART 1 OF DATA)

    ;

    Update your_table

    Define COLB = COLB | PART 2 OF BIG DATA

    where COLA = PRIMARY_KEY;

    Update your_table

    Define COLB = COLB | PART 3 OF BIG DATA

    where COLA = PRIMARY_KEY;

    .. and so on...

    I don't know that I personally recommend the second style...  But he could do the job.

  • How to declare the data type of a column in a select query?

    How can we give the data type of each column on the fly during the selection of rows in a query?

    the cast function converts one data type to another.

    The syntax of the cast function is:

    Cast ({expr |}) (subquery) | (MULTISET (subquery)} AS type_name)

    Select cast (22 August 2003 ' AS varchar2 (30))
    Double;

    Published by: b_ * August 12, 2011 10:08

  • Simple question of CLOB data type

    declare
    r clob;
    begin
      r := lpad('0',32768,'0');
    end;
    

    ORA-06502: PL/SQL: digital or value error: character string buffer too small

    ORA-06512: at line 4 level

    06502 00000 - "PL/SQL: digital error or the value of %s.

    So that tells me that an in PL/SQL CLOB data type cannot be as big as a VARCHAR2, correct? A variable in a PL/SQL can be greater than this?

    Thank you!

    So that tells me that an in PL/SQL CLOB data type cannot be as big as a VARCHAR2, correct?

    NO - that tells you that LPAD works with VARCHAR2 and function is what the limit.

  • Full table scan without sweeping particular column (CLOB data type column)

    I want to select the online_bank table. This table with a column of type CLOB data. I want to select all the columns in the table, except the column type of clob data. but oracle full table, including the column analysis server type CLOB data when the query is run. It took a long time to complete the table. Please give me a solution of full table scan without analysis the CLOB data type column. How to avoid the time scanning CLOB data type column... ?

    878728 wrote:
    I want to select the online_bank table. This table with a column of type CLOB data. I want to select all the columns in the table, except the column type of clob data. but oracle full table, including the column analysis server type CLOB data when the query is run. It took a long time to complete the table. Please give me a solution of full table scan without analysis the CLOB data type column. How to avoid the time scanning CLOB data type column... ?

    We do not have your table.
    We do not have your data.
    Therefore, we have no answer to your apparent mystery.

  • Add a new node to an existing XML (CLOB) data type

    Hi guys,.

    I have a table with one of his field as a CLOB data type that stores a XML here, now I need to add an additional node to the XML.

    <?xml version="1.0" encoding="UTF-8"?><alert>
     
         <tab0 comment="section in XSL component" name="Initial Information">
              <details>     
                   <Priority>0001</Priority>
                   <DateVRUClaimInitiated>2010-06-29</DateVRUClaimInitiated>
              
              </details>
              <contacts comment="grid in XSL component">
                   many child nodes here
              </contacts>               
         </tab0>
     
         <tab1 comment="section in XSL component" name="Additional Information">
              <details comment="list collection in XSL component">
                   <Channel1>123</Channel1>
              </details>
              <IPAddresses>
                   Many child nodes here
              </IPAddresses>          
              <ANIPhones>
                   Many child nodes here
              </ANIPhones>
         </tab1>
    </alert>
    Here, in this xml file, I need to add this node < / canal2 >... so my xml should look like
    <?xml version="1.0" encoding="UTF-8"?><alert>
     
         <tab0 comment="section in XSL component" name="Initial Information">
              <details>     
                   <Priority>0001</Priority>
                   <DateVRUClaimInitiated>2010-06-29</DateVRUClaimInitiated>
              
              </details>
              <contacts comment="grid in XSL component">
                   many child nodes here
              </contacts>               
         </tab0>
     
         <tab1 comment="section in XSL component" name="Additional Information">
              <details comment="list collection in XSL component">
                   <Channel1>123</Channel1></Channel2>
              </details>
              <IPAddresses>
                   Many child nodes here
              </IPAddresses>          
              <ANIPhones>
                   Many child nodes here
              </ANIPhones>
         </tab1>
    </alert>
    I can do using an update or something?

    but it converts my CLOB to ORAXML.

    then use getclobval():

    select insertchildxml(xml, '/alert/tab1/details', 'Channel2' ,xmltype('')).getclobval() xml from t
    
  • Problem with the CLOB data type.

    Greetings,

    I am facing a problem with the CLOB data type. I know that the CLOB data type is 4 GB (I use Oracle 9i). But in the Pl Sql procedure, I can only store 34305 size for a CLOB variable character data.

    This is the test script that I am trying to run.

    DECLARE
    -Local variables here*.
    I have INTEGER;
    C_1 CLOB.
    BEGIN
    FOR Rec IN (SELECT
    *
    ACCORDING TO THE TABLE)
    LOOP
    C_1: = c_1 | Rec.Clo_1;
    END LOOP;
    EXCEPTION
    WHILE OTHERS THEN
    Dbms_Output.put_line (SQLERRM);
    END;


    Here variable C_1 range value 34305 good character regardless of type CLOB. Now the above script fails if query my buckle - huge number of return values. It is throwing the exception "error during transfer of files ORA-06502: PL/SQL: digital error or value."

    He would be grateful if someone can help me on this.

    Thank you.

    You are probably better off using DBMS_LOB.append, instead of the concatenation of varchar2 (|).

    And... take off your when-other Manager exceptions, please...

  • Problem with the length of a CLOB data type

    Hello

    In my application, I have a page with an interactive report of written blogs - on this page, you can add a new blog (text box - CLOB data type), discovered a blog or edit a blog.
    There is something going wrong with the size of the blog text. I know APEX cannot accept that 32K text and I've seen the great value saving thread, but this isn't the solution to my problem.

    The problem is that when I add a blog with say about 4000 characters, it is saved in the database, but the interactive report, when I click on the view or edit icons for this blog, the blog text field appears empty. For small items (< 4000 characters), there is no problem.
    Anyone know why this is happening and how to fix this?
    Thank you!

    There seems to be a bug in the calculation of the value of the element Source when the Source Type is a SQL query and the data type of the selected column is CLOB. I'll file a bug for this. For now, I have demonstrated how you can use a type of function PL/SQL source instead. Please see point P3_TEXT:

    beginfor c1 in (select blog_textfrom blogwhere blog_id = :P3_BLOG_ID) loop  return c1.blog_text;end loop;return null;end;
    

    Scott

  • How to convert the date in milliseconds?

    Hi all

    Can I know how to convert the date in milliseconds?

    My current datetime like this Formate

    QDateTime::currentDateTime (m:System.NET.SocketAddress.ToString ("MMMM dd, yyyy HH"))

    Seconds since January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toTime_t

    Sinds milliseconds January 1, 1970

    http://Qt-project.org/doc/Qt-4.8/QDateTime.html#toMSecsSinceEpoch

  • VLD-2550 and 2551: CLOB data type errors

    Hi all

    I tried to solve thi sproblem, but have not been able to find a solution.
    Basically I have a Col1 (of A table) of the clob data type that is to be mapped to Col2 (table B).
    But when I validate the card I get the error:

    VLD-2550: BLOB, CLOB or NBLOB of the remote source data cannot be transformations (control Details: If you have any CLOB, BLOB as a remote data source, it must be directly mapped to a target feature)
    and
    VLD-2551: BLOB LCOB or NBLOB remote data source must be set based ON a SET of generation mode.

    My card has a mapping one between the passes of the tables A and B. Col1 is directly related to Col2 (if that is what is meant by any of the transformations of type CLOb)

    Thank you very much

    Hello

    If your source table (which the CLOB) is in the remote computer then you must set the mapping mode basic SET and you need to connect directly the source column of the target column.

    If you still get this kind of validation waring and simple not then ignore them.
    This is a defect of OWB. See Bug 5989066 : card VALIDATION WITH BLOB OBJECTS JETTÉ VLD-2550 AND VLD-2551 WARNINGS, which has yet to be fixed.

    Thank you
    Fati

  • How to handle the data type DECIMAL MySQL converted to DOUBLE in OBIEE 10 gR 3?

    Hi all

    I have a problem in OBIEE 10g to I use the MySQL database as datasource direct to the server of the OBI and I have a column in a MySQL table which was designed as the DECIMAL data type (18.0).
    This column is used to measure a length, and values are included in seconds (without decimals), in the form as:
    "1200"
    in the MySQL database.

    After the import of the MySQL table associated with the repository of the OBI, the OBIEE converts the DECIMAL data type column to the DOUBLE PRECISION data type automatically.

    My goal is to reach the values in this form, certainly in the sense of the term (not at the time!):
    hh mm ss

    In order to accomplish, I tried to change the format of column with the ROUND function:
    ROUND (db.table.column / * 3600 * 2)

    The problem is that it doesn't work well if values can be divided with no rest for example
    original value: 7200
    new value (ROUND): 2

    In the case of my example:
    original value: 1200
    new value (ROUND): 0
    It's false, because 1200 seconds are not equal to 0 hours, I want to see two hours of _0.33333_ OR I much prefer more _0 hour 20 m_

    Anyone have any ideas?
    I tried to make a view of database and importing that type of CHAR data in the database, but is not the solution too, because if I filter BI app or try to make a SUM the BI would drop errors...

    Kind regards
    Laszlo

    Hello
    SE refer to this link, it is exactly will meet your need.

    OBIEE 11 g - change seconds in the format hh: mm: DD
    OBIEE functions

    Share updates... :)

    check if useful/correct...

  • How to convert binary data NVARCHAR2?

    Hi all

    I have binary data in the database (RAW oracle data type). I know that these data contain string encoded in UTF8. Our database runs in WE8ISO8859P15 encoding, UTF8 national character set. Then I would just convert the binary data NVARCHAR2. How can I do?

    I found the UTL_RAW function. CAST_TO_NVARCHAR2. However, this function takes only binary data as a parameter, so I highly doubt that it will work as I hope without specification of source character set...

    Someone has an idea?

    UTL_I18N. RAW_TO_NCHAR ( , "AL32UTF8")

  • How to convert the timestamp in varchar2

    How to convert

    -timestamp

    TO_TIMESTAMP (' 29.01.2015 08:36:41 ','fmDDfm.fmMMfm.YYYY fmHH24fm:MI:SS') of double

    in

    -varchar2

    20150129083641

    Hello

    Maybe something like this:

    select to_char(to_date(substr(to_char(TO_TIMESTAMP('29.01.2015 08:36:41','fmDDfm.fmMMfm.YYYY fmHH24fm:MI:SS')),1,17), 'dd.mm.yy hh24:mi:ss'), 'yyyymmddhh24miss') from dual;
    

    But the question is: what do you do? Sorting? Or you have a (very) old data model with varchars or numbers to organize the date fields?

    concerning

    Kay

  • How to view clob data using sql

    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    user562223 wrote:
    Hello

    In our database we have a table that is to have a column of type CLOB but now I want to display the data using sql select query but it throws error: "unsupported data Type.

    Could someone let me know how to view the clob data using the select query.

    Oracle DB version: 10.2.0.3

    Thank you

    Usually a to_char (CLOBDFIELD) circled

    HTH,

    FJFranken

  • How to convert binary data from the Panel controls in ASCII values?

    Hello

    I seemed to face a roadblock with how to convert binary values in ascii.

    I created this .vi to save all control values in an .ini file and call them at that time where I will carry out the .vi as shown in the file attached. Registration key to simply save the data and Cancel button discards all current changes.

    I would like to understand how to retrieve all the values of control to ASCII, so I assign to a global variable for later use. I've looked everywhere for a good reference document, and I couldn't find one that would explain my question. I would be greatly appreciated if someone could point me in the right direction.

    Thank you

    Sam

    I tried a simple way to save control values in the front panel

    Not reinventing the wheel, when there are ready to use of solutions, for example:

    http://sine.NI.com/NIPs/CDs/view/p/lang/en/NID/209753

    Use the MGI save & restore settings VI of the palette (for example, it records all the settings that have been changed in a graph, which is very useful) and the MGI Save (restoration) Front Panel data live (to save and restore control values in the front panel).

    Here is an example:

Maybe you are looking for