Failed to convert Clob to String by using dbms_lob.substr

it says that the cache is not enough to do this.
I would like to get some infos from two tables as a View.
and one of the table contains a Clob data which is large
than 4k i think.
and when I tried to create the view, it says that expecting
- but got Clob, so I would like to change it to String by using
dbmas_lob.substr function and met the cache limited problem.
The database I am using is 10.2.0.1.0.

Thanks for reply.
and the problem was fixed.
after I removed 'distinct', which specified after 'select'.

Similar Messages

  • Convert clob to string?

    hi all,
    i'm having a problem getting the returnvalue of a storedproc. i'm using oracle database and created an oracle function that returns a clob data. unfortunately in vb.net, it won't accept clob format. if i change the returnvalue to varchar2 format it works fine.
    is there a way to convert clob into string?
    thanks.
    p.s.
    i'm using clob datatype because i need to return a large amount of characters (basically DDL statements like Creating tables with about a hundred partition more or less, also for creating a view with a very large text).

    It should be possible since Value is a string type property. Say if your OracleClob object name is clob1 then it should be possible to write something like -
    string str = clob1.Value;//C# syntax
    If you are using OracleParameter's Value property then you will have to do ".Value" twice as shown below -
    OracleParameter paramHavingClobInIt;
    string str = (paramHavingClobInIt.Value as OracleClob).Value; //C# syntax

  • Error while converting CLOB to varchar using DBMS_LOB.SUBSTR() in Oracle11g

    Hi
    Whenever I am using DBMS_LOB.SUBSTR(columnname,4000,1) package for a clob column in a simple Select Query, the following error is thrown for Oracle 11g version.
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 1.
    Please find the installation details of the database and the character set
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE     11.2.0.1.0     Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    PARAMETER VALUE
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CURRENCY $
    NLS_ISO_CURRENCY AMERICA
    NLS_NUMERIC_CHARACTERS .,
    NLS_CHARACTERSET AL32UTF8
    NLS_CALENDAR GREGORIAN
    NLS_DATE_FORMAT DD-MON-RR
    NLS_DATE_LANGUAGE AMERICAN
    NLS_SORT BINARY
    NLS_TIME_FORMAT HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY $
    NLS_COMP BINARY
    NLS_LENGTH_SEMANTICS BYTE
    NLS_NCHAR_CONV_EXCP FALSE
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_RDBMS_VERSION 11.2.0.1.0
    It is working fine if I reduce from 4000 to 3500 . But I want to use 4000.
    Please let me know if any solution

    you are using a multibyte character set:
    NLS_CHARACTERSET AL32UTF8
    so each character takes between 1 and 4 bytes of storage.
    a varchar2(4000) column can only hold 4000 BYTES. Regardless of the character set - varchar2 is limited to 4000 bytes.
    In a single byte character set, that is 4000 characters as a character = a byte
    In your character set, a varchar2(4000) can hold somewhere between 1000 and 4000 characters - depending on what the characters are.
    So, you must have some CLOB whose first 4000 characters include at least one "more than one byte" character. That won't fit into a varchar2(4000)
    Your approach of backing off the substr size is reasonable (and you'll need to remember that in your application - end users can type in as little as 1000 characters and get an error about the column being too small!) as it reduces the number of BYTES to be belong 4000.

  • Makepkg fails if upper case md5 strings are used.

    makepkg fails if upper case md5 strings are used. For example
    9e107d9d372bb6826bd81d3542a419d6
    and
    9E107D9D372BB6826BD81D3542A419D6
    for makepkg are not the same thing. Is it a feature or a bug?

    shining wrote:Thanks for reporting the bug : http://bugs.archlinux.org/task/11283
    Please test the patch
    Thanks you.

  • Any way to convert CLOB to string in DB2?

    I'm trying to provide report names in audit reports.
    Is there any way to convert CLOB (AUDIT_DETAL.DETAIL_TEXT) to string?
    We use BO XI R3 on DB2 v.9.
    Thank you.

    949767 wrote:
    Is there any way to convert PDF document in to Tiff format with inbuilt IBR features?
    In our Webcenter Portal app, we create the PDF document with the content of ADF pages and check it in UCM using RIDC api.
    There will some batch job which will retrieve the documents from UCM and send them to client internal Document management system. The client / batch job will only process TIFF files. So we need a way to convert the PDF into TIFF. We are okie to have both PDF and TIFF stored in UCM.
    When i have done research, i could only see components like PDFexport or TIFFConverter which only converts the other formats into PDF. But i am expecting a reverse conversion. Is it possible ? ThanksYa actually I got a tool that could [convert pdf | http://www.allbestapp.com/products/pdf-converter.html] to other formats, including jpg and tiff. that may fit your need.
    You could take a shot through the link above.
    Edited by: user13548958 on 2012-8-23 上午10:49
    Edited by: user13548958 on 2012-8-23 上午10:52

  • Loading Clob and Blob data using DBMS_LOB

    I am loading some data into a table that has five columns, two of which are defined as BLOB and CLOB respectively. I get the following errors after the pl/sql procedure that loads it has completed running :
    ERROR:ORA-21560: argument 3 is null,
    invalid, or out of range
    ERROR:ORA-22297: warning: Open LOBs exist
    at transaction commit time.
    The following is the outline of the code that loads the table:
    CREATE OR REPLACE PROCEDURE load_data(dir,seq_val,file_name,
    details, etc <== all these are passed in) IS
    dest_loc BLOB;
    src_loc BFILE;
    Amount INTEGER;
    new_dir string(1000);
    new_file string(1000);
    BEGIN
    new_dir := ''||dir||'';
    new_file := ''||file_name||'';
    src_loc := BFileName(new_dir,new_file);
    Amount := dbms_lob.getlength(src_loc);
    insert into table A
    (id
    ,ver
    ,ver
    ,fil_nm <== This field is a BLOB
    ,details <== This Field is a CLOB
    values
    (seq_val
    ,1
    ,version
    ,empty_blob()
    ,detailed_infor
    --dbms_output.put_line(Amount);
    SELECT fil_nm INTO dest_loc FROM table A WHERE id = seq_val FOR UPDATE;
    /* Opening the LOB is mandatory: */
    --dbms_output.put_line('IN SELECT...');
    DBMS_LOB.OPEN(src_loc, DBMS_LOB.LOB_READONLY);
    /* Opening the LOB is optional: */
    DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(dest_loc, src_loc, Amount);
    /* Closing the LOB is mandatory if you have opened it: */
    DBMS_LOB.CLOSE(dest_loc);
    DBMS_LOB.CLOSE(src_loc);
    --dbms_output.put_line('After SELECT...');
    COMMIT;
    END
    Any feedback would be really appreciated. Thanks.

    I assume thats when the ORA-21560: argument 3 is null, invalid, or out of range error occurs. I'm also wondering why and what the other error means saying LOBs are open during transaction commit time. The data is coming from an xml file that is in the following format.
    - <NAME>
    <FIL_NM>TEST.PDF</FIL_NM>
    <VER>2</VER>
    <DETAILS>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyzzzzzzzzzmmmmmmsusssuitttttretc</DETAILS>
    </REPORT>
    <NAME/>
    So what this procedure is doing is opening the pdf and loading the data into the BLOB. I just can't understand what is causing those errors.

  • Convert CLOB to LONG

    I have an app that has a CLOB column in a table. The reporting software, which is separate from the application, cannot read CLOBs. So the solution that was revealed to me was to setup a trigger to copy any data going into the CLOB table to another table where the column is a LONG.
    Of course, no DBA in their right mind would be happy with this. So, I'm trying to set about creating a view that will convert the CLOB to a LONG, so as to relieve my poor SAN from all the I/O. There is no TO_LONG function, nor can I find anywhere how to do this.
    Anyone feel like taking a stab at this?

    Tom,
    My guess is you might have to use dbms_lob.substr subprogram. Anyway, LONG datatype has a limit of 2gb while clob or blob can be bigger (theoritically upto 8TB ). So, you have to decide if you wanna truncate your data and store only the first 2gb. Also, just for information purposes, this is what Oracle says in documentation.
    ----------ORACLE DOCUMENTATION------
    Note:
    Do not create tables with LONG columns. Use LOB columns (CLOB, NCLOB) instead. LONG columns are supported only for backward compatibility.
    Oracle also recommends that you convert existing LONG columns to LOB columns. LOB columns are subject to far fewer restrictions than LONG columns. Further, LOB functionality is enhanced in every release, whereas LONG functionality has been static for several releases.
    HTH,
    Rahul.

  • Convert clob to blob

    Anyone know an easy way to convert clob data to blob data?
    We upgraded a client to 8.1.7.2 and now we can no longer store MS-Word templates to the RDBMS.
    I deduce this is because MS-Word templates are binary files.
    Earlier versions of 8.1.7 and 8.1.6 allowed us to do this. However, this is no longer the case.
    Some of my clob rows are over 6 meg.
    I have written some PL/SQL code to basically retrieve the clob data in cursor, loops through the clob in 32767 blocks,
    performing dbms_lob.substr, converts that data to hex(major pain), & then write the blocks using dbmbs_lob.write.
    I keep getting the proverbial "ORA-06502: PL/SQL: numeric or value error: invalid LOB locator specified: ORA-22275".
    Does anyone see flaws in my approach and might have an easier solution?
    Thanks!

    Here's my code:
    REATE OR REPLACE
    PROCEDURE p_load_clob_to_blob IS
    * Name:           p_load_clob_to_blob
    * Parameters: None
    * Purpose: This procedure loads the narr_blob column in the narr table_text with clob data from the
    * narr column.
    * Notes: This procedure assumes that narr table has been altered with narr_blob column added.
    * See the SQL below:
    *               alter table narr_text add (narr_blob blob);
    * Once this procedure executes, the table must altered to drop the narr_text clob column,
    * recreate the narr_text as blob, & then repopulate narr_text. See the SQL below:
    *                     alter table narr_text drop column narr;
    *                    alter table narr_text add (narr blob);
    *                    update narr_text set narr = narr_blob;
    *                    commit;
    * Called By: Sys Admin
    * CHANGE LOG
    * Changed By Date Change Description
    * EAO          01/16/02 Created.
    rec_read      INTEGER;
    rec_update      INTEGER;
    write_cnt INTEGER;
    write_amount BINARY_INTEGER;
    write_offset INTEGER;
    write_loop INTEGER;
    total_length      NUMBER;
    total_written      NUMBER;
    buffer VARCHAR2(32767);
    bbuffer RAW(32767);
    temp_narr_id NUMBER;
    max_loop               INTEGER;
    cx                    CLOB;
    bx                    BLOB;
    bx2                    BLOB;
    cur_evt               varchar2(50); -- current event
    v_err_descr          varchar2(256);
    i INTEGER;
    hex                    varchar(32767);
    CURSOR c_load_narr_clob IS
         SELECT narr, narr_id
         FROM narr_text
         where narr_id = 6366;
    BEGIN
    insert_event_log('', 'p_load_clob_to_blob', '', '', '', 'p_load_clob_to_blob started', '');
    rec_read := 0;
    rec_update := 0;
    ---Fill file
    insert_event_log('', 'p_load_clob_to_blob ','c_load_narr_clob ', '', 'S', 'c_narr_clob started', '');
    FOR csr IN c_load_narr_clob LOOP      
         cur_evt := 'Select narr from narr table: ';
         rec_read := rec_read + 1;
         write_loop := 1;
         write_cnt := 0;
         write_offset := 1;           
         total_written := 0;     
         cx := csr.narr;
    bx := empty_blob();          
         total_length := DBMS_LOB.GETLENGTH(cx);
         max_loop := (total_length / 32767) + 1;
         if (total_length <= 32767) THEN
              write_amount := total_length;
         ELSE
              write_amount := 32767;
         END IF;
    dbms_output.put_line('Length=' || to_char(total_length) || ' Max loop=' || to_char(max_loop) || ' Write Amount=' || to_char(write_amount));
         temp_narr_id := csr.narr_id;
         while write_cnt < max_loop
         loop
    --FOR write_loop in 1..max_loop LOOP
              delete temp_blob;
              delete temp_raw;
              commit;
              cur_evt := 'Dbms_lob.substr: ';
              dbms_output.put_line(cur_evt);
    buffer := DBMS_LOB.SUBSTR(cx, write_amount, write_offset);
              dbms_output.put_line('Write Amount='|| to_char(write_amount) || ' Write Offset=' || to_char(write_offset) );
    cur_evt := 'Hex to Raw Assigment: ';
              dbms_output.put_line(cur_evt);
              bbuffer := null;
              for i in 1..write_amount loop
                   hex := numtohex(ascii(substrb(buffer,i,1)));
                   bbuffer := bbuffer || hextoraw(hex);
              end loop;
    cur_evt := 'Insert temp_raw: ';
              dbms_output.put_line(cur_evt);
              insert into temp_raw(rx)
                   values (bbuffer);
              commit;
    cur_evt := 'Insert temp_blob: ';
              dbms_output.put_line(cur_evt);
              execute immediate 'insert into temp_blob(bx)
                   select TO_LOB(rx) from temp_raw';
              commit;
              cur_evt := 'Select bx2: ';
              dbms_output.put_line(cur_evt);
              bx2 := empty_blob();
              select bx into bx2 from temp_blob;
              cur_evt := 'Dbms_lob.append: ';
              dbms_output.put_line(cur_evt);
              dbms_lob.append(bx, bx2);
         dbms_output.put_line('Write Amount='|| to_char(write_amount) || ' Write Offset=' || to_char(write_offset) );
              write_offset := write_offset + write_amount;
              total_written := total_written + write_amount;
              write_cnt := write_cnt + 1;
              if (write_cnt = max_loop) then
              write_amount := total_length - total_written;
              end if;
    END LOOP;
    dbms_output.put_line('Total_written = ' || to_char(total_written) );
         cur_evt := 'Upd narr_blob in narr table: ';
         update narr_text
         set narr_blob = bx
         where narr_id = temp_narr_id;
         rec_update := rec_update + 1;
         commit;
    END LOOP;
    insert_event_log('', 'p_load_clob_to_blob ','c_load_narr_clob ', '', 'C', 'c_narr_clob completed', '');
    dbms_output.put_line('Records read=' || to_char(rec_read) || ' Records updated=' || to_char(rec_update) );
    insert_event_log('', 'p_load_clob_to_blob', '', '', '', 'p_load_clob_to_blob ended', '');
    EXCEPTION
         WHEN OTHERS THEN
         Rollback;
         v_err_descr := 'FATAL ERROR OCCURRED -'||cur_evt||sqlerrm;
         dbms_output.put_line (v_err_descr);
    END;
    FUNCTION numtohex(v_hex number) return varchar2
    is
    hex varchar2(4);
    num1 number;
    num2 number;
    begin
    num1 := trunc(v_hex/16);
    num2 := v_hex-(num1*16);
    if ( num1 >= 0 and num1 <= 9 ) then
    hex := hex||to_char(num1);
    end if;
    if num1 = 10 then hex := hex||'A'; end if;
    if num1 = 11 then hex := hex||'B'; end if;
    if num1 = 12 then hex := hex||'C'; end if;
    if num1 = 13 then hex := hex||'D'; end if;
    if num1 = 14 then hex := hex||'E'; end if;
    if num1 = 15 then hex := hex||'F'; end if;
    if ( num2 >= 0 and num2 <= 9 ) then
    hex := hex||to_char(num2);
    end if;
    if num2 = 10 then hex := hex||'A'; end if;
    if num2 = 11 then hex := hex||'B'; end if;
    if num2 = 12 then hex := hex||'C'; end if;
    if num2 = 13 then hex := hex||'D'; end if;
    if num2 = 14 then hex := hex||'E'; end if;
    if num2 = 15 then hex := hex||'F'; end if;
    return hex;
    end;

  • How to convert clob to blob

    hi
    tell me some thong how we can convert clob to blob

    You can use my procedure
    create or replace procedure CLOB2BLOB (p_clob in out nocopy clob, p_blob in out nocopy blob) is
    -- transforming CLOB &#226; BLOB
    l_off number default 1;
    l_amt number default 4096;
    l_offWrite number default 1;
    l_amtWrite number;
    l_str varchar2(4096 char);
    begin
    begin
    loop
    dbms_lob.read ( p_clob, l_amt, l_off, l_str );
    l_amtWrite := utl_raw.length ( utl_raw.cast_to_raw( l_str) );
    dbms_lob.write( p_blob, l_amtWrite, l_offWrite,
    utl_raw.cast_to_raw( l_str ) );
    l_offWrite := l_offWrite + l_amtWrite;
    l_off := l_off + l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    Best regards, Victor

  • Converting Attribute to String

    I have obtained the attribute from LDAP (Netscape Directory Server) and I now want to convert it to a string so that I can manipulate it.
    So, I do this:
    Attributes readAttr = sr.getAttributes();
    Attribute attr=readAttr.get("cn");However, when I print this, I get something in the format:
    cn: My Test Group
    I would like to convert this Attribute to a String so that I can obtain the value of the cn without having the attribute name listed (i.e. obtain just "My Test Group"). Any ideas?

    Well, I figured out how to do this...
    I first cast the Attribute as an Object which has a toString() method. I then converted the object to a string and used the substring method to obtain the part I wanted.
    Attributes readAttr = sr.getAttributes();
    Attribute attr=readAttr.get("cn");
    Object objval = (Object)attr;
    String stringval = objval.toString();
    String val = stringval.substring(4);I don't know if this is the best way, but it worked for me!

  • Error "Conversion failed when converting date and/or time from character string" to execute one query in sql 2008 r2, run ok in 2005.

    I have  a table-valued function that run in sql 2005 and when try to execute in sql 2008 r2, return the next "Conversion failed when converting date and/or time from character string".
    USE [Runtime]
    GO
    /****** Object:  UserDefinedFunction [dbo].[f_Pinto_Graf_P_Opt]    Script Date: 06/11/2013 08:47:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE   FUNCTION [dbo].[f_Pinto_Graf_P_Opt] (@fechaInicio datetime, @fechaFin datetime)  
    -- Declaramos la tabla "@Produc_Opt" que será devuelta por la funcion
    RETURNS @Produc_Opt table ( Hora datetime,NSACOS int, NSACOS_opt int)
    AS  
    BEGIN 
    -- Crea el Cursor
    DECLARE cursorHora CURSOR
    READ_ONLY
    FOR SELECT DateTime, Value FROM f_PP_Graficas ('Pinto_CON_SACOS',@fechaInicio, @fechaFin,'Pinto_PRODUCTO')
    -- Declaracion de variables locales
    DECLARE @produc_opt_hora int
    DECLARE @produc_opt_parc int
    DECLARE @nsacos int
    DECLARE @time_parc datetime
    -- Inicializamos VARIABLES
    SET @produc_opt_hora = (SELECT * FROM f_Valor (@fechaFin,'Pinto_PRODUC_OPT'))
    -- Abre y se crea el conjunto del cursor
    OPEN cursorHora
    -- Comenzamos los calculos 
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    /************  BUCLE WHILE QUE SE VA A MOVER A TRAVES DEL CURSOR  ************/
    WHILE (@@fetch_status <> -1)
    BEGIN
    IF (@@fetch_status = -2)
    BEGIN
    -- Terminamos la ejecucion 
    BREAK
    END
    -- REALIZAMOS CÁLCULOS
    SET @produc_opt_parc = (SELECT dbo.f_P_Opt_Parc (@fechaInicio,@time_parc,@produc_opt_hora))
    -- INSERTAMOS VALORES EN LA TABLA
    INSERT @Produc_Opt VALUES (@time_parc,@nsacos, @produc_opt_parc)
    -- Avanzamos el cursor
    FETCH NEXT FROM cursorHora INTO @time_parc,@nsacos
    END
    /************  FIN DEL BUCLE QUE SE MUEVE A TRAVES DEL CURSOR  ***************/
    -- Cerramos el cursor
    CLOSE cursorHora
    -- Liberamos  los cursores
    DEALLOCATE cursorHora
    RETURN 
    END

    You can search the forums for that error message and find previous discussions - they all boil down to the same problem.  Somewhere in your query that calls this function, the code invoked implicitly converts from string to date/datetime.  In general,
    this works in any version of sql server if the runtime settings are correct for the format of the string data.  The fact that it works in one server and not in another server suggests that the query executes with different settings - and I'll assume for
    the moment that the format of the data involved in this conversion is consistent within the database/resultset and consistent between the 2 servers. 
    I suggest you read Tibor's guide to the datetime datatype (via the link to his site below) first - then go find the actual code that performs this conversion.  It may not be in the function you posted, since that function also executes other functions. 
    You also did not post the query that calls this function, so this function may not, in fact, be the source of the problem at all. 
    Tibor's site

  • Conversion failed when converting date and/or time from character string

    Hi experts,
    I'm trying running a query in Microsoft Query but it gives the following error message:
    "conversion failed when converting date and/or time from character string"
    when asks me the data I'm inserting 31-01-2014
    i've copy the query form the forum:
    SELECT T1.CardCode, T1.CardName, T1.CreditLine, T0.RefDate, T0.Ref1 'Document Number',
         CASE  WHEN T0.TransType=13 THEN 'Invoice'
              WHEN T0.TransType=14 THEN 'Credit Note'
              WHEN T0.TransType=30 THEN 'Journal'
              WHEN T0.TransType=24 THEN 'Receipt'
              END AS 'Document Type',
         T0.DueDate, (T0.Debit- T0.Credit) 'Balance'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')<=-1),0) 'Future'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=0 and DateDiff(day, T0.DueDate,'[%1]')<=30),0) 'Current'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>30 and DateDiff(day, T0.DueDate,'[%1]')<=60),0) '31-60 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>60 and DateDiff(day, T0.DueDate,'[%1]')<=90),0) '61-90 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>90 and DateDiff(day, T0.DueDate,'[%1]')<=120),0) '91-120 Days'
         ,ISNULL((SELECT T0.Debit-T0.Credit WHERE DateDiff(day, T0.DueDate,'[%1]')>=121),0) '121+ Days'
    FROM JDT1 T0 INNER JOIN OCRD T1 ON T0.ShortName = T1.CardCode
    WHERE (T0.MthDate IS NULL OR T0.MthDate > ?) AND T0.RefDate <= ? AND T1.CardType = 'C'
    ORDER BY T1.CardCode, T0.DueDate, T0.Ref1

    Hi,
    The above error appears due to date format is differnt from SAP query generator and SQL server.
    So you need convert all date in above query to SQL server required format.
    Try to convert..let me know if not possible.
    Thanks & Regards,
    Nagarajan

  • SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)

    SAP query error - 1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string.  'Received Alerts' (OAIB)
    SELECT    
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO AS T0 LEFT OUTER JOIN
                          VPM2 AS T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry LEFT OUTER JOIN
         OVPM AS T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1 AS T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate>='[%0]' and T0.DocDate<='[%1]'

    Hi,
    Try this:
    SELECT   
    CASE WHEN T0.DocStatus = 'O' THEN 'OPEN'
    WHEN T0.DocStatus = 'C' THEN 'CLOSED'  END  AS 'Document Status',
    T0.DocDate AS 'Posting Date',
    T0.DocNum AS 'Doc.No',
    T0.NumAtCard,
    T0.TransId AS 'Trans. No.',
    T0.Comments AS 'Remarks',
    T0.CardCode AS 'Offset Acct',
    T0.CardName AS 'Offset Acct Name',
    sum(T0.DocTotal) + (T0.WTSum) as 'DocTotal',
    T3.DueDate AS 'Cheque Date',
    T3.CheckSum AS 'Amount'
    FROM         ODPO  T0 LEFT OUTER JOIN
                          VPM2  T1 ON T0.ObjType = T1.InvType AND T0.DocEntry = T1.DocEntry
    LEFT OUTER JOIN
         OVPM  T2 ON T2.DocEntry = T1.DocNum LEFT OUTER JOIN
                          VPM1  T3 ON T2.DocEntry = T3.DocNum
    where T0.DocDate >= '[%0]' and T0.DocDate <='[%1]'
    group by T0.DocStatus,T0.DocDate ,
    T0.DocNum ,
    T0.NumAtCard,
    T0.TransId ,
    T0.Comments ,
    T0.CardCode,
    T0.CardName ,
    T0.WTSum ,
    T3.DueDate ,
    T3.CheckSum
    Thanks & Regards,
    Nagarajan

  • Converting Oracle XML Query Result in Java String by using XSU

    Hi,
    I have a problem by converting Oracle XML Query Result in Java
    String by using XSU. I use XSU for Java.
    For example:
    String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
    preise ps where match='"+args[0]+"'");
    String datum1=datum;
    I become the following error:
    Prototyp.java:47: Incompatible type for declaration. Can't
    convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
    Can somebody tell me a method() for converting to solve my
    problem??????
    Thanks

    Hmmm.. Pretty basic just look at the example:
    OracleXMLQuery qry = new OracleXMLQuery(conn,"Select max(ps.datum) from preise ps where match='"+args[0]+"'");
    String xmlString = qry.getXMLString();
    Hi,
    I have a problem by converting Oracle XML Query Result in Java
    String by using XSU. I use XSU for Java.
    For example:
    String datum=new OracleXMLQuery(conn,"Select max(ps.datum) from
    preise ps where match='"+args[0]+"'");
    String datum1=datum;
    I become the following error:
    Prototyp.java:47: Incompatible type for declaration. Can't
    convert oracle.xml.sql.query.OracleXMLQuery to java.lang.String.
    Can somebody tell me a method() for converting to solve my
    problem??????
    Thanks

  • Conversion failed when converting from a character string to uniqueidentifier

    how to convert the charter string to uniqueidentifier in  sql server 
    I tried for all the articals in the net can some one give me the better soluction for this.. i will use the cast and convert function but i didnt get the soluction over here.
    can you please give me the answer for this query........
    i have table called user1 contains column col1,
    col1
    d65cafc-1435-45d3-acce-dc464f02c4b1

    The first part is to short, it must be 8 signs, you have only 7; I added a zero and it works =>
    DECLARE @id varchar(60);
    SET @id = 'd65cafc0-1435-45d3-acce-dc464f02c4b1'
    SELECT CONVERT(uniqueidentifier, @id)
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • Can you delete you main itunes library and still have your library on another computer?

    Please help! Need to get rid of old computer like tomorrow!

  • How do I back my iPad onto an external hard drive?

    How do I change the destination for the backups on iTunes? I can't use my primary HDD to save files because I'm running dangerously low on space on this computer. However, I do have a 2TB external hard drive.  I'm trying to back up 10 GB of video, wh

  • Can't login to BPM PRocess Composer

    Hi guys, having installed SOA Suite 11.1.1.3, I am trying to login to to the BPM Composer web-app. On first attempt my browser times out after a few minutes of waiting. Then I try to login again and see the following exception in the log: ExecuteThre

  • Unable to connect iPhone5 to Dell Laptop

    Trying to connect iPhone 5 to a Dell Laptop w/windows 7 via Bluetooth.  when I add the device on the Laptop it says it is missing drivers.  However it is unable to update the drivers automatically.  Any ideas?

  • Change Book Cover layout

    Hi everyone, Is there anyway to change the amount of images required on a cover. I am trying to use the stock colour black book and only want one image on the front cover but seem to be stuck with three. For instance if i only place one image onto th