[OCI] - Select statement on Clob doesn't return the full column's content.

Hi All,
I'm actually working on a application using OCI on an Oracle 11gr2. The Oracle client as the 11.2.0 version, was fully(admin) installed and configured with the same NLS_LANG variable as the DB.
In the Database, we are using CLOB to store long text files. The setup our application was writing the initial CLOB correctly, but we cant read it, we just a part of the text.
I checked it in SQLPlus and SQLDeveloper :
select sourcecode from script where name like 'callback';
result :
SOURCECODE
// #import "CallbackFctLib"
* Benutzerdefinierte Funktionen bei der
if I set the long to 1000 before the Select statement, then the full file is displayed.
set long 1000;
select sourcecode from script where name like 'callback';
So, this works for SQLPlus and SQLDeveloper but how can I set it for the whole System? is ist possible? does any parameters have to be pass to the "sourcecode" column to define any format?
thanks for reading...

Hi!
When you establish connection to database, try explicitly give instructions about what encoding use your DB, e.g.:
// connection properties
Properties connInfo = new Properties();
connInfo.put("user", username);
connInfo.put("password", password);
connInfo.put("charSet", "Cp1251"); // enter your codepage!!!
// getconnection
Connection db = DriverManager.getConnection(dataurl, connInfo);

Similar Messages

  • The same selection doesn't return the same result in 2 identical systems

    Hi,
    After a copy we have 2 systems with same data.
    In a program the same selection doesn't returns the same result, it seems that the sort is different.
    I have checked indexes but they are ok in both systems.
    Here is the selection:
    SELECT but000~partner
    INTO TABLE lt_partner
    *UP TO 50 ROWS
    FROM but000
    JOIN but020
      ON but020partner = but000partner
    JOIN adrc
      ON adrcaddrnumber = but020addrnumber
    JOIN but100
      ON but100partner = but000partner
      WHERE but020~addr_valid_from LE '20100727000000'
      AND   but020~addr_valid_to   GE '20100727000000'.
    Is there a customizing point to define how the database must be sorted ?
    Thanks.
    Edited by: julien schneerberger on Jul 27, 2010 4:18 PM

    Hi,
    Thank you for your answer.
    Result is the same and I don't sort data after the selection.
    Do you think the system copy has "broke" the records order in database ?
    If it is the case it will be impossible to reproduce the same sort, is it right ?
    Edited by: julien schneerberger on Jul 27, 2010 5:19 PM
    Edited by: julien schneerberger on Jul 27, 2010 5:20 PM

  • Write a SELECT statement in different ways is not the same thing!!!

    Let's take a look
    use AdventureWorks2012
    go
    dbcc freeproccache
    go
    and now select something
    select * from [HumanResources].[vEmployeeDepartmentHistory]
    go
    so, analyzing 'Compiled Plan'
    SELECT usecounts, cacheobjtype, objtype, text
    FROM Sys.dm_exec_cached_plans
    CROSS APPLY sys.dm_exec_sql_text(plan_handle)
    where cacheobjtype = 'Compiled Plan'
    ORDER BY usecounts DESC;
    GO
    and now let's write some SELECT in "fuzzy case"
    dbcc freeproccache
    go
    select * from [HUMANResources].[vEmployeeDepartmentHistory]
    go
    select * from [HumanRESOURCES].[vEmployeeDepartmentHistory]
    go
    select * from [HumanResources].[VEmployeeDepartmentHistory]
    go
    select * from [HumanResources].[vEmployeeDEPARTMENTHistory]
    go
    select * from [HumanResources].[vEmployeeDepartmentHISTORY]
    go
    SELECT * from [HumanResources].[vEmployeeDepartmentHistory]
    go
    select * FROM [HumanResources].[vEmployeeDepartmentHistory]
    go
    and now let's see compiled plans again
    SELECT usecounts, cacheobjtype, objtype, text
    FROM Sys.dm_exec_cached_plans
    CROSS APPLY sys.dm_exec_sql_text(plan_handle)
    where cacheobjtype = 'Compiled Plan'
    ORDER BY usecounts DESC;
    GO
    So, write a SELECT statement in different ways is not the same thing!!!
    Hope it'll be useful
    P.Ceglie

    Yes.  There is little or no query normalization that happens in front of the query plan cache.  It would be a performance tradeoff to parse and normalize the query before matching it to the cached plans.  The benefit of reducing the number
    of plans in the cache probably wouldn't be worth it. 
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Select statement from a join file deletes the primary records with MS Expl.

    Hello,
    is reality,
    Select statement from a join file deletes the primary records with MS Explorer 6, Firefox not, this with a normal data provider or with a normal "select..." statement.
    This is very strange, I should have a.a.s.p. a solution or workaround
    Thanks, Franco.
    Message was edited by:
    fbiaggi

    Please see the following excerpt from the online documentation.
    http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_modes.htm#SUTIL1332
    Enabled Constraints
    During a direct path load, the constraints that remain enabled are as follows:
    NOT NULL
    UNIQUE
    PRIMARY KEY (unique-constraints on not-null columns)
    NOT NULL constraints are checked at column array build time. Any row that violates the NOT NULL constraint is rejected.
    Even though UNIQUE constraints remain enabled during direct path loads, any rows that violate those constraints are loaded anyway (this is different than in conventional path in which such rows would be rejected). When indexes are rebuilt at the end of the direct path load, UNIQUE constraints are verified and if a violation is detected, then the index will be left in an Index Unusable state. See "Indexes Left in an Unusable State".

  • HT201335 Hi.  I have an apple tv and am able to mirror the image on my ipad to my tv, however it doesn't fill the full screen.  Is there a way to get a full image on my 32" Tv.  Thanks a lot for your help

    HI.I have an apple TV and am able to mirror the image on my ipad onto the screen.  However, it doesn't fill the full 32" screen.  Is there some way to project a bigger image onto the Tv.  Thanks for your help

    Welcome to the Apple Community.
    Mirroring won't fill the TV screen. The iPad has an aspect ratio of 4:3 and the iPhone 4S or prior an aspect ratio of 3:2, neither of these will fit exactly into a TV screen which as an aspect ratio of 16:9. The Apple TV will not zoom the mirrored image, because it may well cut off information which is situated at the top or bottom of the screen.
    You may wish to try each of the settings in ‘Settings > Audio & Video > Adjust for AirPlay overscan’ for the best setting that suits you.

  • Function or method which returns the full PDC path of webdynpro iview

    Hi All,
    I have created a webdynpro application and created a webdynpro Iview in portal and attached this view to a role.  I am looking for any standard function module or method which returns the full PCD path of the webdynpro iview, when it executed from portal.
    Regards,
    H.K.Hayath Basha.

    Well in ABAP, we don't have portal APIs to access potal catalog info.
    The only available Portal Interface is IF_WD_PORTAL_INTEGRATION
    Abhi

  • How can servlet return the output as html content with drawing picture?

    Does anybody know how can a servlet return the output as html content with drawing picture?
    The drawing picture is drawn at runtime by the servlet.

    Thanks, BalusC.
    But I am not sure if I understand your reply fully.
    From my understanding, you are telling me to first generate a html from a servlet with the image <IMG> tag pointing to a servlet which will be responsible to generate an image?
    For example, <IMG SRC="http://myserver/servlet/testservlet">
    Could you confirm this?

  • View or function to return the full path hierarchy of an organization

    Hi,
    The customer is asking to provide a report showing for each assignment of each employees the corresponding organization where it is assigned and the full path of the organization hierarchy.
    The organization hierarchy is at most 6 level deep, so they want to produce the report with the columns:
    root_organization | org_level1 | org_level2 | org_level3 | org_level4 | org_level5 | org_level6 | person_name | assignment_date
    if the person is assigned in an organization lower than the 6th level, the remainin columns should be empty.
    I see that the view HRFG_ORGANIZATION_HIERARCHIES returns only one step in the organizations hierarchy: Parent_organization_name, Child_organization_name.
    Is there any view or function as well which returns the full path of an organization in the hierarchy? At least a function which returns the full path parents of the organization delimited by commas.
    Thank you

    Hi,
    Yes, I wrote a custom code but is running a bit slowly for around 1000 organizations and more than 15 version of hierarcy (so 15000 rows of this view). I wanted to know if there is any optimized code provided by Oracle.
    Thank you.

  • Initial JNDI context doesn't return the root node

    Hi :
    I just deployed a java application on Netweaver CE 7.2, when the application starts up, the code is trying to perform a JNDI bind and lookup operations by calling " Context context = new Initialcontext(), context.bind(), context.lookup("...)", the problem is that the initial context returned is not the root context (i.e. "/"), it's something like "webcontainer/applications/vendor-name/application-name/module-name/...." etc.. This is a problem for us because our application is consisted of multiple ears with multiple modues(wars) inside each ear, each module needs to publish a set of services as JNDI entries and those services (JNDI entries) need to be accessible to other ears or modules, which means they have to be published under some public directory (for exmaple the root directory), it can NOT be published under the current context of the current module.
    So,  my questions is, is there a way to make the "new Initialcontext()" to return the root directory, perhaps by changing the deployment descriptor or configuration settings somewhere? thanks a lot for your help.

    Hi,
       Add this code to the <i>wdDoModifyView()</i> method:
    IWDRoadMap rdMap = (IWDRoadMap) view.getElement("<id of the RoadMap UI>");
    rdMap.mappingOfOnSelect().addSourceMapping("step","selectedStep");
    Edit the StepSelected action to add a parameter called "<i>selectedStep</i>" of type String. After this the signature for the action handler will look like:
    public void onActionStepSelected(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, String selectedStep )
    Inside the action handler you can access the selected step simply as "<i>selectedStep</i>".
    Regards,
    Satyajit.

  • Select for update that doesn't return any rows

    Are there any odd side-effects that may occur if a select for update that returns no results is never committed? I wouldn't think there are, but I'm not sure if there would be some kind of overhead or unforeseen consequences. This isn't a terribly important question, but it's come up in some coding I've done and I've not been able to find any documentation addressing it.

    A select for update only locks rows that meet the predicate specified in the where clause. So, if the query returns no rows, no rows are locked.
    session1> SELECT * FROM t;
            ID DESCR
             1 Un
             5 One
             2 THIS IS WA
    session1> SELECT * FROM t
      2  WHERE id = 11 FOR UPDATE;
    no rows selectedA second session can update rows in the table
    session2> UPDATE t
      2  SET descr = 'One'
      3  WHERE id = 1;
    1 row updated.John
    Edited by: John Spencer on Jan 7, 2009 1:36 PM
    I just realized that, although you can do updates on the table after the select fo update that returns no rows, you cannot do DDL operations liike a truncate. Unless the session that does the select for update either ends the transaction (i.e. commit or rollback) or ends the session DDL operations will fail.

  • Output count of SELECT statement is diff from count(*) of the same query

    Has this ever happened to you?
    I was wondering why some of the items were not appearing in my output. I have this select query:
        SELECT
            bukrs
            gjahr
            hkont
            belnr
            wrbtr
            dmbtr
            matnr
            bschl
            kunnr
            vbeln
            shkzg
        FROM bseg
        INTO CORRESPONDING FIELDS OF TABLE i_output
        FOR ALL ENTRIES IN i_bkpf
        WHERE
            bukrs EQ i_bkpf-bukrs
            AND belnr EQ i_bkpf-belnr
            AND gjahr EQ i_bkpf-gjahr
            AND hkont IN hkont
            AND hkont IN
                ('0004000000',
                '0004000010',
                '0004000020',
                '0004000030',
                '0004000040')
    When I tried to put sample filters (bukrs: 1000; belnr 1800000016; gjahr: 2005; hkont: 4000000), I am getting 3 entries from bseg. But when I tried using SE16 or SE16N, I am getting 6 (which is the expected output). When I modify the same SELECT query to return just the output count, I AM getting 6.
        SELECT count(*)
        FROM bseg
        INTO count
        FOR ALL ENTRIES IN i_bkpf
        WHERE
            bukrs EQ i_bkpf-bukrs
            AND belnr EQ i_bkpf-belnr
            AND gjahr EQ i_bkpf-gjahr
            AND hkont IN hkont
            AND hkont IN
                ('0004000000',
                '0004000010',
                '0004000020',
                '0004000030',
                '0004000040')
    Do you have any idea why this happens? My internal table is a standard table with no header line and no OCCURS statement.
    Kyle

    Hello Kyle,
    Thats because when using FOR ALL ENTRIES, it will delete the duplicates if the records selected dont have all the primary keys specified in the select query. In your first select query, the field BUZEI is missing which makes the records unique. Change your first select query as this and try
    SELECT
            bukrs
            gjahr
            hkont
            belnr
            buzei   -------> Add this and check
            wrbtr
            dmbtr
            matnr
            bschl
            kunnr
            vbeln
            shkzg
        FROM bseg
        INTO CORRESPONDING FIELDS OF TABLE i_output
        FOR ALL ENTRIES IN i_bkpf
        WHERE
            bukrs EQ i_bkpf-bukrs
            AND belnr EQ i_bkpf-belnr
            AND gjahr EQ i_bkpf-gjahr
            AND hkont IN hkont
            AND hkont IN
                ('0004000000',
                '0004000010',
                '0004000020',
                '0004000030',
                '0004000040')
    Vikranth

  • Distinct Count doesn't return the expected results

    Hi All,
    I was fighting a little trying to implement a Distinct Count measure over an account dimension in my cube. I read a couple of posts relateed to that and I followed the steps posted by the experts.
    I could process the cube but the results I'm getting are not correct. The cube is returning a higher value compared to the correct one calculated directly from the fact table.
    Here are the details:
    Query of my fact table:
    select distinct cxd_account_id,
              contactable_email_flag,
              case when recency_date>current_date-365 then '0-12' else '13-24' end RECENCY_DATE_ROLLUP,
              1 QTY_ACCNT
    from cx_bi_reporting.cxd_contacts
    where cxd_account_id<>-1 and recency_date >current_date-730;
    I have the following dimensions:
         Account (with 3 different hierarchies)
         Contactable Email Flag (Just 3 values, Y, N, Unknown)
         Recency_date (Just dimension members)
    All dimensions are sparse and the cube is a compressed one. I defined "MAXIMUM" as aggregate for Contactable Email flag and Recency date and at the end, SUM over Account.
    I saw that there is a patch to fix an issue when different aggregation rules are implemented in a compressed cube and I asked the DBA folks to apply it. They told me that the patch cannot be applied because we have an advanced version already installed (Patch 11.2.0.1 ).
    These are the details of what we have installed:
          OLAP Analytic Workspace       11.2.0.3.0 VALID
          Oracle OLAP API 11.2.0.3.0 VALID
          OLAP Catalog 11.2.0.3.0 VALID
    Is there any other patch that needs to be applied to fix this issue? Or it's already included in the version we have installed (11.2.0.3.0)?
    Is there something wrong in the definition of my fact table and that's why I'm not getting the right results?
    Any help will be really appreciated!
    Thanks in advance,
    Martín

    Not sure I would have designed the dimensions /cubes as you,  but there is another method you can obtain distinct counts.
    Basically relies on using basic OLAP DML Expression language and can be put in a Calculated Measure, or can create two Calculated measures
    to contain each specific result.  I use this method to calculate distinct counts when I want to calculate averages, etc ...
    IF account_id ne -1 and (recency_date GT today-365) THEN -
    CONVERT(NUMLINES(UNIQUELINES(CHARLIST(Recency_date))) INTEGER)-
    ELSE IF account_id ne -1 and (recency_date GT today-730 and recency_date LE today-365) THEN -  
    CONVERT(NUMLINES(UNIQUELINES(CHARLIST(Recency_date))) INTEGER)-
    ELSE NA
    This exact code may not work in your case, but think you can get the gist of the process involved.
    This assumes the aggregation operators are set to the default (Sum), but may work with how you have them set.
    Regards,
    Michael Cooper

  • ResultSet.getString(String) doesn't return the right text from database

    Hi everybody,
    I'm trying to read some text in Portuguese from a MS-Access database, but the special characters for Portuguese aren't correctly translated by ResultSet.getString(String).
    Here's my piece of code:
    private static void fetchEquipamentoEstabelecimento()
    try
    Statement stmt = conn.createStatement();
    ResultSet rs = stmt.executeQuery(
    " SELECT Eqp.NumSerie, Eqp.Estabelecimento, Estab.Nome, Estab.Cidade, Eqp.Data, Eqp.LPN " +
    " FROM Equipamento Eqp, Estabelecimento Estab " +
    " WHERE TabPreco = 23 " +
              " AND Eqp.Estabelecimento = Estab.Estabelecimento " +
    "ORDER BY NumSerie DESC");
    while(rs.next())
    String nome = rs.getString("Nome");
    System.out.println(rs.getLong("NumSerie")      + " " +
                             rs.getDate("Data")           + " " +
                             rs.getString("LPN")           + " " +
                             nome                              + " " +
                             rs.getString("Cidade"));
    stmt.close();
    catch(SQLException ex)
    printSQLException("fetchEquipamentoEstabelecimento()", ex);
    The output of this piece of code is 1 record joined from tables Equipamento and Estabelecimento:
    111222333 2001-12-15 JHK Pal<X>cio Cristal Guarda
    where the <X> is the greek letter beta. I was expecting a
    portuguese character which is an a with an accent: � (I hope the character was correctly displayed for you)
    I tried replacing
    String nome = rs.getString("Nome");
    with
    String nome = new String(rs.getString("Nome").getBytes(),codepage);
    with codepage="Cp860" (MS-DOS Portuguese)
    and codepage="Cp037" (USA, Canada (Bilingual, French), Netherlands, Portugal, Brazil, Australia)
    but other strange characters were displayed instead of the a with an accent.
    In the MS-Access table Estabelecimento, the column Nome has a Data Type of Text.
    I'm using:
    - JDK 1.2.2
    - MS Access 2000 (in Windows 2000)
    MS Access 97 (in Windows NT 4.0).
    Any help is deeply apreciated.

    Hi!
    When you establish connection to database, try explicitly give instructions about what encoding use your DB, e.g.:
    // connection properties
    Properties connInfo = new Properties();
    connInfo.put("user", username);
    connInfo.put("password", password);
    connInfo.put("charSet", "Cp1251"); // enter your codepage!!!
    // getconnection
    Connection db = DriverManager.getConnection(dataurl, connInfo);

  • When i close the tab it doesn't return the last active tab

    My english is not so good, so i'm sorry about this. I want to return last active tab when i close a tab.
    Example; I'm using 2. tab then i switch 4. tab, and close it. Firefox switches me to 5. tab, not 2. I made some google search but i can't find anything useful.

    There is a browser.tabs.selectOwnerOnClose pref to define the behavior when you close a tab, but this only works for links opened in a new tab by clicking the link in this specific tab.
    You can open the <b>about:config</b> page via the location bar.
    *http://kb.mozillazine.org/about:config

  • ITunes doesn't return to full volume after a phone call

    At work I use iTunes on a 32-bit Windows 7 machine.  We use Microsoft Lync for phone calls.
    My settings are set so that Windows reduces the volume of applications by 80% when I have a phone call.  This works just fine.  If I leave the music playing during the call, then when I finish the call, it will return to the normal volume.
    However, if I pause iTunes during the call, then the volume does not return to normal, and I have to use the volume mixer to fix it.  Is there a solution to this?

    Anyone have any thoughts on this?

Maybe you are looking for

  • Error in SE16n - PIR exsist only in EINE table & does not exist in EINA tab

    Hello All, This is regarding error in Pucrahsing Info Record in which PIR only exist in EINE table & not in EINA table. This is not normal behavior of SAP standard. In this issue we are able to see P. Info Record (5300083719) details in EINE table on

  • How do I change track names manually?

    How do I change track names manually?

  • Put the right sign in the right place

    I'm not even sure if Captivate 4 can do this, but I want to have quiz that gets the students to put the right sign in the right place. i.e. a hard hat sign on a photo of a building site.  Student would have a list of sign images and it would be a cas

  • Basic Questions regarding InterMedia

    Hi, I have few questions related to this Intermedia. 1. is it client-server kind of software piece? I mean will it needed to be installed on each and every user's machine? 2. Just to make sure , it's a programmatic way to do the conversion from text

  • EM 11g - Anyone have any ideas when it might be out

    I'd like to evaluate EM but just wondering if I should do it now or hold off. Depends on the availability of the next release. Does anyone have any ideas as to when that might be. Thanks, Richard