How to string concatenation in EL syntax?

We make a construction for setWhereClause
this work:
${empty param.searchDate ? '' : ' AND trunc(akten_ldat) = to_date(\''}${param.searchDate}${empty param.searchDate ? '' : '\',\'dd.MM.yyyy\')'}
and this don't work:
${empty param.searchDate ? '' : ' AND trunc(akten_ldat) = to_date(\'' + param.searchDate + '\',\'dd.MM.yyyy\')'}
Is there a way to make the first construction easier?

Hi,
don't think so because the expression enclosed with the brackets is interpreted by teh EL engine (this is where the "Expression" in EL comes from). The latter syntaxt doesn't describe a valid expression, which is why it fails
Frank

Similar Messages

  • Ora-01489: result of string concatenation is too long

    Hello Gurus,
    i have a typical problem
    i am constructing a query in FORM and writing SQLPLUS script into a .SQL file. file will contain final data like below..
    set linesize 90
    set pagesize 0
    set echo off
    set verify off
    set termout off
    set feedback off
    set trimspool on
    set escape '^'
    spool D:\10GAPPServerappln\xxx\TEMPREP\ADA39057.sql;
    set linesize 229
    select ' IQIS# ,Cust Complaint Short Txt ,CD Short Txt ' from dual;
    set linesize 129
    select a||','||b||','||c||d from table;
    spool off;
    exit;
    After this By using HOST command i will execute the above .sql script and will write the output to text file.
    But problem is when i have clob column in any one of concatenated columns in query (a or b or c) then i am getting the error "Ora-01489: result of string concatenation is too long".
    pls suggest me how to overcome this problem..

    sybrand_b wrote:
    Obviously the || operator is concatenating strings, your CLOB is implicitly converted to a VARCHAR2, which has a 4000 bytes limit.???
    From non-experts who did read documentation:
    CLOB || VARCHAR2 = CLOB:
    SQL> CREATE OR REPLACE
      2  VIEW V1
      3  AS SELECT TO_CLOB('A') || 'A' clob_concat_varchar2 FROM dual
      4  /
    View created.
    SQL> DESC V1
    Name                                      Null?    Type
    CLOB_CONCAT_VARCHAR2                               CLOB
    SQL> SY.

  • Patch 111685 breaks string concatenation!!!

    Patch 111685 for WS6U2 fixes a lot of problems but introduces a massive memory leak in operator+= for std::string. Sun has already acknowledged that it's a serious bug (bug id 4520126) although they are taking forever to fix it:
    This is the test case that we submitted to Sun:
    $ uname -a
    SunOS mildev1 5.8 Generic_108528-09 sun4u sparc SUNW,Ultra-80
    $ CC -V
    CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-01 2001/08/01
    main.cpp
    #include <string>
    int main()
    const char JUNK[] = "JUNK";
    std::string s;
    for (int i = 0; i < 10000; ++i) s += JUNK;
    return 0;
    $ CC -staticlib=Crun,Cstd -g main.cpp -o main
    $ dbx ./main
    Reading main
    Reading ld.so.1
    Reading libm.so.1
    Reading libw.so.1
    Reading libc.so.1
    Reading libdl.so.1
    Reading libc_psr.so.1
    (/pkgs/sun_workshop62/bin/../WS6U2/bin/sparcv9/dbx) check -leaks
    leaks checking - ON
    (/pkgs/sun_workshop62/bin/../WS6U2/bin/sparcv9/dbx) run
    Running: main
    (process id 17850)
    Reading librtc.so
    RTC: Enabling Error Checking...
    RTC: Running program...
    Checking for memory leaks...
    Actual leaks report (actual leaks: 9986 total size: 200142024 bytes)
    Total Num of Leaked Allocation call stack
    Size Blocks Block
    Address
    ====== ====== ========== =======================================
    200142024 9986 - operator new < std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__getRep
    Possible leaks report (possible leaks: 13 total size: 257934 bytes)
    Total Num of Leaked Allocation call stack
    Size Blocks Block
    Address
    ====== ====== ========== =======================================
    257934 13 - operator new < std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__getRep
    execution completed, exit code is 0

    The original message here was posted almost a month ago. The response by ForteSupport clearly confirms the existence of the problem, and I have written my own tests. Since the time when this problem was acknowledged, Sun has released patches for Forte C++ 6U2, in the same patch line (111685-03 updates 111685-02. 02 introduces the leak) but that patch does not address the problem.
    Memory leaks of any type are not acceptable, but this is a nightmare memory leak: it is in library code and it is triggered by a what is a very common operation (string concatenation) in any sort of web or network services product. These are exactly the type of products that cannot tolerate memory leaks, because they have long uptimes.
    This memory leak was introduced in a patch that fixed, among other things, the fact that exceptions were not being caught so that any program that threw an exception aborted. While I find it difficult to understand how problems like these could pass any sort of regression testing, this is not a perfect world, and things do go wrong. But what I find absolutely incomprehensible is that it could take a month to release a fix for this. What is the delay?

  • "a"+"b"+"c", how many String objects created?

    Hello everyone,
    String s = "a" + "b" +"c";
    How many String objects are created?
    I guess 5, is it right?
    regards

    > How many String objects are created?
    >
    I guess 5, is it right?
    Nope. Just one.

  • Connect by - sql help : getting error ORA-01489: result of string concatena

    here is an sql query and I am trying to cook a decode but since there are many columns invloved when I am trying to run this I am getting the following error:
    ORA-01489: result of string concatenation is too long
    Any kind of help is appreciated, I need to get this going otherwise I am dead :(
    Regards
    Rahul
    SQL:
    select sys_connect_by_path(c.decode_prep,'-') decode_prep
    from (select 'DECODE(BIAPPS_11.'||substr(b.all_cols,instr(b.all_cols,',',1,a.rn)+1,instr(b.all_cols,',',1,a.rn+1)-instr(b.all_cols,',',1,a.rn)-1)||','||'RAHULKALRA.'||substr(b.all_cols,instr(b.all_cols,',',1,a.rn)+1,instr(b.all_cols,',',1,a.rn+1)-instr(b.all_cols,',',1,a.rn)-1)||',''1'',''0'')' decode_prep, rownum curr, rownum -1 prev
    from (select rownum rn
    from dual connect by rownum <=
    (select (length('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM')
    - length(replace('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM',',')))+1 total_cols
    from dual)) a, (select ','||'ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM'||',' all_cols from dual) b) c
    start with curr = 1
    connect by prior curr = prev
    order by length(sys_connect_by_path(c.decode_prep,'-')) desc
    same as above sql only difference is here I am pulling the first record from the result set which above query returns :
    select ltrim(replace(decode_prep,'-','||'),'||') decode_prep
    from (select sys_connect_by_path(c.decode_prep,'-') decode_prep
    from (select 'DECODE(BIAPPS_11.'||substr(b.all_cols,instr(b.all_cols,',',1,a.rn)+1,instr(b.all_cols,',',1,a.rn+1)-instr(b.all_cols,',',1,a.rn)-1)||','||'RAHULKALRA.'||substr(b.all_cols,instr(b.all_cols,',',1,a.rn)+1,instr(b.all_cols,',',1,a.rn+1)-instr(b.all_cols,',',1,a.rn)-1)||',''1'',''0'')' decode_prep, rownum curr, rownum -1 prev
    from (select rownum rn
    from dual connect by rownum <=
    (select (length('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM')
    - length(replace('ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM',',')))+1 total_cols
    from dual)) a, (select ','||'ROW_WID,COST_CENTER_NUM,COST_CENTER_NAME,COST_CENTER_DESC,CONTROL_AREA_NUM,CONTROL_AREA_NAME,CATEGORY_CODE,CATEGORY_NAME,CATEGORY_DESC,MANAGER_NAME,CURRENCY_CODE,CURRENCY_NAME,LANGUAGE_CODE,LANGUAGE_NAME,ST_ADDRESS1,ST_ADDRESS2,POST_OFFICE_BOX,CITY_NAME,STATE_CODE,STATE_NAME,REGION_CODE,REGION_NAME,COUNTRY_CODE,COUNTRY_NAME,POSTAL_CODE,PHONE_NUM,FAX_NUM,CSCN_HIER1_CODE,CSCN_HIER1_NAME,CSCN_HIER2_CODE,CSCN_HIER2_NAME,CSCN_HIER3_CODE,CSCN_HIER3_NAME,CSCN_HIER4_CODE,CSCN_HIER4_NAME,CSCN_HIER5_CODE,CSCN_HIER5_NAME,CSCN_HIER6_CODE,CSCN_HIER6_NAME,ACTIVE_FLG,CREATED_BY_WID,CHANGED_BY_WID,CREATED_ON_DT,CHANGED_ON_DT,AUX1_CHANGED_ON_DT,AUX2_CHANGED_ON_DT,AUX3_CHANGED_ON_DT,AUX4_CHANGED_ON_DT,SRC_EFF_FROM_DT,SRC_EFF_TO_DT,EFFECTIVE_FROM_DT,EFFECTIVE_TO_DT,DELETE_FLG,CURRENT_FLG,W_INSERT_DT,W_UPDATE_DT,DATASOURCE_NUM_ID,ETL_PROC_WID,INTEGRATION_ID,SET_ID,TENANT_ID,X_CUSTOM'||',' all_cols from dual) b) c
    start with curr = 1
    connect by prior curr = prev
    order by length(sys_connect_by_path(c.decode_prep,'-')) desc)
    where rownum = 1
    Edited by: Mac_Freak_Rahul on Nov 28, 2012 1:31 AM : in the first sql ')'
    removed after desc in the last line so now this query will run and throw an error.

    Clearly your error is because the string concatenation you are doing with sys_connect_by_path is exceeding the 4000 bytes permitted by SQL.
    In that case you need to concatenate your data into a CLOB datatype, for which you'll need a CLOB aggregation function...
    create or replace type clobagg_type as object
      text clob,
      static function ODCIAggregateInitialize(sctx in out clobagg_type) return number,
      member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number,
      member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number,
      member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number
    create or replace type body clobagg_type is
      static function ODCIAggregateInitialize(sctx in out clobagg_type) return number is
      begin
        sctx := clobagg_type(null) ;
        return ODCIConst.Success ;
      end;
      member function ODCIAggregateIterate(self in out clobagg_type, value in clob) return number is
      begin
        self.text := self.text || value ;
        return ODCIConst.Success;
      end;
      member function ODCIAggregateTerminate(self in clobagg_type, returnvalue out clob, flags in number) return number is
      begin
        returnValue := self.text;
        return ODCIConst.Success;
      end;
      member function ODCIAggregateMerge(self in out clobagg_type, ctx2 in clobagg_type) return number is
      begin
        self.text := self.text || ctx2.text;
        return ODCIConst.Success;
      end;
    end;
    create or replace function clobagg(input clob) return clob
      deterministic
      parallel_enable
      aggregate using clobagg_type;
    SQL> select trim(',' from clobagg(ename||',')) as enames from emp;
    ENAMES
    SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,CLARK,SCOTT,KING,TURNER,ADAMS,JAMES,FORD,MILLER
    SQL> ed
    Wrote file afiedt.buf
      1  with t as
      2    (select 'PFL' c1, 0 c2,110 c3 from dual union all
      3     select 'LHL', 0 ,111 from dual union all
      4     select 'PHL', 1, 111 from dual union all
      5     select 'CHL', 2, 111 from dual union all
      6     select 'DHL', 0, 112 from dual union all
      7     select 'VHL', 1, 112 from dual union all
      8     select 'CPHL', 0, 114 from dual union all
      9     select 'WDCL', 1, 114 from dual union all
    10     select 'AHL' ,2 ,114 from dual union all
    11     select 'NFDL', 3, 114 from dual)
    12  --
    13  -- end of test data
    14  --
    15  select trim(clobagg(c1||' ')) as c1, c3
    16  from (select * from t order by c3, c2)
    17  group by c3
    18* order by c3
    SQL> /
    C1                                     C3
    PFL                                   110
    LHL CHL PHL                           111
    DHL VHL                               112
    CPHL AHL NFDL WDCL                    114

  • String.concat() vs + operator in strings concatenations

    Whats the difference between String.concat() and + operator in strings concatenation?
    I cant find any functional one.
    Are there any performance differences?
    Thanks

    TM-Nite wrote:
    Whats the difference between String.concat() and + operator in strings concatenation?
    I cant find any functional one.There isn't any for all one can tell from the API docs. More details would be up to the String implementation.
    Are there any performance differences?No. Both are bad if repeated a lot, as long as there aren't exclusively compile-time constants involved. Use StringBuilder/StringBuffer instead, in those cases.

  • Running Total String Concatenation

    Hello,
    For our Project we need to do String Concatenation, if data has to display only in Footer Running Total String Concatenation works great. If I have to display in Reports Header or Group Header Running Total String Concatenation. I can work around by having Sub Report to get the data, but I have to Text Rotation to display data in 270 degree. Since Sub report is an object, I canu2019t do that.
    If any one has any better idea let me know.
    Thanks in advance

    Yes,Thanks a lot My Quesition has been answered. I can rotate the data in Subreports.

  • Unexpected "result of the string concatenation is too long" error

    Hello,
    I am using Oracle Database 11.2.0.
    When querying my database with a common table expression which concatenates VARCHAR2 strings, I receive an ORA-01489 error although I'm doubting that I am concatenating more than 4000 characters.
    To be more precise, I have a table entity which basically stores XML elements including their parent element and their sibling position among its siblings. The CREATE statement for this table is listed below.
    CREATE TABLE Entity (
    ID NUMBER(10,0) NOT NULL PRIMARY KEY,
    Name VARCHAR2(100) NOT NULL,
    Parent NUMBER(10,0) REFERENCES Entity(ID),
    Sibling_Pos NUMBER(2,0) DEFAULT 0
    Now, I would like for all elements to be concatenated with their ancestor elements to a structure like this:
    "/root_element(sibling_pos)/.../ancestor_element(sibling_pos)/parent_element(sibling_pos)/current_element(sibling_pos)"
    (where root_element, ancestor_element, parent_element and current_element are just values from the name column of the entity table)
    In order to achieve this, I use a common table expression which concatenates the name and sibling_pos values as shown below:
    WITH entity_cte (lvl, id, path) AS (
    SELECT 1 AS lvl, id, '/' || name || '(0' || sibling_pos || ')' AS path
    FROM entity
    WHERE parent IS NULL
    UNION ALL (
    SELECT lvl + 1 AS lvl, e.id, entity_cte.path || '/' || e.name || '(' || cast(e.sibling_pos AS VARCHAR2(2)) || ')' AS path
    FROM entity_cte, entity e
    WHERE entity_cte.id = e.parent
    SELECT lvl, id, path
    FROM entity_cte e
    After inserting certain values, I get the ORA-01489 error, that the result of the string concatenation is too long. The maximum is referred to as being 4000 characters for VARCHAR2 in the oracle documentation and in various websites. Of course, it is clear to me by just using the common table expression like that, I could run into such an error. However, due to the structure of my XML documents, I doubted that the resulting strings would be more than 4000 characters long.
    So, I rearranged my query in order to count the characters to be concatenated instead of actually concatenating them. The query is stated below as well, the changes are marked bold:
    WITH entity_cte (lvl, id, path) AS (
    SELECT 1 AS lvl, id, length('/' || name ||  '(0' || sibling_pos || ')') AS path
    FROM entity
    WHERE parent IS NULL
    UNION ALL (
    SELECT lvl + 1 AS lvl, e.id, entity_cte.path + length('/' || e.name || '(' || cast(e.sibling_pos AS VARCHAR2(2)) || ')') AS path
    FROM entity_cte, entity e
    WHERE entity_cte.id = e.parent
    SELECT lvl, id, path
    FROM entity_cte e
    ORDER BY path DESC
    The result of the query gives me a maximum length of 319 characters.
    To be sure, I also checked the maximum level depth (indicated by the column named lvl in the common table expression), meaning the maximum number of elements in my path (the concatenated string). The result is 18. As I use VARCHAR2(100) for the name column and add 5 charcaters in each level, the maximum number of characters expected for 18 levels would be 1890.
    So, now I wonder is the ORA-01489 maybe raised for another reason? Or is there something else I am missing?
    Any help would be appreciated. Further suggestions to track down the error are more than welcome. Thanks in advance.

    Thanks for the hint, BluShadow.
    Still, I don't reach that limit of 1000 characters with my actual data (yet). I understand that if my data changes, I might run into that error with the given query. But I don't understand why this error is raised with the given data I have. The longest string in the column "name" is 32 characters long up to now. When I'm adding 5 characters on each level and I only have max 18 levels that should only result in max 2664 bytes.
    @odie_63
    The database characterset is: AL32UTF8. If I googled correctly, than it just confirms what BluShadow said, that one character is represented by max 4 byte.
    Regarding the sample data, the XML document that I am inserting and which causes the error comprises 1058 nodes. That means I have 1058 entries in my entity table. I think it would be no sense posting all of it here, but is there a way that I can attach a text file containing an insert script to this post?
    Some sample data from the entity table orderd by the length of the string in the name column are shown below.
    "ID"     "NAME"     "TYPE"     "PARENT"     "SIBLING_POS"
    90     "representedCustodianOrganization"     1     89     0
    109     "serviceProviderOrganization"     1     108     0
    58     "standardIndustryClassCode"     1     55     2
    186     "standardIndustryClassCode"     1     173     7
    150     "standardIndustryClassCode"     1     137     7
    106     "dischargeDispositionCode"     1     99     4
    35     "administrativeGenderCode"     1     29     3
    932     "substanceAdministration"     1     931     0
    950     "substanceAdministration"     1     949     0
    1043     "representedOrganization"     1     1041     1
    71     "representedOrganization"     1     61     6
    137     "representedOrganization"     1     128     5
    173     "representedOrganization"     1     163     6
    504     "substanceAdministration"     1     503     0
    223     "representedOrganization"     1     221     1
    252     "representedOrganization"     1     250     1
    272     "representedOrganization"     1     270     1
    477     "substanceAdministration"     1     476     0
    481     "manufacturedLabeledDrug"     1     480     0
    207     "representedOrganization"     1     205     1
    802     "specimenPlayingEntity"     1     801     0
    830     "specimenPlayingEntity"     1     829     0
    844     "specimenPlayingEntity"     1     843     0
    858     "specimenPlayingEntity"     1     857     0
    99     "encompassingEncounter"     1     98     0
    788     "specimenPlayingEntity"     1     787     0
    676     "specimenPlayingEntity"     1     675     0
    704     "specimenPlayingEntity"     1     703     0
    718     "specimenPlayingEntity"     1     717     0
    746     "specimenPlayingEntity"     1     745     0
    Any help or further suggestion are appreciated. Thank you.

  • How many string objects - please suggest

    Hi there,
    Can you somebody please tell how many String objects will be created when the following method is invoked?
    public String makinStrings() {
    String s = “Fred”;
    s = s + “47”;
    s = s.substring(2, 5);
    s = s.toUpperCase();
    return s.toString();
    Thanks
    Shan

    Hi VShan,
    This is your code
    public String makinStrings() {
    String s = “Fred”;     //1
    s = s + “47”;            //2
    s = s.substring(2, 5);//3
    s = s.toUpperCase(); //4
    return s.toString();     //5
    EXPLANATION : String is an immutable object, that means the String object cannot change it's contents.It might sound very unfamiliar but it is TRUE. In line 1: You declare a String object by assigning a a String literal "Fred" to the variable s. Now when you concat "47" with the original contents of s , a new memory space is allocated where s is assigned.+It is important to note+ that the previous reference of s i.e. "Fred" will be lost and now s refers to a new memory location where the contents are "Fred47" , so you have created another object in Line 2. Similarly you create another object in line3 & 4.As far my calculations you have created 4 objects.
    I would like you to kindly note that s is already a String so you can directly return s and hence there is no need of s.toString() in Line 5.You should also note that each object is also an eligible candidate for Grabage Collection.
    So as soon as Line2 gets executed , the object in Line1 becomes eligible for garbage collection.. that means when GC runs that object will be reclaimed and hence memory will be freed.

  • How many String objects will be created when this method is invoked?

    public String makinStrings() {
    String s = �Fred�;
    s = s + �47�;
    s = s.substring(2, 5);
    s = s.toUpperCase();
    return s.toString();
    }

    Teachers.Obviously. Why? Is it really important?
    Not in my experience. StringBuffer can be important, occasionally. Very occasionally: about 4 times in the last 10 years for me. How many Strings? not important.

  • Javac string concatenation desugaring

    Where in the JDK7 javac source does string concatenation using pluses (e.g., String s = string1 + string2 + int1;) get desugared into an instantiation of a StringBuilder, with subsequent calls to append, ending with a call to toString? (if this is not actually currently done, what is the equivalent, and where in the javac source does it occur?)
    Thanks.
    FYI: I know that consecutive concatenated literals are combined into a single literal in com.sun.tools.javac.parser.JavacParser.foldStrings(JCTree), but I do not know where the desugaring involving non-literals occurs.
    As a side question, does the compiler also combine non-literals whose values are definitely known, e.g.:
    int i = 0;
    String s = "1";
    String t = i + s;
    t will always be set to "01", but neither of the two arguments to + are literals.

    Okay. Any particular problem you're looking to fix, or just picking this particular area out of general interest?No particular area, just whatever I see. It started out with investigating String/Builder/Buffer inefficiencies, because I noticed them a while ago, but it's grown to anything that I happen to notice.
    Add an instance field named currentDeterminantValue of type Object to whatever class represents a variable in javac. Also add a final static byte[] named NONDETERMINANT. If an assignment is to something that is known at compile time (e.g., a literal, a final variable (i.e. a constant), a determinant return of a final, private, or static method, etc.), then set currentDeterminantValue = <object or boxed primitive>. If the assignment is to something that is unknown at compile time, set currentDeterminantValue = NONDETERMINANT. Also add a method named isCurrentlyDeterminant() to the aforementioned class that performs {return currentDeterminantValue != NONDETERMINANT}. Whenever isCurrentlyDeterminant() is true, perform appropriate optimizations. A similar mechanism can be used for private, static, or final methods, as long as you cannot use reflection or some other weird mechanism to change their behavior. e.g., if the whole body of a final method is {return "ABC";}, then the currentDeterminantValue of the instance that represents that method in javac can be set to "ABC".I forgot to mention that NONDETERMINANT = new byte[] {}; It should also be private. Nothing special about byte[]. It could be an int[], an Object, etc, just an object that will never be used in a real call. An empty array should be the most memory-efficient way to create such a sentinel.
    Not really following that, but it sounds like this applies specifically to member variables, not locals. I don't think what you're suggesting can work for members. To recap your previous example:This would not apply to member or static variables, unless the assignment and use are in the same synchronized block, and all assignments to the variable are synchronized on the same object, and you can somehow disable or ignore the nefarious combination of java.lang.reflect.Class getDeclaredField and Field methods setAccessible and set, and any other similar sneaky tricks if they exist (using those three methods, you can even mutate “immutable” Strings). This would obviously be more difficult to detect than the case of local variables, but member / static variable determinacy determination could be implemented as a later improvement.
    String x = "1";
    int y = 2
    String z = x + y;If x, y, and z are member variables, then between the first and second or between the second and third assignment, another thread can modify x or y, so there's no way that the compiler can know that z will be "12", unless x and y are compile-time constants, and in that case, it already sets z to "12" at compile time.In my example that you've quoted above, the variables are all local.
    There are many complex additional optimizations that javac could perform, but they are probably more easily and comprehensively performed by the jvm given that it knows what other classes have been loaded and their bytecode.

  • PHP string concatenation

    String concatenation is the string manipulation method when you join 2 or more strings together.
    In PHP it is a quite easy task. You can use the concatenation operator which is the u2018.u2019 (dot). You can join 2 or more strings into one as follows:
    $str1 = 'This';
    $str2 = 'is a';
    $str3 = 'string';
    $full = $str1.' '.$str2.' '.$str3;
    echo $full; // This is a string
    Besides this you can use the operator to append a string to an existing one like this:
    $str = 'Main string';
    $str .= ' plus another string';
    echo $str; // Main string plus another string
    If you concatenate a string with a number, the number will (automatically) be converted into a string value, so the output will be u201Cstringu201D:
    $num = 100;
    $str = $num.' is a number';
    echo $str; // 100 is a number
    Trade Show Displays is the retail division of Quality One Engineering.

    Hi skyvia and Circuitbomb welcome to the php forum.
    Thanks for enlightening us with your summary of concatenation which is the most basic function in php and to be honest who care which is faster. If you really care find Sarah Golemon's blog and find the entry on what is happening deep inside php in concatenation. Having said that there are far easier ways to slow down php that do concatenation incorrectly.
    You could read from a database for example. That is bound to be an order of magnitude slower than concatenating strings.
    PHP is fun for a lot of reasons.
    I hope you guys both enjoy SAP and PHP in good measure and contribute the interesting things that you are learning on the forums.
    Cheers,
    Nigel
    Edited by: Nigel James on Oct 28, 2010 12:56 PM

  • Easy Question: How to split concatenated string into multiple rows?

    Hi folks,
    this might be an easy question.
    How can I split a concatenated string into multiple rows using SQL query?
    INPUT:
    select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
    Expected output:
    data
    AAA
    BBB
    CCC
    DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
    Thanks,
    Tomas

    Here is the SUBSTR/INSTR version of the solution:
    SQL> WITH test_data AS
      2  (
      3          SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
      4  )
      5  SELECT  SUBSTR
      6          (
      7                  DATA
      8          ,       INSTR
      9                  (
    10                          DATA
    11                  ,       ','
    12                  ,       1
    13                  ,       LEVEL
    14                  ) + 1
    15          ,       INSTR
    16                  (
    17                          DATA
    18                  ,       ','
    19                  ,       1
    20                  ,       LEVEL + 1
    21                  ) -
    22                  INSTR
    23                  (
    24                          DATA
    25                  ,       ','
    26                  ,       1
    27                  ,       LEVEL
    28                  ) - 1
    29          )       AS NEW_STRING
    30  FROM    test_data
    31  CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
    32  /
    NEW_STRING
    AAA
    BBB
    CC
    DDDD

  • Concatenating a string in a URL syntax does not work (syntax error)

    I am trying to print a Report in PDF format. The code is:
    select '<a href="http://oasdev.oh.gov./reports/rwservlet?GDMS_ACR&Y='||:P106_YEAR||'&B='||:P100_BUSINESS_UNIT_ID||'&C='||:P106_COMMISSION_ID||'&d=('||TO_CHAR(SYSDATE,'MMDDYYYYhhMISS')||')", target=_new> <font color="blue"><b>Print PDF Version of the report</b></font> </a>' url from dual
    GLOBAL_URL should carry the value ( a sring) ----> http://oasdev.oh.gov.
    Therefore I changed it to the following code:
    select '<a href="GLOBAL_URL/reports/rwservlet?GDMS_ACR&Y='||:P106_YEAR||'&B='||:P100_BUSINESS_UNIT_ID||'&C='||:P106_COMMISSION_ID||'&d=('||TO_CHAR(SYSDATE,'MMDDYYYYhhMISS')||')", target=_new> <font color="blue"><b>Print PDF Version of the report</b></font> </a>' url from dual
    But it does not work. Any suggestion would be highly appreciated.
    Thanks in advance.
    Gouri
    Edited by: user1046395 on Dec 8, 2010 8:41 AM

    When you do a select, you need to select into a variable..
    select ' Print PDF Version of the report ' url INTO <Variable>from dual
    Are you trying to run an Oracle Report from APEX??
    If so look at this thread: Using popupURL to call Oracle Reports - Problem passing parameters
    Thank you,
    Tony Miller
    Webster, TX
    When you have enough clowns, you have a circus.

  • How to assign concatenated output to an item on page load

    Hi,
    I have a table that reads something like this
    City Route
    NewYork 2
    NewYork 4
    NewYork 5
    London A
    London B
    Paris X1
    I want to assign Routes (concatenated) to an item on page load... as an example for NewYork it should read like this
    P2_ROUTE = 2, 4, 5
    I am looking to do the above using query, something like this
    select (concatenated route)
    from Table_A
    where
    City = :P2_City
    any suggestions how to concatenate variables.?

    tparvaiz wrote:
    I am looking to do the above using query, something like this
    select (concatenated route)
    from Table_A
    where
    City = :P2_City
    any suggestions how to concatenate variables.?Yes. This is known as string aggregation, and there are many ways to do it. For example:
      Oracle 11.2; list length <= 4000 bytes
    SQL> select
      2      l.city
      3    , listagg(d.department_id, ', ')
      4        within group (
      5          order by d.department_id) departments
      6  from
      7      locations l
      8        join departments d
      9          on l.location_id = d.location_id
    10  group by
    11*      l.city;
    CITY                      DEPARTMENTS
    Bern                      240
    Bombay                      230
    Geneva                      90, 100, 110, 120
    Hiroshima                 170
    London                      40, 260
    Munich                      70
    Oxford                      80
    Seattle                  10, 30, 130, 140, 180, 190, 210, 250
    South Brunswick             150, 160
    South San Francisco            60
    Southlake                 50
    Stretford                 270
    Tokyo                      220
    Toronto                  20
    Utrecht                  200
    15 rows selected.
      Previous versions or 11.2 list length > 4000 bytes
    SQL> select
      2      l.city
      3    , rtrim(
      4          xmlserialize(
      5           content
      6           xmlagg(
      7               xmlparse(content d.department_id || ', ')
      8               order by d.department_id))
      9        , ', ') departments
    10  from
    11      locations l
    12        join departments d
    13          on l.location_id = d.location_id
    14  group by
    15*      l.city;
    CITY                      DEPARTMENTS
    Bern                      240
    Bombay                      230
    Geneva                      90, 100, 110, 120
    Hiroshima                 170
    London                      40, 260
    Munich                      70
    Oxford                      80
    Seattle                  10, 30, 130, 140, 180, 190, 210, 250
    South Brunswick             150, 160
    South San Francisco            60
    Southlake                 50
    Stretford                 270
    Tokyo                      220
    Toronto                  20
    Utrecht                  200
    15 rows selected.See Re: 4. How do I convert rows to columns? and here for more.

Maybe you are looking for

  • Transfer all my accounts to a new Mac

    Hi, I am on a new Mac Pro, and I would like to import all the Mail preferences, accounts, emails, mailboxes... so I can see all my history on my new Mac. Is there a list somewhere of all the files Mail uses that I should import? Thanks!

  • Can I draw a freehand line in a Fill & Sign document?

    Can I draw a freehand line in a Fill & Sign document? I have filled in the form but need to draw a freehand line to indicate the markings on our horse's face.

  • Connection refused problem..., please help.

    I am running the server on PC (Windows 98) and I got this message: java.rmi.ConnectionException: Connection refused to host: 33186; nested exception is: java.net.ConnectException: Connection refused: no further information I got both server and clien

  • Each (automatic) update loses all my passwords (and existing "help" is a nightmare)

    I have read MANY other people experiencing this problem, and I have seen no good answers. (Some answers require several days of parsing, and I don't have that much time.) Every time Firefox updates itself automatically, it loses most of my passwords!

  • Issue with BasicDataSource

    Hello In the struts application I am using datasource org.apache.commons.dbcp.BasicDataSource. inside strutsconfig. and inside the action ds = getDataSource; try{ connnction con = ds.getconnection finally con.close(); But the problem is eventhogh eac