StatementText from ShowPlanXML only outputs 4000 characters?

Hi, 
It seems that StatementText in the ShowPlanXML only returns 3999 characters, even if the statement is larger than that.
I have not seen this documented in the ShowPlanXML schema (http://schemas.microsoft.com/sqlserver/2004/07/showplan) or in the BOL. 
Is there any way to get the complete SQL statement from the query plan?

hi ,saso_k
I found some clues in the MSDN
http://msdn.microsoft.com/en-us/library/ms189747.aspx
Under the following conditions, no Showplan output is returned in the query_plan column of the returned table for sys.dm_exec_query_plan:
If the query plan that is specified by using plan_handle has been evicted from the plan cache, the query_plan column of the returned table is null. For example, this condition may occur if there is a time delay between when the plan handle was captured and
when it was used with sys.dm_exec_query_plan.
Some Transact-SQL statements are not cached, such as bulk operation statements or statements containing
string literals larger than 8 KB in size. XML Showplans for such statements cannot be retrieved by using sys.dm_exec_query_plan unless the batch is currently executing because they do not exist in the cache.
If a Transact-SQL batch or stored procedure contains a call to a user-defined function or a call to dynamic SQL, for example using EXEC (string), the compiled XML Showplan for the user-defined function is not included in the table returned
by sys.dm_exec_query_plan for the batch or stored procedure. Instead, you must make a separate call to sys.dm_exec_query_plan for the plan handle that corresponds to the user-defined function. 
When an ad hoc query uses simple or forced parameterization, the query_plan column will contain only the statement text and not the actual query plan. To return the query plan, call sys.dm_exec_query_plan for the plan handle of the prepared parameterized query.
You can determine whether the query was parameterized by referencing the sql column of the sys.syscacheobjects view or the text column of the sys.dm_exec_sql_text dynamic management view. 

Similar Messages

  • Selecting the first 4000 characters from a tag in an xml file

    Oracle Enterprise Edition 11.1.0.7 64 bit (Jan 2012 CPU applied)
    Windows 2003 64 bit
    We have an XML file with the following sample format.
    <?xml version="1.0"?>
    <HR>
    <EMP>
    <FNAME>JOHN</FNAME>
    <LNAME>DOE</LNAME>
    <COMMENT>Comment with less than 4000 characters</COMMENT>
    </EMP>
    <EMP>
    <FNAME>JANE</FNAME>
    <LNAME>DOE</LNAME>
    <COMMENT>Comment with more than 4000 characters</COMMENT>
    </EMP>
    </HR>
    The query below
    (full disclosure: which I took from odie_63's response in Creating External Table using Xml Dataset - how to include null values? and added the CURSOR_SHARING_EXACT hint on the top)
    works when the contents of the <Comment> tag are smaller than 4000 characters. If it is more than 4000 I get
    ORA-01706: user function result value was too large
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'COMMENT'
    I found another query where someone was doing a substring (I think to get only the first 4000 characters from the tag) here.
    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14638197 (See OP's post)
    TERMINATION_DATE VARCHAR(32) path 'TerminateDate/substring(text(), 1, 32)',
    So I updated my query to be
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'COMMENT/substring(text(),1,4000)'
    The query runs without an error when the <comment> tag has 4000 or less characters but still errors out with it is more than 4000.
    I found an alternative method to do the SUBSTRING here in Herald ten Dam's reponse in Re: A view over XML that is not 1:1
    code varchar2(30) path 'substring(code,1,3)',
    so I tried this:
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'substring(COMMENT,1,4000)'
    but that doesn't work either.
    How can I extract the first 4000 characters of the <COMMENT> tag so that the query doesn't fail.
    We are not using any other XMLDB features at this time. This is the first we've started looking into using Oracle built in XML features, so we might not have setup something that other's might know to specifically setup to start using the XML features in Oracle 11.1
    Thanks in advance,
    Wally

    walls99 wrote:
    This is regardless of the COMMENTS tag being 4000 characters or more and the same with the ideas from Odie.
    WallyNo idea if it is an issue with your version. I don't have your version to test but following works for me. Does this simple test work?
    SQL> select * from v$version ;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 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
    SQL> set define off
    SQL> select dbms_xmlgen.convert(xmlserialize(content xmltype('<brand>Ben &amp; Jerry</brand>') as clob), 1) from dual ;
    DBMS_XMLGEN.CONVERT(XMLSERIALIZE(CONTENTXMLTYPE('<BRAND>BEN&AMP;JERRY</BRAND>')A
    <brand>Ben & Jerry</brand>

  • PDF output not showing all 4000 characters

    Hi,
    I have a placeholder column of character data type and its width is 4000. When I execute the report and see it pdf output it shows only 1980 characters with last line characters going beyond the report margins.
    Is there a way to display all 4000 characters?
    Thanks,
    Mitiksha

    Hi Ade,
    I tried all possible combinations of fetching the data. Writing a PL/SQL function and assigning the data to placeholder in before report trigger. Also, tried to use a query and then assign the data to placeholder through formula column. Directly assigining the database column on field without using placeholder.
    While trying all the above options, I ensured that width is set to 4000 characters.
    But all in vain. It works fine for 2000 characters but not able to print 4000 characters.
    Regards,
    Mitiksha

  • I use classical Hebrew for my work, and Pages will only display English characters even with a Hebrew font selected. If I cut and paste Hebrew characters from another document, as long as the font is supported, it will appear in Pages.  If I type it won't

    I use classical Hebrew for my work, and Pages will only display English characters even with a Hebrew font selected. If I cut and paste Hebrew characters from another document, as long as the font is supported, it will appear in Pages.  If I type it won't continue in Hebrew.  I have tried downloading several fonts, including those from professional societies, but the only way to get Hebrew in my document is to cut and paste.  Does anyone know how to fix this?  I use an older MacBook running OS 10.9.1.  I used to do my Hebrew work in Word, but it is no longer supported by Mac OS.

    Just clarifying:
    Pages '09 has bad support for Hebrew, Arabic etc but will accept pasted text.
    Pages 5 has much better support but with bugs.
    If you have columns they are in the wrong order ie Text starts in the left column and ends in the right column.
    If you type English into Hebrew text it tends to fall in the wrong position eg instead of to the left of Hebrew punctuation it goes to the right.
    As Tom recommends the only real solution on the Mac is Mellel.
    Peter
    btw Tell Apple, they are amazingly slow to fix this running sore which has been broken since RtoL was supposedly introduced in OSX 10.2.3 over a decade ago.
    Peter

  • 5.1 Surround Sound only outputting from one speaker on macbook

    I have connected my old LG LH T360SE home cinema system to my white 13" macbook (late 2007) from the headphone jack via an audio Y cable into the RCA audio input on the back of the home cinema system. Unfortunately when playing movies via Plex, VLC or any other media player the sound only outputs through the front left speaker and sub-woofer. I checked that the other speakers are connected by perfoming a connection test in the product's setup and there is some background noise if you put your ear up against them. The 5 speakers work fine when playing a DVD on the integrated DVD player. Is there any settings on the macbook I need to change to make use of the full 5.1 surround sound?
    Thanks

    You'll need to use an optical cable to get 5.1 surround. So you'll also need a little optical->mini-optical converter (which allows you to plug it into the 3.5mm jack).

  • Query in 10g DB gives error when size of element exceeds 4000 characters?

    I used this query give in this thread Need help in reading a _fmb.XML and writing the item properties to a table
    select x1.item_name
         , x1.item_type
         , x2.property
         -- to convert back entities such as
    to their character values :
         , utl_i18n.unescape_reference(x2.property_value) as property_value
         -- parent information :
         , x1.parent_item_name
         , x1.parent_item_type
    from xmltable(
           xmlnamespaces(default 'http://xmlns.oracle.com/Forms', 'http://xmlns.oracle.com/Forms' as "def")
         , 'for $i in /Module/descendant::*[@def:Name]
            return element item {
              attribute item_name {data($i/@def:Name)}
            , attribute item_type {local-name($i)}
            , attribute parent_item_name {data($i/parent::*/@def:Name)}
            , attribute parent_item_type {local-name($i/parent::*)}
            , $i
           passing xmltype(bfilename('TEST_DIR','length_test_fmb.xml'), nls_charset_id('AL32UTF8'))
           columns item_name         varchar2(50) path '@item_name'
                 , item_type         varchar2(50) path '@item_type'
                 , parent_item_name  varchar2(50) path '@parent_item_name'
                 , parent_item_type  varchar2(50) path '@parent_item_type'
                 , item              xmltype      path '.'
         ) x1
       , xmltable(
           xmlnamespaces(default 'http://xmlns.oracle.com/Forms', 'http://xmlns.oracle.com/Forms' as "def")
         , 'for $i in /item/*/attribute::def:*
            let $propname := local-name($i)
            where $propname != "Name"
            return element p {
              element name {$propname}
            , element value {data($i)}
           passing x1.item
           columns property       varchar2(50)  path 'name'
                 , property_value varchar2(4000) path 'value'
        ) x2
    ;This works perfectly, but I tried a form which has a program unit which exceeds 4000 characters, i.e. I converted a fmb to xml, I.E. PROPERTY VALUE. When you run the query then you get error "function returned value too large".
    I tried changing the VARCHAR2 to CLOB but then you get another error.
    We cannot migrated to 11g as yet, so how to handle this in 10g?
    Any help would be greatly appreciated.
    Edited by: Channa on Oct 25, 2011 6:40 AM

    Hi Channa,
    I should have mentioned it in the previous thread, a sound approach to the overall requirement would be to use object-relational storage for loading XML documents in the database.
    You can read more here : http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb03usg.htm#g1055369
    However, that's not possible if we use the DUMP=ALL option to convert Forms files to XML because the generated files do not conform to the Forms XML schema.
    So unless you decide to use DUMP=OVERRIDDEN, you're stuck with the current situation.
    If I remember correctly, the ability to project large strings as CLOB with XMLTable was added in version 10.2.0.4.
    You're not out of options though.
    Here are two, one being "dirtier" than the other...
    1) Divide the property value into multiple chunks of 4000 characters (or less if the db uses a multi-byte character set), then rebuild the string as CLOB in the SELECT clause :
    select x1.item_name
         , x1.item_type
         , x2.property
         , to_clob(utl_i18n.unescape_reference(x2.property_value1)) ||
           to_clob(utl_i18n.unescape_reference(x2.property_value2)) as property_value
         , x1.parent_item_name
         , x1.parent_item_type
    from xmltable(
           xmlnamespaces(default 'http://xmlns.oracle.com/Forms', 'http://xmlns.oracle.com/Forms' as "def")
         , 'for $i in /Module/descendant::*[@def:Name]
            return element item {
              attribute item_name {data($i/@def:Name)}
            , attribute item_type {local-name($i)}
            , attribute parent_item_name {data($i/parent::*/@def:Name)}
            , attribute parent_item_type {local-name($i/parent::*)}
            , $i
           passing xmltype(bfilename('TEST_DIR','module2.xml'), nls_charset_id('AL32UTF8'))
           columns item_name         varchar2(50) path '@item_name'
                 , item_type         varchar2(50) path '@item_type'
                 , parent_item_name  varchar2(50) path '@parent_item_name'
                 , parent_item_type  varchar2(50) path '@parent_item_type'
                 , item              xmltype      path '.'
         ) x1
       , xmltable(
           xmlnamespaces(default 'http://xmlns.oracle.com/Forms', 'http://xmlns.oracle.com/Forms' as "def")
         , 'for $i in /item/*/attribute::def:*
            let $propname := local-name($i)
            let $propval := data($i)
            where $propname != "Name"
            return element p {
              element name {$propname}
            , element value1 {substring($propval,1,4000)}
            , element value2 {substring($propval,4001,4000)}
           passing x1.item
           columns property        varchar2(50)   path 'name'
                 , property_value1 varchar2(4000) path 'value1'
                 , property_value2 varchar2(4000) path 'value2'
        ) x2
    ;2) Output the property value as a text() node (XMLType datatype) and serialize as CLOB in the SELECT :
    select x1.item_name
         , x1.item_type
         , x2.property
         , dbms_xmlgen.convert(x2.property_value.getclobval(),1) as property_value
         , x1.parent_item_name
         , x1.parent_item_type
    from xmltable(
           xmlnamespaces(default 'http://xmlns.oracle.com/Forms', 'http://xmlns.oracle.com/Forms' as "def")
         , 'for $i in /Module/descendant::*[@def:Name]
            return element item {
              attribute item_name {data($i/@def:Name)}
            , attribute item_type {local-name($i)}
            , attribute parent_item_name {data($i/parent::*/@def:Name)}
            , attribute parent_item_type {local-name($i/parent::*)}
            , $i
           passing xmltype(bfilename('TEST_DIR','module2.xml'), nls_charset_id('AL32UTF8'))
           columns item_name         varchar2(50) path '@item_name'
                 , item_type         varchar2(50) path '@item_type'
                 , parent_item_name  varchar2(50) path '@parent_item_name'
                 , parent_item_type  varchar2(50) path '@parent_item_type'
                 , item              xmltype      path '.'
         ) x1
       , xmltable(
           xmlnamespaces(default 'http://xmlns.oracle.com/Forms', 'http://xmlns.oracle.com/Forms' as "def")
         , 'for $i in /item/*/attribute::def:*
            let $propname := local-name($i)
            where $propname != "Name"
            return element p {
              element name {$propname}
            , element value {data($i)}
           passing x1.item
           columns property        varchar2(50)   path 'name'
                 , property_value  xmltype        path 'value/text()'
        ) x2
    ;Edited by: odie_63 on 25 oct. 2011 17:03
    Edited by: odie_63 on 25 oct. 2011 17:04

  • Column with more than 4000 characters

    Hi,
    Version: 10.2.0.4.0
    I have a requirement to display more than 4000 characters (clob, long data type) through sql.
    Though this can be achieved through pl/sql, I am not able to get the output in sql statements. Is it possible to get this done through sql?
    I can use intermediate pl/sql processing if needed.
    Thanks for your help.

    Preta wrote:
    Though this can be achieved through pl/sql, I am not able to get the output in sql statements. Is it possible to get this done through sql?Yes, what did you try? - Hopefully not LONG
    SQL> drop table t purge;
    Table dropped.
    SQL> create table t (c clob);
    Table created.
    SQL> insert into t values (rpad(to_clob('x'),4001, 'x'));
    1 row created.
    SQL> set long 5000
    SQL> set pages 100
    SQL> select c from t;
    C
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    x
    SQL>Regards
    Peter

  • ORA-01461 when trying to insert text 4000 characters into a CLOB column

    I work on a Windows application that connects to databases using ODBC. I'm currently working on adding Oracle support to the application, but I'm running into a lot of problems inserting strings of more than 4000 characters into CLOB columns. First, I tried to do that directly using code similar to the following (setup, cleanup, and error checking snipped for clarity).
    SQLHDBC hDbc;
    SQLHSTMT hStmt;
    unsigned char query[200];
    SQLAllocStmt(hDbc, &hStmt);
    strcpy(query,"INSERT INTO test_table (col_clob, col_int) ('long string', 1)");
    SQLExecDirect(hStmt,query,strlen(query));
    Of course, "long string" was really a string of more than 4000 characters. When I did that, I got an error indicating that I needed to use bind parameters for strings that long. However, bind parameters don't seem to work either. I changed my code to something like the following:
    SQLHDBC hDbc;
    SQLHSTMT hStmt;
    unsigned char query[200];
    +unsigned char *str=NULL;+
    int str_size;
    SQLAllocStmt(hDbc, &hStmt);
    strcpy(query,"INSERT INTO test_table (col_clob, col_int) (:strvar, 1)");
    SQLPrepare(hStmt,query,SQL_NTS);
    str = (unsigned char*)malloc(6000 * sizeof(unsigned char));
    SQLBindParameter(hStmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARBINARY, 0, 0, str, sizeof(str), &str_size);
    strcpy(str,'long_string');
    str_size = SQL_NTS;
    SQLExecute(hStmt);
    This code works fine when 'long_string' is less than 4000 characters. When it's greater than that, I get the following error:
    +[Oracle][ODBC][Ora]ORA-01461: can bind a LONG value only for insert into a LONG column+
    I'm using Visual Studio.NET 2003 on Windows XP, and Oracle client 11.1.0.6.0. My server version is as follows:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I thought I read somewhere that this is a known bug with Oracle 10.2.0.1.0, but I can't seem to find the reference now. Can anyone confirm this or provide some assistance with this problem? Frankly, it seems kind of ridiculous that I can't do something as simple as inserting a reasonably sized amount of text into a CLOB column. I'm considering using BFILEs instead, but that would be kind of a pain to fit into our application, so I'd prefer not to do this if at all possible.
    Thanks in advance for any help.

    I found this link referring to a similar problem that was apparently fixed in version 10.2.0.4 of the server: ORA-01461: can bind a LONG value only for insert into a LONG column Should I try to upgrade the server and see if that fixes things?

  • Hexdump -C outputs unreadable characters

    In previous versions of OS X (10.4 and older), the terminal command "hexdump -C" only displayed ASCII characters in the right column (i.e. when using the "%_p" format). All the others (control characters etc, and anything above 127) were replaced by a dot. This is also how hexdump behaves in Linux.
    Since Leopard however, the characters above 127 are also displayed somehow, and the terminal seems to convert them to 4-byte sequences. This makes that type of display useless. A file that looks like this in the old hexdump (best viewed in a monospaced font):
    00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 60 |......JFIF.....`|
    00000010 00 60 00 00 ff e1 00 6e 45 78 69 66 00 00 49 49 |.`.....nExif..II|
    00000020 2a 00 08 00 00 00 01 00 69 87 04 00 01 00 00 00 |*.......i.......|
    ... looks like this in Leopard's hexdump:
    00000000 ff d8 ff e0 00 10 4a 46 49 46 00 01 01 01 00 60 |<FF><D8><FF><E0>..J
    FIF.....`|
    00000010 00 60 00 00 ff e1 00 6e 45 78 69 66 00 00 49 49 |.`..<FF><E1>.nExif.
    .II|
    00000020 2a 00 08 00 00 00 01 00 69 87 04 00 01 00 00 00 |*.......i.......|
    According to the manpage, the "%_p" format +"displays nonprinting characters as a single ``.''"+. So it seems Apple changed its definition of "nonprinting characters" in Leopard.
    Is there any way to get the old behavior back?

    OK, I didn't tell the full story: what I usually do, is +"hexdump -C filename | less"+, so I can easily scroll the output. I haven't tried it without the +"| less"+ yet and indeed, it doesn't produce the hex codes but question marks instead. The reason why it produces question marks, is because the terminal tries to interpret the characters as unicode. Codes like FFD8 are not valid utf-8, hence the question marks. "less" prints the raw hexadecimal values instead, producing the ugly output from my first post. It's possible to make "less" interpret the values as iso latin 1, which also produces the question marks. Even though it's not perfect, it does produce more usable output (garbage will still appear if there happens to be an accidental existing utf-code in a binary file).
    I guess to get the old behavior (dots for non-ASCII characters), I'll have to either compile my own version or try to copy the one from a Tiger machine. I could try submitting a bug report but I'm pretty sure Apple will tell me that it complies to the man page.

  • When i print a pdf from preview it prints strange characters - it looks fine on screen

    when i print a pdf from preview it prints strange characters - it looks fine on screen

    You can also try opening the PDF with preview, then doing a copy and paste to TextEdit and printing from there.
    Adobe makes it easier, but you do have software to accomplish this.
    Only download Adobe reader from this site, to avoid "fakes/spoofs/malware" that will cause damage to your machine.
    http://www.adobe.com/support/downloads/product.jsp?platform=macintosh&product=10
    Hope this helps

  • Greater than 4000 characters in OBIEE 11g

    Dear all,
    I have a table, just one column.
    In Analysis, I designed a table with this column content the data as text greater than 4000 characters.
    Can I show all of them in OBIEE ?
    Can I change the column datatype?
    Anyone help me to resolve this issue.
    Thanks and Regards,
    David,...

    I guess you will have problem displying them in OBIEE since (The data type would be long);
    You can not use long datatype column in below cases;
    1. A value of datatype LONG was used in a function or in a DISTINCT, WHERE, CONNECT BY, GROUP BY, or ORDER BY clause. A LONG value can only be used in a SELECT clause
    2. It can not be used in expressions or conditions
    3. It can not be used in select lists of subqueries or queries combined by set operators
    Make sure your generated query is not doing the above things. First thing Distinct will come in the obiee queries by default. Try to avoid distinct,group by,order by in your reports. Direct database request for the report can help you in this case.
    Mark Correct if it helps.
    Regards,
    Kashi

  • Hide/Delete lines from ABAP Query output when Quantity is 0

    Hi all,
    I'm changing an existing abap query. My requirement is to delete the rows from the report output where qantity = 0.
    I tried the following ways.
    1. In SQ01, select the quantity field and check the checkbox for "Display only field <> 0", but this didnt worked as it will 
         supress the zero from display.
    2. I tried to write code in the Infoset SQ02->Edit->Code. I wrote the following code "CHECK vbep-wmeng IS NOT INITIAL".
        Here  the problem is, the code is not executing in the test client. When I open the Infoset in test(i mean development test) 
        client the code is there, but when i execute the program its not working. I tried using "BREAK-POINT", program executions
        does not stop at the break point. There is existing code in the event "START-OF-SELECTION", this code I'm able to see in the
        query program opened through SE38. I edited the existing code and kept a break point in between, and now checked in the
        program in SE38, but the changes are not reflected. I'm able to see old code only(even after save n generate).
    3. Gave search in SCN, google etc.
    Please note.
    1. I'm not using any Logical Database in the Infoset. Its a simple join of 4 tables.
    2. Query is created in the Global Area (cross client) not client specific.
    Can anybody tell me what could be the problem and how can Over the above issues and achive the requirement.
    Thanks in advance.
    Edited by: Mr A on Feb 25, 2010 1:39 AM

    Dear Mr A,
    Can i know how did u solve the issue even i'm facing the same problem.
    Regards,
    Karan Bhasin

  • Docked iPod only outputs sound during video to TV

    I have a 5G iPod in an Apple dock, connected to my TV using a Monster audio cable and an S-Video cable. For some reason, it only outputs sound during videos or a photo slide show - not at all for music only playback. I'm baffled! Any idea why? It's a Panasonic plasma, and I've tried three different inputs. None work for music, but video is fine.

    The iPhone 4, unlike iPod, doesn't ask you to set for PAL or NTSC.  In fact, in the SETTINGS/Video menu it only asks if you want to "Start Playing From Beginning", "Closed Captioning" and "Home Sharing".  I was surprised it had no settings like the iPod at all.

  • Displaying more than 4000 characters

    Hi
    I have a report which would display a CLOB field having text of length around 32000 characters.
    I tried to use DBMS_LOB.SUBSTR(<field_name>,32000,1) on the query so that it shows the text at least till 32000 characters on the report but it keeps returning an error ORA-06502 PL/SQL: numeric or value error string - character string buffer too small whenever it is more than 4000 characters in that particular field.
    Can anyone pls suggest any solution ASAP?
    Thanks
    Arnab

    You can split your clob in varchar2 4000 drop table tab1;
    create table tab1 (
      clsplit_id                   number(10)        NOT NULL,
      clsplit_type1val          CLOB                 NULL,
      clsplit_type2val          CLOB                 NULL
    drop type some_list;
    drop type my_t;
    create type my_t as object
          id1 number,
          clob_type number,
          no_clob_lines      number,
          clob_line      number,
          clob_data      varchar2(80)
    show errors
    create type some_list as table of my_t
    show errors
    insert into tab1 values(1, 'a0123456789b0123456789c0123456789d0123456789e0123456789f0123456789leftover',
          'a9876543210b9876543210c9876543210d9876543210e9876543210f9876543210leftover');
    insert into tab1 values(2, '0aaaaaaaaaa1bbbbbbbbbb2cccccccccc3dddddddddd4eeeeeeeeee5ffffffffff',
          'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    insert into tab1 values(3, 'first has data, second null', null);
    insert into tab1 values(4, null, 'first null second has data');
    insert into tab1 values(5, 'short lob', 'short lob');
    commit;
    create or replace function some_func return some_list pipelined is
          num_allowed_chars      number      := 4000;
          clob1_len                  number;
          clob2_len                  number;
          loop_counter            number;
          col_name                  varchar2(100);
          current_line            number;
          i                              integer;
            out_rec my_t := my_t(NULL,NULL,NULL,NULL,NULL);
    begin
          for c1 in ( select clsplit_id, clsplit_type1val, clsplit_type2val from tab1 )
          loop
                -- get first clob
                if c1.clsplit_type1val is not null then
                      clob1_len := dbms_lob.getlength(c1.clsplit_type1val);
                      if clob1_len > num_allowed_chars then
                            for i in 1..ceil(clob1_len/num_allowed_chars) loop
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 1;
                                  out_rec.no_clob_lines := ceil(clob1_len/num_allowed_chars);
                                  out_rec.clob_line := i;
                                  out_rec.clob_data := substr(c1.clsplit_type1val,( i * num_allowed_chars ) - num_allowed_chars + 1,num_allowed_chars);
                                  pipe row(out_rec);
                            end loop;
                      else
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 1;
                                  out_rec.no_clob_lines := 1;
                                  out_rec.clob_line := 1;
                                  out_rec.clob_data := c1.clsplit_type1val;
                                  pipe row(out_rec);
                      end if;
                end if;
                -- get second clob
                if c1.clsplit_type2val is not null then
                      clob2_len := dbms_lob.getlength(c1.clsplit_type2val);
                      if clob2_len > num_allowed_chars then
                            for i in 1..ceil(clob2_len/num_allowed_chars) loop
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 2;
                                  out_rec.no_clob_lines := ceil(clob2_len/num_allowed_chars);
                                  out_rec.clob_line := i;
                                  out_rec.clob_data := substr(c1.clsplit_type2val,( i * num_allowed_chars ) - num_allowed_chars + 1,num_allowed_chars);
                                  pipe row(out_rec);
                            end loop;
                      else
                                  out_rec.id1 := c1.clsplit_id;
                                  out_rec.clob_type := 2;
                                  out_rec.no_clob_lines := 1;
                                  out_rec.clob_line := 1;
                                  out_rec.clob_data := c1.clsplit_type2val;
                                  pipe row(out_rec);
                      end if;
                end if;
          end loop;
          return;
    end;
    show errors
    select * from
    table(select some_func() from dual)
    order by 1,2,4;

  • Owa_text.vc_arr: can't handle the string with more than 4000 characters?

    In the Oracel Web Application Server 4.0 documment, it says
    about owa_text.vc_arr :Type vc_arr is table of varchar2(32767)
    index by binary_integer.
    I amusing PL_SQL with Oracle8i and OWA4.0 web server.I want to
    use owa_text.vc_arr to pass the multple line texts in my form.
    If the text length is less than 4000 characters, everything works
    fine.However when the texts are longer than 4000 characters but
    less than the max length 32767 characters, I got this error
    message:
    OWS-05101: Execution failed due to Oracle error 2005
    ORA-02005: implicit (-1) length not valid for this bind or define
    datatype.
    Owa_text.vc_arr is supposed to handle the string with more
    than 4000 characters, is it true? Could anyone tell me why? Any
    help will be greatly appreciated!!!
    Thanks very much.
    Helena Wang
    Here is the pl_sql procedure to create my form:
    PROCEDURE myform
    IS
    BEGIN
    htp.p('
    <form action="'||service_path||'helena_test.saveform3"
    method=post>
    <input type=hidden name=tdescription value="X">
    Input1: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    Input2: <textarea name=tdescription rows=50 cols=70
    WRAP=physical></textarea>
    <input type=submit name=WSave value="Save">
    </form>
    END;
    /***** here is the pl_sql procedure which I use to save the
    form***/
    procedure saveform3(tdescription in owa_text.vc_arr,
    WSave in varchar2 default 'No')
    is
    len pls_integer;
    begin
    for i in 2..tdescription.count loop
    len := length(tdescription(i));
    htp.p(len);
    htp.p(tdescription(i));
    end loop;
    end;

    Helena, I think you might get a better response either from the SQL-PL/SQL forum, or perhaps the Portal Applications forum - both of these tend to have folks very familiar with PL/SQL and the OWA packages.
    This forum is on Web services based on SOAP, WSDL and UDDI. These can be PL/SQL based but typically don't use the mod_psql or OWA web solution.
    As a pointer, I suspect you may already be familiar with, but just in case, you can always take a look at chapter 3 of the OAS documentation, "Developer's Guide: PL/SQL and ODBC Applications" where they go through a number of examples using parameters. See:
    http://technet.oracle.com/doc/appsrvr4082/guides/plsql.pdf
    Hope this or folks from the other list can help.
    Mike.

Maybe you are looking for

  • Error: Tax code P1 country IN does not exist in procedure TAXINN

    Hi All,         here in our rollout project we are facing problem like...when i create PO & put some input taxcode in the invoice tab at item level...The respective Taxes tab appears but when i click the same tab (taxes)....the next screen where Jmop

  • JAVA Add-in For Central ABAP Instance installation failure

    Hi!  I'm attempting to install a java add-in to an ABAP central instance in our sandbox for NW04 SR1.  After sapinst is started, the process runs for approximately 2 minutes then fails. I've not been successful in determining exactly why.  I have env

  • How to make a flat object look round?

    I have a round logo for a company. I want to make it look like it is painted on to a christmas tree ornament.. so it almost needs to look 3D. Can I do this in photoshop or illustrator or something? Any thoughts?

  • Creating a table of contents page using combined documents

    Adobe Version 7.0 When combining multiple documents as one .pdf document, can a table of contents page be set up simultaneously?  If so, can page numbers be added? We have several type of documents (.xls, doc, pdf) that we combine on a regular basis

  • Exporting Numbers sheet to pdf but keeping formulas?

    Hi! I want to know if it's possible to export a Numbers sheet to .pdf in a way that let's me keep the formulas? My goal is to create a pdf which let's the user answer a series of questions where the answers create a result and a couple of diagrams. I