Truncated Data and CLOBs

When I fetch data I'm trying to access some CLOBs as strings (i.e. when I define them I used SQLT_STR instead of SQLT_CLOB). The problem is that some of CLOBs are over 4000 bytes and 4000 is the size I get from OCI_ATTR_DATA_SIZE. Needless to say some columns get truncated (code 1406).
Now I can detect the truncated data but I can't seem to find a way to get it. Is there a way?
I don't want to but I suppose I could write routines to handle CLOB data using OCILobLocator but I haven't yet found a good example. The one example I have shows this:
OCIDefine* define;
OCILobLocator* lob;
OCIDescriptorAlloc(envhp, &lob, OCI_DTYPE_LOB, 0, 0);
OCIDefineByPos(stmthp, &define, errhp, index, &lob, -1, SQLT_CLOB, ind, len, code, OCI_DEFAULT);
/* later */
OCIStmtFetch2(stmthp, errhp, 100, OCI_FETCH_NEXT, OCI_DEFAULT);Now I'm used to passing arrays to OCIDefineByPos() but in this case I only see one OCILobLocator being allocated but 100 rows being fetched. From everything I know this should cause a major problem.
Am I right? Must you iterate through an array of OCILobLocator and initialize each one before passing it to OCIDefineByPos()?
For example:
int i;
OCILobLocator* lob[100];
for (i = 0; i < 100; i++)
  OCIDescriptorAlloc(envhp, &lob, OCI_DTYPE_LOB, 0, 0);

http://www.wireless.att.com/cell-phone-service/specials/iPhoneApps.jsp

