String concatenation help

Thsi got to be easy for most of you but not to this newbie. Can u help? thanks in advance.
have following items in a page, I need to insert each item into a table if item value is not null .
example:
proj1 has value 09-23
proj2 has null value
proj3 has value 09-45
=== my pl/sql====
declare
indx number default 0;
p_value varchar2;
begin
for z in 1..3
loop
p_value := v(proj)||z; /* here is my issue on how to identify the item with correct suffix */
if P_value is not null then
indx := indx +1;
insert into project (seq,proj)
values (indx,p_value);
end if;
commit;
end loop;
end;
Expected table insert data
series proj
1     09-23
2     09-45 Many thanks
Zeng

hi,
temp := 'proj' || z ;
p_value := v(temp); /* here is my issue on how to identify the item with correct suffix */
Regards,
Shijesh

Similar Messages

  • 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

  • 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.

  • Sort a string :: Please help.

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

    Hello Everyone,
    I am having this very simple problem of sorting a String. please help.
         static String sortString(String str){
              List list = Arrays.asList(str);                    
              Collections.sort(list);
              for(int i=0, n=list.size();i<n;i++){
                   System.out.println(","+ list.get(i));
                   return str;
    The function is supposed to take a String and sort it & print it out. This should be simple. Where am I making mistakes? Please help!!

  • 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.

  • 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.

  • Pass username and password ADFS without using query string, Please help.

    pass username and password ADFS without using query string, Please help.
    I used query string , but it is unsecured to pass credentials over url, with simple tool like httpwatch , anyone can easily get the password and decrypt it.

    Hi,
    According to your post, my understanding is that you had an issue about the ADFS.
    As this issue is related to ADFS, I recommend you post your issue to the forum for ADFS.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=Geneva
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding and support.
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • 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?

  • 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.

  • 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

  • PL?SQL block for string concatenation

    Hi,
    I have written the following procedure for concatenating the strings from different tables. This is working fine if I run this is SQL commands. But If I put the same in HTMLDB report region, I am getting error "Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-06550: line 1, column 8: PLS-00103: Encountered the symbol "" when expecting one of the following: begin function package pragma procedure subtype type use form current cursor"
    I am not able to resolve this.. Please help me..
    DECLARE
    CURSOR C_Lscape
    IS
    SELECT PL.pl_id pl_id,PL.partner_name partner_name,
    PL.area area,PL.region region,PL.country country,
    PL.tier tier,PL.type type,PL.category category,
    PL.market_segment market_segment,PL.parent parent,
    PL.geo_focus geo_focus,PL.opn_id opn_id,PL.opn_level opn_level,
    PL.opn_status opn_status,PL.opn_expirydate opn_expirydate,
    pd.types types,pd.apac apac,pd.region pd_region,
    pd.country pd_country,pd.value value,pd.sub_value sub_value,
    acc.acc_territory_assigned acc_territory_assigned,acc.industry industry,
    acc.industry_segment industry_segment,acc.solution_segment solution_segment,
    acc.product product,acc.solution_name solution_name,acc.apac acc_apac,
    acc.region acc_region,acc.country acc_country,
    ad.agreement_type agreement_type,ad.adreement_date adreement_date,ad.credithold_status credithold_status,
    ad.agreement_number agreement_number
    FROM PARTNER_LANDSCAPE_PL PL
    ,PARTNERLANDSCAPE_DETAILED PD
    ,AGREEMENT_DETAILS AD
    ,ACCELERATE_SOLUTION ACC
    WHERE PL.pl_id=pd.pl_id
    AND ACC.PL_ID=PL.PL_ID
    AND AD.PL_ID=PL.PL_ID
    AND (( PL.partner_name=:p18_partner
    AND PL.partner_name!='%null%')
    OR ( PL.country=:p18_country
    AND PL.country!='%null%')
    OR ( PL.region=:p18_region
    AND PL.region!='%null%')
    OR ( PL.area=:p18_area
    AND PL.area!='%null%')
    OR ( PL.category=:p18_category
    AND PL.category!='%null%')
    OR ( PL.market_segment=:p18_marketsegment
    AND PL.market_segment!='%null')
    OR ( PL.tier=:p18_tier
    AND PL.tier!='%null%')
    OR ( PL.GEO_FOCUS=:p18_geofocus
    AND PL.GEO_FOCUS!='%null%')
    OR ( pd.sub_value=:p18_industry
    OR :p18_industry!='')
    OR ( pd.value=:p18_gtmi
    OR :p18_gtmi!='')
    OR ( pd.value=:p18_productfamily
    OR :p18_productfamily!='')
    OR ( pd.sub_value=:p18_solutionarea
    OR :p18_solutionarea!='')
    l_lscape VARCHAR2(4000);
    BEGIN
    FOR i IN C_Lscape
    LOOP
    l_lscape := i.pl_id||' : '||i.partner_name||' : '||i.area||' : '||i.region||' : '||i.country||' : '||i.tier||' : '||i.type||' : '||i.category
    ||' : '||i.market_segment||' : '||i.parent||' : '||i.geo_focus||' : '||i.opn_id||' : '||i.opn_level||' : '||i.opn_status
    ||' : '||i.opn_expirydate||' : '||i.types||' : '||i.apac||' : '||i.region||' : '||i.pd_country
    ||' : '||i.value||' : '||i.sub_value||' : '||i.acc_territory_assigned||' : '||i.industry
    ||' : '||i.industry_segment||' : '||i.solution_segment||' : '||i.product||' : '||i.solution_name
    ||' : '||i.acc_apac||' : '||i.acc_region||' : '||i.acc_country||' : '||i.agreement_type||' : '||i.adreement_date
    ||' : '||i.credithold_status||' : '||i.agreement_number;
    END LOOP;
    dbms_output.put_line(l_lscape);
    END;
    Regards,
    Pa

    I'm doing something similar to what you want to accomplish.
    First, I created a view that joins the master and detail tables together. The view uses the STRAGG function ahead of time to concatenate multiple details into one "column" (or field).
    Next, in my report region, the SQL query lloks like :
    SELECT   dep_id, dev_st, oper_tp, sig, NAME,
             commod, commod_group,
             MIN (usgs_num) KEEP (DENSE_RANK FIRST ORDER  BY mt_rec ASC) usgs_num,
             MIN (model_name) KEEP (DENSE_RANK FIRST ORDER  BY mt_rec ASC) model_name,
             MIN (country) KEEP (DENSE_RANK FIRST ORDER  BY l_line ASC) country,
             MIN (state_prov) KEEP (DENSE_RANK FIRST ORDER  BY l_line ASC) state_prov,
             MIN (county) KEEP (DENSE_RANK FIRST ORDER  BY l_line ASC) county,
             MIN (lat_dec) KEEP (DENSE_RANK FIRST ORDER  BY g_line ASC) lat_dec,
             MIN (lon_dec) KEEP (DENSE_RANK FIRST ORDER  BY g_line ASC) lon_dec,
             mas_id, mrds_id
    FROM     NEW_MASTER_QUERY1
    WHERE    dep_id IN
        (SELECT dep_id
         FROM search_table where &P3_WHERE_CLAUSE. )
    &P3_SEARCH_AREA.
    GROUP BY dep_id, dev_st, oper_tp, sig, NAME, commod, commod_group, mas_id, mrds_idEach of the lines above with the MIN() function are "fields" which come from different child tables. My view is getting data from 6 tables, and I only display the data in one line.
    Hope this helps some.
    Bill Ferguson

  • Efficient string concatenation

    Hi,
    In my function module, I have to return many values as just one value - a comma seperated string. Performance is important as there could potentially be more than one hundred thousand values being concatenated.
    As the values themselves may have commas in them, I need to escape such commas by a "\" character. I then would also need to escape a "\" character by another "\" character. Standard escape mechanism. Nothing special.
    I have listed here are some possible options. Although my pseudo code does not show it, I am looping over the data values. mySingleValue holds the current value.
    I am inclined towards option 3 being the best in terms of performance. However, I would appreciate your feedback or any newer suggestions that you may have.
    Thank you in advance for your help.
    Pradeep
    Option 1:
    data: myReturnValue type string.
    REPLACE ALL OCCURENCES OF '' IN mySingleValue BY '\'.
    REPLACE ALL OCCURENCES OF ',' IN mySingleValue BY ','.
    CONCATENATE myReturnValue  mySingleValue INTO myReturnValue SEPARATED BY ','
    Option 2:
    data: myReturnValue type string.
    data: myReturnValueLen type i.
    REPLACE ALL OCCURENCES OF '' IN mySingleValue BY '\'.
    REPLACE ALL OCCURENCES OF ',' IN mySingleValue BY ','.
    WRITE ',' TO myReturnValue+myReturnValueLen.
    myReturnValueLen = myReturnValueLen + 1.
    WRITE  mySingleValue TO myReturnValue.
    myReturnValueLen = myReturnValueLen + STRLEN( mySingleValue ).
    OPTION 3:
    data: myReturnValue type string.
    data: myReturnValueLen type i.
    data: ch TYPE char1.
    WRITE ',' TO myReturnValue+myReturnValueLen.
    myReturnValueLen = myReturnValueLen + 1.
    len = STRLEN( mySingleValue ).
    DO len TIMES
      ch = mySingleValue(sy-index).
      if ch EQ '' OR ch EQ ','.
        WRITE ',' TO myReturnValue+myReturnValueLen.
        myReturnValueLen = myReturnValueLen + 1.
      ENDIF.
      WRITE ch TO myReturnValue+myReturnValueLen.
      myReturnValueLen = myReturnValueLen + 1.
    ENDDO.

    Hi,
    Why wouldn't you try reg. expr.
    See also http://help.sap.com/saphelp_nw2004s/helpdata/en/42/9d6ceabb211d73e10000000a1553f6/frameset.htm
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • Arraylist and string split help

    i want to add items from a textfile into an array list here is the txt file
    Title,Artist
    tester,test
    rest,test
    red, blue
    here is the code i am using
    try{
      FileReader fr = new FileReader(fileName);
    BufferedReader br = new BufferedReader(fr);
    String s;
    int c = 0;
    while((s = br.readLine()) != null) {
      c=c+1;
      CD c3 = new CD("");
      String tokens[] = s.split(",");
            for(String token : tokens) {
          System.out.println(c);
           System.out.println(tokens.toString());
              if ( c == 2){
                c3.setTitle(token);
                    System.out.println(c);
                     System.out.println(token);
             c = c+1;
                  if ( c == 3 ){
                    c3.setArtist(token);
                    discsArray.add(c3);
                      System.out.println(token);
                    c = 1;
              System.out.println(token); }}
    fr.close();
    }catch (Exception e){
          System.out.println("exception occurrred");
      }here is the output of the array
    title: tester artist: tester title: rest artist: tester title: red artist: red
    as you can see it misses the last line of the textfile and also doesnt display all of the separated string;
    thanks any help is appreciated

    thanks for ur help but that wasnt the problem
    i have fixed it however when its read all the lines
    an exception is always thrown
    everything works just crashes at the end
    any ideas
    try{
      FileReader fr = new FileReader(fileName);
    BufferedReader br = new BufferedReader(fr);
    String s;
    int c = 0;
    while((s = br.readLine()) != null) {
      c=c+1;
      CD c3 = new CD("");
      String tokens[] = s.split(",");
            for(String token : tokens) {        
              if ( c == 2){
                c3.setTitle(token); 
                      c = c+1;
              if ( c == 3 ){
                    c3.setArtist(token); 
           if ( c == 3 ){
                    discsArray.add(c3);
                    c = 1; 
    fr.close();
    br.close();
      }catch (Exception e){
          System.out.println("exception occurrred");
      }

  • Problem reading a string:Plz help

    hi gurus
    I am reading some files (in a loop written by some other program). I am reading them line by line and I tokenize each line by space using split function.
    split(" ");
    In resultant string array, somewhere I found NULL or nothing , for example, I print all tokens and it prints like this
    ?penguins/nns? // I print ?on both sides to check any spaces
    ?march/nnp?
    ?? // now here is problem.. both ? combined..nothing between them
    I have checked the file.. this problem occurs where there are multiple spaces between tokens of a line...if I remove others and keep one space it works..
    Now I want to implement a check in program i.e. where there is SPACE or NULL, I should not process it but It does not work
    Please help
    Edited by: kimskams on Sep 30, 2008 4:51 AM

    Thanks a Lot Sir
    There is another problem that I am facing now..
    I am using this statement
    while ( (rec=dis.readLine() ) != null )to read a line from a file. What I have observed is that if there is a gap between two line then it stops executing file there and even does not go for further files..
    Can you identify the problem or better solution
    thanks

Maybe you are looking for

  • Wifi not realy working...

    When I am at home, my settings say that I am on my wifi, but only in settings. The edge icon will not go away, and it seems to be running at normal edge slow speed. I go back to network settings, and it says wifi is active and on the correct network.

  • How to create multi-level style pulling in a .jpg image as a bullet?

    From within RoboHelp 8 HTML, when creating/editing a 3-tier multi-level style, I want to use a .jpg image for the bullet(s).  I can not find a way to point to the image while in Edit mode.  My only choices are predefined bullets for the List Style. W

  • Secure link to iTunes store failed.. how do i fix this problem?

    I tried to updates my Ipod touch 4g to IOS 5.0.1 but it said i can't connect to the serve and when I Run Diagnostics on Itune everything is fine except A Secure link to iTunes store failed.... anyone know how to fixed it?

  • Problem in executing Linux command from Java Programme.

    hi everybody, can anybody help me to solve one problem i have. i want to capture the output of linux command "grep" in my java programme.but it is not working properly .(maybe this sub-process doesn't have permission to read files) here is my code an

  • No Sound Production

    Hello; I am an experienced linux/unix user and I've never had this problem before, but I'm rather desperate because I can't find a solution, upon STW I came to realize that many people have this problem, but none have a solution applicable to my syst