conversion of a clob entry in a collection

Hi I have a function that has a CLOB to entry. The input value is concatenated to multiple values. I need to separate and process the data. Here is an example of sample function. Can someone help me on this please. I'm not able to get any solution.

l_orders CLOB Chennai | $| Mumbai | $| Delhi | $| Amsterdam | $| Brazil | $| ......... | $| Hyderabad

Now I need to enter the values as below in a collection

l_orders (1) chennai

l_orders (2) Mumbai

l_orders (3) Delhi

Amsterdam l_orders (4)

l_orders (5) Brazil

.

.

.

.

l_orders (6000) Hyderabad

These values, I need to spend in the table and make a DML operation under certain conditions. I'm helpless on how to extract the CLOB entry in a collection.

I use version oracle 11g.

It looks to...

Another look: the CLOB is transformed in a way that allows for handlng as an xmltype.

Your particular case, it's that you are having just a single column (your | $| is Chr (10) in the solution) and you should get a result set single column to be processed according to your needs (you might be more comfortable to add a line number using keyword ordinalite to maintain order CLOB)

Concerning

Etbin

If you are having trouble:

with

data in the form of

(select to_clob ('Chennai | $|)) Mumbai | $| Delhi | $| Amsterdam | $| Brazil | $| Hyderabad') the_clob

of the double

)

Select rn, col1

data,.

XMLTable ('/ a/b ')

from xmltype ('': replace (the_clob, ' | ')) $| ','')||'')

columns

RN to ordinalite,

col1 varchar2 (100) path '.'

) x

RN COL1
1 Chennai
2 Mumbai
3 Delhi
4 Amsterdam
5 Brazil
6 Hyderabad

Tags: Database