Similar Messages

  • Need to truncate data and having some problems

    Hi folks.
    I'm relatively new to Java so forgive my naivety please.
    I have a situation where I'm receiving XML address data in the format of 4 address lines of 35 characters each......and a postcode. Unfortunately, I have to find a way of evaluating this data and shoe horning it in to 3 address lines of 30 characters each on the system I'm maintaining.
    If the combined data is still more than 3 lines of 30 characters I've just been told to send back an error response. Lovely system eh?
    Does anyone have any suggestions as to how I can tackle this problem in Java? I'm still looking about and having a think about it, but being new to the language I'm struggling a little.
    Any help you can offer would be much appreciated. Thanks.

    Axiom: A requirement isn't a requirement without a test case.
    Work with your customer to establish the acceptance tests for the requirements. That will help you with the "find a way of evaluating" part. Once you know the rules, you can start coding. We'll help you with the language translation issues (i.e., business-ese to Java), but it's up to you to make sure the requirements are firm and to write the initial failing test cases.
    ~

  • BLOB and CLOB data in BI Publisher

    Hello,
    I have an XML file with blob and clob data in it. I am using BI desktop publisher to load the xml file and create the rtf template. I am getting the following error:
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: C:\work\employee.rtf
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\work\employee.xml
    FOProcessor setLocale: en-us
    Do i need to install anything or am i missing any configuration to read the blob and clob? Please advise
    thanks

    Check this out, hopefully it'll help you
    http://oraclebizint.wordpress.com/2007/11/12/oracle-bi-ee-101332-working-with-clob-fields/
    Fiston

  • Retrieving data from a relational table and CLOB as a whole XML file

    I created the table lob_example and I have managed to insert XML document into it using XML SQL Utility. In this document I put contents of <DESCRIPTION> tag into CDATA section.
    LOB_EXAMPLE
    Name Null? Type
    ID NOT NULL NUMBER
    DESCRIPTION CLOB
    NAME VARCHAR2(40)
    But I could not retrieve this data properly. I can think of only one solution - to parse and build the whole XMLDocument. I found the suggestion of another solution to use Oracle8i views to do that in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm, but this text is not clear enough for me.
    I would like to quote the fragment from document mentioned above, which is ambiguous for me:
    "Combining XML Documents and Data Using Views
    Finally, if you have a combination of structured and unstructured XML data, but still want to view and operate on it as a whole, you can use Oracle8i views. Views enable you to construct an object on the "fly" by combining XML data stored in a variety of ways. So, you can store structured data (such as employee data, customer data, and so on) in one location within object -relational tables, and store related unstructured data (such as descriptions and comments) within a CLOB. When you need to retrieve the data as a whole, you simply construct the structure from the various pieces of data with the use of type constructors in the view's select statement. The XML SQL Utility then enables retrieving the constructed data from the view as a single XML document."
    The main question is - how to use type constructors in the view's select statement?

    Hello
    Sorry for asking the same question again, but any responses would be greatly appreciated.
    How to use type constructors in the view's select statement?
    I could not find any answers for this question on Technet. Maybe the other approaches are more efficient to combine the part of data from CLOB with data from other column types?
    Thank you

  • Storing XML data in CLOB and relational tables

    I would like to ask whether there is a possibility to store XML data using normal relational tables and CLOBs in the same time. For example I have some XML data (structured data) which I would like update very often and some which are only a kind of description. I found something about it in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm . But I do not know how to use Oracle8i views and some functionality of XML SQL Utility to retrieve XML data in one file.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Maciej Marczukajtis ([email protected]):
    I would like to ask whether there is a possibility to store XML data using normal relational tables and CLOBs in the same time. For example I have some XML data (structured data) which I would like update very often and some which are only a kind of description. I found something about it in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm . But I do not know how to use Oracle8i views and some functionality of XML SQL Utility to retrieve XML data in one file.<HR></BLOCKQUOTE>
    Czesc Maciek,
    There are some good examples with XSQL Servlet. From what I understand you have one XML file and you need to save a portion of document in relational tables and other portion in CLOB.
    Yes, you can do that.
    You can do it many ways. I can suggest (2).
    1. Use the views
    2. call your java procedure that will do
    the xml processing, brake it down and insert
    releval frogments into different tables/columns
    null

  • Error: 0xC020902A at Data Flow Task, XML Source [24515]: The "component "XML Source" (24515)" failed because truncation occurred, and the truncation row disposition on "output column "MsgLev1" (26196)" specifies failure on truncation. A truncation error o

    When I was Importing data from XML to SqlServer using SSIS , I am getting this error. The import is working if i use small file and not working if I use large XMl file. Can any one of you guys help me out with the issue?
    Error: 0xC020902A at Data Flow Task, XML Source [24515]: The "component "XML Source" (24515)" failed because truncation occurred, and the truncation row disposition on "output column "MsgLev1" (26196)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
    Error: 0xC02092AF at Data Flow Task, XML Source [24515]: The component "XML Source" (24515) was unable to process the XML data. Pipeline component has returned HRESULT error code 0xC020902A from a method call.
    Error: 0xC0047038 at Data Flow Task: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED.  The PrimeOutput method on component "XML Source" (24515) returned error code 0xC02092AF.  The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.  There may be error messages posted before this with more information about the failure.
    Error: 0xC0047021 at Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "SourceThread0" has exited with error code 0xC0047038.  There may be error messages posted before this with more information on why the thread has exited.
    Error: 0xC0047039 at Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
    Error: 0xC0047039 at Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread1" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
    Error: 0xC0047039 at Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread3" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
    Error: 0xC0047039 at Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread4" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
    Error: 0xC0047039 at Data Flow Task: SSIS Error Code DTS_E_THREADCANCELLED.  Thread "WorkThread2" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.  There may be error messages posted before this with more information on why the thread was cancelled.
    Error: 0xC0047021 at Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread0" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.
    Error: 0xC0047021 at Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread1" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.
    Error: 0xC0047021 at Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread2" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.
    Error: 0xC0047021 at Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread3" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.
    Error: 0xC0047021 at Data Flow Task: SSIS Error Code DTS_E_THREADFAILED.  Thread "WorkThread4" has exited with error code 0xC0047039.  There may be error messages posted before this with more information on why the thread has exited.

    The reason is in the first line of the error.  It doesn't have anything to do with the size of your XML file - it has to do with the contents of the "MsgLev1" column.  You (or the XSD) has indicated that the values in this column not exceed a certain size - but one of the values in the file that's failing is larger than that.
    In order to fix the problem, you're going to need to increase the allocated space for that column.  In order to do that, you're going to need to find out what the required size of that data is - either from someone who ought to know, or by direct examination of the file.  If you want to know which entity has this overly large data element in it, you need to configure the error handling of the XML Source to "redirect truncation errors".  Then you can hook up the XML Source's error output to another destination where you can see which rows are problematic.
    Talk to me on

  • Adding one day to a oracle.jbo.domain.Date and truncating the time part

    JDev 11.1.1.4.0
    Hello
    I need to add a day to oracle.jbo.domain.Date and get back a oracle.jbo.domain.Date without the time part.
    So far I've got
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    Date newDate = new oracle.jbo.domain.Date(new Timestamp(cal.getTime().getTime()));This adds 1 day to the date but keeps the time part of the date.
    How do I get rid of the time part of the date ?
    Thanks
    Paul

    The Calendar class allows you to set or clear each field.
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    cal.clear(Calendar.HOUR);
    cal.clear(Calendar.MINUTE);
    cal.clear(Calendar.SECOND);
    cal.clear(Calendar.MILLISECOND);
    Date newDate = new oracle.jbo.domain.Date(cal.getTimeInMillis());should work.
    Timo

  • Passing XML in CLOB and processing data from CLOB

    Hi All,
    I am facing problem when trying to access xml data from CLOB.
    My stored procedure is as below:
    CREATE OR REPLACE PROCEDURE usp_XMLTEST2
    in_XmlDoc IN CLOB
    IS
    BEGIN
    UPDATE XML_TEST
    SET SETFLAG='N'
    WHERE (ITEMCODE,WAREHOUSE) IN
    SELECT
    TO_NUMBER(EXTRACT(COLUMN_VALUE,'//Entry/@ItemCode')) ,
    TO_NUMBER(EXTRACT(COLUMN_VALUE,'//Entry/@Warehouse'))
    FROM TABLE(XMLSEQUENCE( EXTRACT(XMLTYPE(in_XmlDoc), '//List/*' )))
    END usp_XMLTEST2;
    Exec usp_XMLTEST2('<List Daemon="2"><Entry ItemCode="112333" Warehouse="4101" /><Entry ItemCode="112333" Warehouse="4103" /></List>');
    It gives error:
    ERROR at line 1:
    ORA-22905: cannot access rows from a non-nested table item
    ORA-06512: at "PUBLIX.USP_XMLTEST2", line 8
    ORA-06512: at line 1
    Please devise solution to this problem.
    Regards
    Nitin Bajaj

    Try casting it:
    SELECT TO_NUMBER(EXTRACT(COLUMN_VALUE,'//Entry/@ItemCode'))
    TO_NUMBER(EXTRACT(COLUMN_VALUE,'//Entry/@Warehouse'))
    FROM TABLE(cast( XMLSEQUENCE( EXTRACT(XMLTYPE(in_XmlDoc), '//List/*' )) as XMLSequenceType ) )
    Anton

  • Print a report on doc format truncate data

    hi
    I have a report launching with a form in an oracle applications, when I print a report on pdf format looks ok
    but when I print the same report on doc format truncate data on left and right side.
    Can you help me
    thanks

    Hi Herbe
    Reports does not support .doc format. Are you referring .rtf format?
    In any case, you must contact Oracle Support to get the issue resolved.
    Regards
    Sripathy

  • Error reading data from CLOB column into VARCHAR2 variable

    Hi all,
    Am hitting an issue retrieving data > 8K (minus 1) stored in a CLOB column into a VARCHAR2 variable in PL/SQL...
    The "problem to be solved" here is storing DDL, in this case a "CREATE VIEW" statement, that is longer than 8K for later retrieval (and execution) using dynamic SQL. Given that the EXECUTE IMMEDIATE statement can take a VARCHAR2 variable (up to 32K(-1)), this should suffice for our needs, however, it seems that somewhere in the process of converting this VARCHAR2 text to a CLOB for storage, and then retrieving the CLOB and attempting to put it back into a VARCHAR2 variable, it is throwing a standard ORA-06502 exception ("PL/SQL: numeric or value error"). Consider the following code:
    set serveroutput on
    drop table test1;
    create table test1(col1 CLOB);
    declare
    cursor c1 is select col1 from test1;
    myvar VARCHAR2(32000);
    begin
    myvar := '';
    for i in 1..8192 loop
    myvar := myvar || 'a';
    end loop;
    INSERT INTO test1 (col1) VALUES (myvar);
    for arec in c1 loop
    begin
    myvar := arec.col1;
    dbms_output.put_line('Read data of length ' || length(myvar));
    exception when others then
    dbms_output.put_line('Error reading data: ' || sqlerrm);
    end;
    end loop;
    end;
    If you change the loop upper bound to 8191, all works fine. I'm guessing this might have something to do with the database character set -- we've recently converted our databases over to UTF-8, for Internationalizion support, and that seems to have changed underlying assumptions regarding character processing...?
    As far as the dynamic SQL issue goes, we can probably use the DBMS_SQL interface instead, with it's EXECUTE procedure that takes a PL/SQL array of varchar2(32K) - the only issue there is reading the data from the CLOB column, and then breaking that data into an array but that doesn't seem insurmountable. But this same basic issue (when a 9K text block, let's say, turns into a >32K block after being CLOBberred) seems to comes up in other text-processing situations also, so any ideas for how to resolve would be much appreciated.
    Thanks for any tips/hints/ideas...
    Jim

    For those curious about this, here's the word from Oracle support (courtesy of Metalinks):
    RESEARCH
    ========
    Test the issue for different DB version and different characterset.
    --Testing the following PL/SQL blocks by using direct assignment method(myvar := arec.col1;) on
    different database version and different characterset.
    SQL>create table test1(col1 CLOB);
    --Inserting four CLOB data into test1.
    declare
    myvar VARCHAR2(32767);
    begin
    myvar := RPAD('a',4000);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('a',8191);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('b',8192);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('c',32767);
    INSERT INTO test1 (col1) VALUES (myvar);
    commit;
    end;
    --Testing the direct assignment method.
    declare
    cursor c1 is select col1, length(col1) len1 from test1;
    myvar VARCHAR2(32767);
    begin
    for arec in c1 loop
    myvar := arec.col1;
    --DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar);
    dbms_output.put_line('Read data of length: ' || length(myvar));
    end loop;
    end;
    The following are the summary of the test results:
    ===================================
    1. If the database characterset is WE8ISO8859P1, then the above direct assignment
    method(myvar := arec.col1;) works for database version 9i/10g/11g without any
    errors.
    2. If the database characterset is UTF8 or AL32UTF8, then the above direct assignment method(myvar := arec.col1;) will generate the "ORA-06502:
    PL/SQL: numeric or value error" when the length of the CLOB data is greater
    than 8191(=8K-1). The same error can be reproduced across all database versions
    9i/10g/11g.
    3. Using DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar) method to read CLOB data into a VARCHAR2 variable works for both WE8ISO8859P1 and UTF8
    characterset and for all database versions.
    So - it seems as I'd surmised, UTF8 changes the way VARCHAR2 and CLOB data is handled. Not too surprising, I suppose - may you all be lucky enough to be able to stay away from this sort of issue. But - the DBMS_LOB.READ workaround is certainly sufficient for the text processing situations we find ourselves in currently.
    Cheers,
    Jim C.

  • I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me..

    I need to pass a query in form of string to DBMS_XMLQUERY.GETXML package...the parameters to the query are date and varchar ..please help me build the string .Below is the query and the out put. ( the string is building fine except the parameters are with out quotes)
    here is the procedure
    create or replace
    procedure temp(
        P_MTR_ID VARCHAR2,
        P_FROM_DATE    IN DATE ,
        P_THROUGH_DATE IN DATE ) AS
        L_XML CLOB;
        l_query VARCHAR2(2000);
    BEGIN
    l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
       ' AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ',''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = '
        ||P_MTR_ID||
        ' AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE('
        ||P_FROM_DATE||
        ',''DD-MON-YY'') AND (TO_DATE('
        ||P_THROUGH_DATE||
        ','' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
    SELECT DBMS_XMLQUERY.GETXML('L_QUERY') INTO L_XML   FROM DUAL;
    INSERT INTO NK VALUES (L_XML);
    DBMS_OUTPUT.PUT_LINE('L_QUERY IS :'||L_QUERY);
    END;
    OUTPUT parameters are in bold (the issue is they are coming without single quotes otherwise th equery is fine
    L_QUERY IS :SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),'9999999.000') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),'$9,999,999.00') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),'9999999.000') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,'mm/dd/yyyy') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,'hh24:mi'), '00:00','24:00', TO_CHAR(s_datetime+.000011574,'hh24:mi')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '1'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,'DD-MON-YY') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = N3165 AND s_mtrch   = '2'
        AND s_datetime BETWEEN TO_DATE(01-JAN-13,'DD-MON-YY') AND (TO_DATE(31-JAN-13,' DD-MON-YY') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)

    The correct way to handle this is to use bind variables.
    And use DBMS_XMLGEN instead of DBMS_XMLQUERY :
    create or replace procedure temp (
      p_mtr_id       in varchar2
    , p_from_date    in date
    , p_through_date in date
    is
      l_xml   CLOB;
      l_query VARCHAR2(2000);
      l_ctx   dbms_xmlgen.ctxHandle;
    begin
      l_query:=  'SELECT
        a.s_datetime DATETIME,
        a.downdate Ending_date,
        a.downtime Ending_time,
        TO_CHAR(ROUND(a.downusage,3),''9999999.000'') kWh_Usage,
        TO_CHAR(ROUND(a.downcost,2),''$9,999,999.00'') kWh_cost,
        TO_CHAR(ROUND(B.DOWNUSAGE,3),''9999999.000'') KVARH
      FROM
        (SELECT s_datetime + .000011574 s_datetime,
          TO_CHAR(S_DATETIME ,''mm/dd/yyyy'') DOWNDATE,
          DECODE(TO_CHAR(s_datetime+.000011574 ,''hh24:'
          ||'mi''), ''00:'
          ||'00'',''24:'
          ||'00'', TO_CHAR(s_datetime+.000011574,''hh24:'
          ||'mi'')) downtime,
          s_usage downusage,
          s_cost downcost
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''1''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,''DD-MON-YY'') + 1)
        ) a,
        (SELECT s_datetime + .000011574 s_datetime,
          s_usage downusage
        FROM summary_qtrhour
        WHERE s_mtrid = :P_MTR_ID
        AND s_mtrch   = ''2''
        AND s_datetime BETWEEN TO_DATE(:P_FROM_DATE,''DD-MON-YY'')
                           AND (TO_DATE(:P_THROUGH_DATE,'' DD-MON-YY'') + 1)
        ) B
      where a.S_DATETIME = B.S_DATETIME(+)';
      l_ctx := dbms_xmlgen.newContext(l_query);
      dbms_xmlgen.setBindValue(l_ctx, 'P_MTR_ID', p_mtr_id);
      dbms_xmlgen.setBindValue(l_ctx, 'P_FROM_DATE', to_char(p_from_date, 'DD-MON-YY'));
      dbms_xmlgen.setBindValue(l_ctx, 'P_THROUGH_DATE', to_char(p_through_date, 'DD-MON-YY'));
      l_xml := dbms_xmlgen.getXML(l_ctx);
      dbms_xmlgen.closeContext(l_ctx);
      insert into nk values (l_xml);
    end;

  • Date and Time on Menu Bar

    Up until now the date and time has been displayed on the menu bar as...
    Tuesday, November 28, 2006 8:09 AM
    Now, for some reason, it's being displayed as...
    Tue 8:09 AM
    Here's what I've tried in trying to restore the format...
    1) System Preferences > Menu Bar Clock > Show Date and Time in Menu Bar
    2) Deleted the following preference files:
    com.apple.MenuBarClock.plist
    com.apple.systempreferences.plist
    com.apple.systemuiserver.plist
    Does anyone know how I can restore the format?
    Thanks!
    eMac   Mac OS X (10.2.x)   128 MB, 700 MHz PowerPC G4

    It looks like there can be as little
    as 6 or so characters between the two sets of
    icons
    That sounds low, especially in
    the Finder, even at the lower screen resolutions. I
    just played with stepping down resolutions on this
    Mac, and various right-side icons (the CoreServices
    eject.menu, Display, Classic, and sound icons, plus
    those from MenuMeters) disappeared
    before the date and time (shown as "Tue 28 Nov, 04:00
    PM" were affected (right-side menu items are
    truncated from left to right).
    In my case, just the date disappeared. So instead of seeing...
    Tue November 28, 2006 5:43 PM
    ...I was seeing...
    Tue 5:43 PM
    The icons to the left (on the right side icons) were still there and unaffected.
    What Display
    resolution do you normally use?
    It's set at 1024 X 768.
    Does the time&date
    format go back to the expected form if you increase
    resolution to maximum as a test? If the format
    affected by starting up in Safe Mode?
    After trying the remedy you reference in your previous post, the format is back to where it was so I won't be able to test it. But I guess you suspect that the Date and Time was truncated because there wasn't enough space between the left side and right side icons, is this right? It would seem like a logical explanation...

  • Error while loading data into clob data type.

    Hi,
    I have created interface to load data from oracle table into oracle table.In target table we have attribute with clob data type. while loading data into clob field ODI gave below error. I use odi 10.1.3.6.0
    java.lang.NumberFormatException: For input string: "4294967295"
         at java.lang.NumberFormatException.forInputString(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
         at java.lang.Integer.parseInt(Unknown Source)
    Let me know if anyone come across and resolved this kind of issue.
    Thanks much,
    Nishit Gajjar

    Mr. Gajjar,
    You didnt mention what KMs you are using ?
    have a read of
    Re: Facing issues while using BLOB
    and
    Load BLOB column in Oracle to Image column in MS SQL Server
    Try again.
    And can you please mark the Correct/Helpful points to the answers too.
    Edited by: actdi on Jan 10, 2012 10:45 AM

  • Display BLOB and CLOB on browser

    Hi All.
    I need to display contents of BLOBs and CLOBs on the browser. They can be any docFlavour eg. .jpg, .gif, .pdf, .doc etc
    Is there some standard way of doing this ???
    If any all possible I would rather not use swing class because of its footprint and its slow performance over the net.

    Hi !
    Just in case anyone read this and is willing to comment on it...
    I have one BLOB and one CLOB column in the same record.
    I have been able to stream documents into and out of the BLOB's incl. MS .doc Also I have been able to get the content from BLOB and write it to a target directory.
    However I am having odd problems with CLOB, a simple text file. My servlet attempts to read the CLOB and does create the output file in the target directory, but does not copy the content over. It also returns 0 for clobLength !?! Here is the stub-code :
    ResultSet clobRS = thisStmt.executeQuery (
    "SELECT ATextMsg " +
    "FROM ... " +
    "WHERE ... " );
    clobRS.next();
    CLOB thisCLOB = ((OracleResultSet) clobRS).getCLOB("ATextMsg");
    int chunkSize = thisClob.getChunkSize();
    System.out.println("chunkSize is " + chunkSize); // default us 8132...
    char [] textBuffer = new char[chunkSize];
    String targetFile = targetDir + "retrieved_" + fileName;
    File thisFile = new File(targetFile); // it does create an empty target file...
    // read content as ASCII (text) content...
    FileOutputStream thisFileOutputStream = new FileOutputStream(thisFile);
    OutputStreamWriter thisWriter = new OutputStreamWriter(thisFileOutputStream);
    BufferedWriter thisBufferedWriter = new BufferedWriter(thisWriter);
    // things go wrong here, returns length of 0, why ?!?
    long clobLength = thisClob.length();
    System.out.println("clobLength is " + clobLength);
    // flush to targetFile - but since clobLength=0, nothing gets copied over...
    for (position=1; position<=clobLength; position+=chunkSize)
    int charsRead = thisClob.getChars(position, chunkSize, textBuffer);
    thisBufferedWriter.write(testBuffer);
    Since the clobLength is 0, obviously it will not copy from the database CLOB to the file.
    Manually change the clobLength = 8132, recompile and run, then it copies some junk to the targetFile, certainly not the textual data in the CLOB itself.
    The BLOB is fine...
    Can someone comment on this please and if possible, give me a hint on where I might have gone wrong with a simple text file ???

  • BC4J, Triggers, and Clobs

    I'm on a J2EE web-application that is using the BC4J framework. At one point, we're taking some information from a form and saving that info into a table (composed of a couple varchar columns and a couple of CLOB columns). There are two triggers associated with this table, one that fires before insert that grabs a seq number as well as a date, and another that fires after insert that calls a PL/SQL procedure that creates a txt file on our filesystem with the appropriate info. The text file, however, does not contain the information from the CLOB fields. When inserting a new record from SQL*PLUS, the text file is created correctly, meaning the triggers work fine, the insert works fine, the writing to the file system works fine. So, what's the difference between inserting from SQL*PLUS and inserting through the web application?
    To test a theory, I removed the trigger and put the call to the PL/SQL procedure into a callablestatement in one of the actions. This actually led to a correct writing to the file system. This solution, however, is unacceptable due to some legacy issues.
    So, how is BC4J treating the insert of CLOB's? Does it issue an insert statement that only puts in the non-CLOB columns and then updates the table with the CLOBs? Or is the something else that I'm missing?
    Any help would be greatly appreciated.
    -chris

    In BC4J, CLOB fields are updated after the row is inserted and an empty CLOB locator has been created in the db. So you may also want to update your textfile trigger to apply on update of the clob field.

Maybe you are looking for