Similar Questions

  • While the BLOB conversion of type CLOB error - ORA-06502: PL/SQL: digital error or value

    Passing data from attachment of DB (Blob data Type) after the CLOB data type conversion, giving the error "ORA-06502: PL/SQL: digital error or value" in the PL/SQL package. If the BLOB size 32K > it will give another error works great my procedure.

    For example, I enclose my code here.

    function get_base64 (p_blob_in in blob) return clob is

    CLOB v_clob;

    CLOB v_result;

    whole v_offset;

    v_chunk_size PLS_INTEGER: = 12288;

    v_buffer_varchar varchar2 (32767).

    v_buffer_raw raw (32767).

    Start

    fnd_file.put_line (fnd_file.log, 'here');

    If p_blob_in is null then

    Returns a null value.

    end if;

    DBMS_LOB.CREATETEMPORARY (v_clob, true);

    fnd_file.put_line (fnd_file.log, 'here1');

    v_offset: = 1;

    fnd_file.put_line (fnd_file.log, 'Loop value'-| ceil (DBMS_LOB.) GetLength (p_blob_in) / v_chunk_size));

    because me in 1... ceil (DBMS_LOB. GetLength (p_blob_in) / v_chunk_size) loop

    DBMS_LOB. Read (p_blob_in, v_chunk_size, v_offset, v_buffer_raw);

    v_buffer_raw: = utl_encode.base64_encode (v_buffer_raw);

    v_buffer_varchar: = utl_raw.cast_to_varchar2 (v_buffer_raw);

    DBMS_LOB. WriteAppend (v_clob, length (v_buffer_varchar), v_buffer_varchar);

    v_offset: = v_offset + v_chunk_size;

    end loop;

    fnd_file.put_line (fnd_file.log, 'Out of the loop');

    v_result: = v_clob;

    fnd_file.put_line (fnd_file.log, 'V_result length' - |) DBMS_LOB. GetLength (v_result));

    fnd_file.put_line (fnd_file.log, 'V_result' - | v_result);

    DBMS_LOB.freeTemporary (v_clob);

    Return v_result;

    exception

    while others then

    fnd_file.put_line (fnd_file.log, 'Error based on the encode_base64' - |) SQLERRM);

    Returns a null value.

    end;

    In my main program I call this function as below:

    Main proceedings...

    l_return_clob CLOB.

    Begin

    ....

    l_return_clob: = get_base64 (p_blob_in);

    -In returning it gives error - ORA-06502: PL/SQL: digital error or value

    end;

    Then, please mark the thread ANSWERED.

  • adding all entries from one collection to another?

    Hello

    my database is a 11g

    I have a function (in a box) than returnes a collection.

    I want to call the function multiple times and the caller must combine all entries selected in a single collection (new?):

    create or replace package my_test is
      procedure public_proc;
    end my_test;
    
    create or replace package body my_test is
    
    cursor test_data(selected_type varchar2) is
      select (1+ABS(MOD(dbms_random.random,100000))) as id, selected_type||level as my_value from dual connect by level<5;
    
    type my_type is table of test_data%row_type;
    
    function private_function(selected_type varchar2) return  my_type is
      v_my_type my_type := my_type();
    begin
      open  test_data(selected_type=> selected_type);
      fetch  test_data bulk collect into  v_my_type;
      close  test_data;
      return  v_my_type;
    end  private_function;
    
    procedure public_proc is
      v_my_type_a my_type := my_type();
      v_my_type_b my_type := my_type();
      v_my_type_ab my_type := my_type();
    begin
      v_my_type_a := private_function(selected_type=>'A');
      v_my_type_b := private_function(selected_type=>'B');
      -- simplest solution to combine  v_my_type_a and  v_my_type_b to  v_my_type_ab, possible without explicit loop?
    for i in  v_my_type_ab.first..v_my_type_ab.last loop
        dbms_output.put_line('id: '||v_my_type_ab(i).id||', value:'||v_my_type_ab(i).my_value);
    end loop;
    end public_proc;
    end my_test;
    

    desired output (x instead of random number):

    id:x, value:A1
    id:x, value:A2
    id:x, value:A3
    id:x, value:A4
    id:x, value:B1
    id:x, value:B2
    id:x, value:B3
    id:x, value:B4
    
    

    Good bye

    DPT

    I can also do a big collect in against a collection of nested type?

    OK – what a trick question?

    You ask if you can do what the code you first published already does?

    Hmmm - well, I'll say YES - since your code is already doing it.

    What type of collection, exactly, do you think that you have agreed with this line?

    type my_type is % row_type test_data table;

    Of course, 'row_type' is not valid; It is % ROWTYPE.

    If you are unsure what type of collection which is then I suggest that you only consider "with the help of the Collections of PL/SQL and Records" in the language PL/SQL doc

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/Collections.htm

    He explained each of the collection types, explain how to choose one that suits and examples of their use.

    DECLARE

    cursor emp_data (my_job emp.job%type) is select *.

    from emp where job = my_job;

    type my_emp_data is table of the emp_data % rowtype;

    my_emp_data v1.

    my_emp_data v2.

    my_emp_data v3;

    BEGIN

    Open emp_data ("REGISTRAR");

    extraction emp_data bulk collect in v1;

    close emp_data;

    Open emp_data ("SELLER");

    extraction emp_data bulk collect in v2;

    close emp_data;

    v3: = v1 v2 of MULTISET UNION;

    for me in v3.first... loop v3. Last

    dbms_output.put_line (v3 (i) .ename |) ' - ' || V3 (i) .job);

    end loop;

    END;

    /

    SMITH - CLERK

    ADAMS - CLERK

    JAMES - CLERK

    MILLER - CLERK

    ALLEN - SELLER

    WARD - SELLER

    MARTIN - SELLER

    TURNER - SELLER

    Also note that I do NOT use a query to combine collections:

    v3: = v1 v2 of MULTISET UNION;

  • Conversion tables and the entries in the table

    I'm working on a conversion table for our former products of FM unstructured to DITA. I understand the basic concepts, but I'm having a problem with the table cells.

    I have P:CellBody in my conversion table, in the first row, mapped at the entrance with a cellbody qualifier.

    I also TC mapped at the entrance.

    The same applies to P:CellHeading, and Th.

    Therefore, my text is wrapped in two input elements. The context tab to show the item says:

    entry

    entry

    line

    TBODY

    tgroup

    Table

    body

    NoName

    NoName

    I'm sure it should be the same as above with the input only one element (and of course with the fixed NoNames which I think I know how to do; I just have not had here yet).

    How to avoid get my cells wrapped in two input elements?

    Thanks in advance,

    Marsha

    Marsha,

    I don't understand what you're trying to do, or what is exactly in your conversion table. Be aware, however, that FrameMaker will always create elements for the basic elements that occur in your tables. The table of conversion that you give little control of how these items will be marked, but not question whether elements will exist.

    If your conversion table contains lines such as:

    P:CellBody entry cellbody
    TC: entry

    You will get the nested input elements. External is the cell of the table itself and inside is the paragraph. FrameMaker does not have a valid document to use the tag of the element itself to a cell and a container, so aside from the results is not what you wanted, they are not correct in FrameMaker.

    If your table cells contain simple paragraphs and you don't want the elements for cells and paragraphs, your conversion table didn't even need to mention paragraph CellBody and CellHeading tags. Indeed, if your table formats using CellBody as paragraph format for cells in the body of a table and CellHeading as the paragraph format for the cells in the table, your ESD header didn't even apply the paragraph formats.

    Another alternative is to include a paragraph tag in a table row of conversion for a table cell by combining TC: and P: to match table cells containing such paragraphs. For example:

    TC: P:CellBody entry

    creates items named cell entry of table cells containing paragraphs tag CellBody. The paragraph in such a cell is not encapsulated in an extra element.

    One final note is that TH: in a conversion table refers to the position of the entire table. his children are header lines. The analogue of table of TH body: to:, not TC.:

    -Lynne

  • conversion of a delimited list of a collection

    Hello
    
    Version 11g r2
    create or replace type jobcheck_type  as object   ( 
    jid VARCHAR2(250),
    jname VARCHAR2(250),
    jtot_mesgs NUMBER,
    jsuccess NUMBER,
    jfailure NUMBER,
    jstart_time TIMESTAMP,
    jcompleted_time  TIMESTAMP,
    jstatus VARCHAR2(50),
    jversion NUMBER
     )
    /
    
    
    create or replace type jobchecktab_type  as table of jobcheck_type
    /
    Now   
    select * from table(jobchecktab_type(jobcheck_type(null,'A,B',30,30,0,null,null,null,null)));
    
    The output is 
    
    null A,B 30 30 0 null null ...
    
    But what I need is
    
    null A 30 30 0 null null
    
    null B 30 30 0 null null
    
    if 
    select * from table(jobchecktab_type(jobcheck_type(null,'A,B,C,D',30,30,0,null,null,null,null)));
    Then output required is 
    
    But what I need is
    
    null A 30 30 0 null null
    
    null B 30 30 0 null null
    
    null C 30 30 0 null null
    
    null D 30 30 0 null null
    
    I'm passing the comma separated values one of the value(jname) in collection and rest other values in collection are constant.
    
    From some reason, I would be needing that to be done in select statement  only i.e select * from table(jobchecktab_type .....
    
    
    

    No problem here:

    Select the IADB

    regexp_substr (jname, ' [^,] +', 1, level) jname,.

    jtot_mesgs,

    jsuccess,

    jfailure,

    jstart_time,

    jcompleted_time,

    jstatus,

    jversion

    from (select *)

    table (jobchecktab_type (jobcheck_type (null, 'A XXXX_YYY, AAAA X, Sweep NEM', 30, 30, 0, null, null, null, null)))

    connect by level<= length(regexp_replace(jname,="" '[^,]+',="" ''))="" +="">

  • Conversion/extraction of CLOB

    Hello.

    We are able to insert CLOB in the database, using oracle Text I'm able to search inside clob.
    [two issues resolved]
    The question arises when we need to send these data to demand either as text (varchar2) file.

    I'm able to generate files of CLOB using the function, unfortunately it is located inside the db and developer is not able to access.
    1) there is a possibility to mount the partition of application inside the db and export the file there, but this isn't a viable option according to the direction.
    (2) I google the solution to create a JAVA API. Who will perform the command OS like scp to send file to db to app (or any remote host).
    For security reasons, this option is also removed.
    (3) I tried dbms_lob.substr but text inside clob is too long. File generated from CLOB size about 5 MB.
    So I guess it takes a lot of effort if I wanted to convert in varchar2 as parameter inside the exit function.

    So, to give CLOB data developer under file or varchar2. I'm not able to get any solution.
    Y at - it another option using database to convert to string/varchar2 CLOB?
    Or do I need to dig more into the third option.

    I have oracle 10.2.0.5.

    Kind regards
    Dave.

    application developer to manage the clob issue.

  • Digital or value error on the conversion of the clob to SMLType

    Hello
    What I'm trying to do is
    (i.) pass a value of xml string to the Oracle query variable
    II.) use this XML as part of a join in a query and retrieve the results.

    Approach:
    Input variable type is CLOB and then running the petition below:

    declare
    TestXML clob.
    Start
    textxml: = ' < table1 > < root > < none > 1 < /no > < / root > < root > < none > 2 < / > < non-root / > < / table1 > '

    Open: csr for
    Select tt.no
    de)
    Select xmltype.extract (value (a), ' root/no/text()').getstringval () than no.)
    table (xmlsequence (sys.xmltype(:testxml). Extract('/table1/root'))) a
    ) tt
    Tt.no group;
    end;

    Problem:
    The request as written above wake up a digital error or value to sys.xmltype (ORA-06502 & ORA-06512). But if I declare the testxml as varchar2; It works very well. Searched wrong, but without success.

    Ideas please!

    Other info: Oracle 10g, tool: PL/SQL Developer (Allround Automations).
    3 days on Oracle; on SQL Server 7 years... :) {so be a bit elaborate}
    Spacing of code does not work :( How do we code tags in this forum?

    Published by: rajeev.ranjan on May 11, 2009 07:43

    XMLTABLE usage example:

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure get_nos(p_rc OUT sys_refcursor) is
      2    testxml clob;
      3  begin
      4    testxml := '12';
      5    open p_rc for
      6    select tt.no
      7    from (
      8      select no
      9      from xmltable('/table1/root/no' passing xmltype(testxml) columns no number path '/no/text()')
     10      ) tt
     11    group by tt.no;
     12* end;
    SQL> /
    
    Procedure created.
    
    SQL> var rc refcursor
    SQL> exec get_nos(:rc);
    
    PL/SQL procedure successfully completed.
    
    SQL> print rc;
    
            NO
    ----------
             1
             2
    
    SQL>
    
  • Why collected addresses included in the personal address since v38

    I used to have collected address book and the personal address book. Since V38, entries in the collected addresses are now in personal addresses as well. I do have duplicates. When I delete an entry for the home address, it is also deleted in the collected addresses if it was in the two places, it should not been, according to the previous version of tuberculosis. Have I missed a new parameter and if not, why the change? It defeats the purpose of having separate addresses.

    Maybe you missed the creation of address ALL appearing at the top of the list of address book now book? Missing would give the impression that collected address were in the personal address book.

  • collection type parameter [11.2] based on the table in pipeline?

    Hello

    I have a collection of type "table of ' which is filled iteratively. (he gets the new entries more of a souce)

    I need to sort the entries in this type of collection as well as the criteria.

    My approach is to use a function table in pipeline which offers individual entries as lines for a "select from table (my_function (the_collection)).

    My problem is that I get a compilation error in this query statement:

    [Error] PLS-00382 (1209:70): PLS-00382: Dieser Lutherischen hat den falschen type-> expression is of the wrong type

    [Error] PLS-00306 (1209:51): PLS-00306: wrong Anzahl oder Typen von illuminated by von call "ma_fonction"-> wrong number or type of arguments

    [Error] ORA-00904 (1209:25): PL/SQL: ORA-00904: "my_package." "" ma_fonction "-> is not a valid identifier

    but this feature is present in the package body and declared in the package header.

    the entries in the collection are declared as record types in the package header

    the collection of parameter type is declared as 'IS THE INDEX BY a_table.varchar2_attribute%TYPE my_record_type TABLE.

    the package compiled until I added the request.

    so my questions are:

    1. What is the best way to sort the types of collection (by 2 attributes)?

    2. how to pass a parameter of type of collection to a table of pipeliened function?

    Good bye

    DPT

    This approach has proved to work well.

    I created a temporary table to collect the data in. At this point, I use the MERGE statement to remove duplicates.

    I sort everything in refetching this temporary table data.

    Good bye

    DPT

  • write data to a collection

    Hi all

    I am concerned about data entry in a collection (NameValuePair) of two elements to help assign the activity. data is the string information and below is part of the xsd: -.

    < element name = "Data" maxOccurs = "1" minOccurs = "0" >
    < complexType >
    <>sequence
    < element name = "NameValuePair" maxOccurs = "unbounded".
    minOccurs = "0" >
    < complexType >
    < sequence minOccurs = "1" >
    < element name = "name" type = "string" / >
    < element name = "value" type = "string" / >
    < / sequence >
    < / complexType >
    < / item >
    < / sequence >
    < / complexType >
    < / item >


    resemble my activities of entitlement: -.
    < from > "Parent simultaneous Req ID" < / from >
    < to > $Invoke_InputVariable.payload/ns20:Data/ns20:NameValuePair[1]/ns20:name < /pour >
    < / copy >
    < copy >
    < a > $Receive_ConcReqID_InputVariable.Response / ns10:ConcRequestID < / from >
    < to > $Invoke_InputVariable.payload/ns20:Data/ns20:NameValuePair[1]/ns20:value < /pour >
    < / copy >
    < copy >
    < from > "Child Errored Req ID" < / from >
    (line 626) < to > $Invoke_InputVariable.payload/ns20:Data/ns20:NameValuePair[2]/ns20:name < /pour >
    < / copy >
    < copy >
    < from > $Invoke_ConcRequestsQuery_DB_QueryChildJob_DetailsSelect_OutputVariable.FndConcurrentRequestsCollection/ns9:FndConcurrentRequests[$ForEachCounter]/ns9:requestId < / from >
    < to > $Invoke_InputVariable.payload/ns20:Data/ns20:NameValuePair[2]/ns20:value < /pour >


    But however, I get an error when executing 'Exception is thrown because the in-specs on line 626 are assessed to be empty.


    Could someone suggest how I should get this done... If there is a more correct approach, pls suggest.

    concerning
    Rakesh

    Hi Rakesh,

    If you change your entitlement and right-click on the bellows of the expression, you should see the options of 'ignoringMissingFromData' and 'insertMissingToData '... In my view, that this last will solve your problem...

    See you soon,.
    Vlad

  • To loop through a collection arrayCollection

    I need to:

    1 loop through a collection of table,

    2. Select a specific string in this collection

    3 extract a url this string

    4. Insert an additional string to the table with that extracted url

    The code I use to date is:

    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"minWidth ="1024"minHeight ="768"> "
    < mx:Script >
    <! [CDATA]
    Import mx.collections.ArrayCollection;
    Import mx.rpc.events.ResultEvent;

    [Bindable]
    private var resultArrayCollection:ArrayCollection;

    private void doSearch (e:MouseEvent): void
    {
    twitterSearch.url = " " http://search.Twitter.com/search.atom?q=LDN ";
    twitterSearch.send ();
    }

    private function onResult (e:ResultEvent): void
    {
    resultArrayCollection = e.result.feed.entry as ArrayCollection collection;
    }

    []] >
    < / mx:Script >

    < mx:HTTPService id = "twitterSearch.
    result = "OnResult (Event)" / > "

    .....


    the HTTP service pulls in data from Twitter for example search http://search.Twitter.com/search.atom?q=LDN .

    Any help would be received with gratitude.

    Please remove the quotes-"[count].

    for(var count:int = 0; count < resultArrayCollection.length; count++) {
         trace(resultArrayCollection[count].title);
    }
    
  • Store an uncertain number of entry in the table

    Hi, I am new to java, and even if I make a practice of the input of entrance of the store array I have a question like this:

    If we want to use the table, we must create the table and require that give us the size of the array.

    For example, if I know I will have ten full entries, I can simply store an array like: int [] intArray = new int [10];

    But what happens if we are not sure about the number of entries, it could be 10, it could be 20.

    Can I create an array with an uncertain size? Or I shouldn't use table to store the entry?

    Collections. And more specifically lists.

    Tables are fine when they are good, but especially you should use Collections. And in this case you should use list.

    List myints = new ArrayList();
    myints.add(1);
    myints.add(15);
    myints.add(-3);
    myints.add(6);
    // etc
    for( int i : myints){
      System.out.println(i);
    }
    

    See: http://download.oracle.com/javase/tutorial/collections/index.html

  • Verity &amp; lt; cfsearch &amp; gt; Returns &amp; quot; collection is not &amp; quot; error - when the collection is

    I created a collection using the Coldfusion Administrator - and this shows when viewing of all collections. I also filled the collection using < cfindex > - by using a SQL query - and that seems to work well. He put 117 entries in the collection - and this appears also in the Coldfusion Administrator recoveries.

    The problem is when I try to search the collection with the < cfsearch > tag, it returns an error indicating "collection that you specified does not exist or is not registered with the ColdFusion Search Service."

    I can see the collection that I'm looking for is. Is there anything else I need to do to get the < cfsearch > function to find the collection? I tried to repair the collection, the collection optimization, even delete and recreate - nothing seems to work. I Specifies the full path to the collection in my cfsearch, so that shouldn't be the problem.

    Y at - it another command or feature, I need to run?

    Thank you!!! Pamela

    Quote:
    I Specifies the full path to the collection in my cfsearch

    Not sure if this is the problem. The path exists in the CFAdmin. You can see the name of the collection in the cfsearch tag.

    Code to see the attachment, you can do a cfdump to see what the results are returned.

  • How do I create the table collection


    Here is the format of data that I got: (dd/mm/yy, value)
    2007:12:3, 123
    2007:12:5, 1124
    ....

    After that I got the following data I want to draw a line chart.

    According to the example code provided by Adobe, I need to create an arrayCollection collection, as
    [Bindable]
    public var aapl:ArrayCollection = new ArrayCollection([)
    {date: "2005, 8, 1 ', nearby: 42.71},.
    {date: "2005, 8: 2", nearby: 42.99},.
    {date: "2005, 8, 3 ', nearby: 44}
    ]);

    How can I do?

    A big thank you!

    April



    I'm not very familiar with ACE (I work mainly with Java), but I think you can do it by instantiating an object for each entry in your collection target. Of course, you can dynamically add properties to objects, and so I think you can use the fields xaxis and x-axis of your object chartFormat as field names in a new object. It may well be a much more appropriate way to do! I think something along the lines of:

    var ac: ArrayCollection collection = new ArrayCollection();
    var acEntry: Object = new Object();
    var time: String = "xaxis;
    var value: String = "yaxis";
    acEntry [time] = 1;
    acEntry [value] = 2;
    ac.addItem (acEntry);
    for (var s: String in ac.getItemAt (0))
    {
    Alert.Show (s);
    }

    This will show the names of the properties in the entrance of the collection are 'xaxis' and 'yaxis. If agree you then you just need to create an object for each two entries in your split channels. Only, you need get domain names once, of course (you do not need to get them in each iteration of the loop). I don't know what you need to do in the way of garbage... I don't know if you need to 'remove' the objects when you are finished with them.

    Andy

  • Ask the related Collection

    Hello
    I created a form using the collection.
    I want it. I have 3 fields A, B and C and I want to correct the value of these fields in the form collection when I click Add row button. So much time I click on Add button line these value should be fixed in the columns in the collection.




    Thank you
    Nisha

    Okay, do you want an entry to the collection value via your elements above reports, not through tabular presentation. Is this right?

    If yes you change point 4:

    Start

    htmldb_collection.add_member
    (p_collection_name-online 'COLL_BILL',
    p_c001 =>: ITEM_A,
    p_c002 =>: ITEM_B
    );
    end;

    Condition
    When you press the button
    'Add the line '.

Maybe you are looking for

  • How do I access iCloud on my MacBook?

    I have a MacBook and an iPad, but I'm not really a keen user of iCloud. I'm selling my MacBook and for a certain time will use a PC my wife will buy until my next trip to the United States where Mac is more reasonable prices, then they are in the cou

  • Why firefox spread my symbols?

    http://Tinypic.com/r/5cdk6p/6 http://Tinypic.com/r/10pq2qw/6 guys, honestly... What's wrong here?It all started when I upgraded from 16.0.2 to 17.0, so I used aurora, but it happens again-. -.

  • Follow-up

    On my old Skype why not funcion Nlgercan

  • After making an album, the photos are still under all photos?

    Is there a solution to remove all the photos after creating photo album? Thank you

  • H8 - 1240T recovery disks

    I ordered a set of recovery H8 - 1240T discs.  They will work on both my 1240 t?