Reg: Analysis BLOB and download in rows and columns-

Hi Experts,

I have a requirement, that I met him, but isn't a very good approach. You will appreciate your suggestions on this.

There is a column of type BLOB, when a CSV file is downloaded using the interface of the APEX. I am the analysis and break the BLOB i.e. CSV values using regular expressions and insert rows in table for later use in n columns.

Note: The downloaded CSV file assumes the maximum of 50 columns.

Like this:


-/ / Convert BLOB on the CLOB type

() DBMS_LOB.converttoclob

v_clob, v_blob,

DBMS_LOB. LOBMAXSIZE,

v_dest_offset, v_src_offset,

v_blob_csid, v_lang_context, g_msg

);

-/ / Find total no of records

l_length: = DBMS_LOB.getlength (v_clob);

l_records: = (l_length-LENGTH (REPLACE (v_clob, CHR (10))) + 1;)


BECAUSE me IN 1.l_records

LOOP

v_pos1: = CASE WHEN (i = 1) THEN 1 ELSE (DBMS_LOB. InStr (v_clob, Chr (10), 1, i-1)) END;

v_pos2: = CASE WHEN (I = l_records) AND (l_length) ELSE (DBMS_LOB. InStr (v_clob, Chr (10), 1, i));

v_substr: =.

(BOX WHEN i = 1 THEN

DBMS_LOB. SUBSTR (lob_loc = > v_clob, amount = >(v_pos2-v_pos1), offset = > 1)

ON THE OTHER

DBMS_LOB. SUBSTR (lob_loc = > v_clob, amount = >(v_pos2-v_pos1)-1, offset = > v_pos1 + 1)

    END );

-----------------------------------------------------------

-/ / The data in each row are still divided into separate columns

-----------------------------------------------------------

insert_table. EXTEND();

insert_table (insert_table..) (Sqid LAST): = i;

insert_table (insert_table. LAST) .c001: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,1,'i',2);

insert_table (insert_table. LAST) .c002: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,2,'i',2);

insert_table (insert_table. LAST) .c003: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,3,'i',2);

insert_table (insert_table. LAST) .c004: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,4,'i',2);

insert_table (insert_table. LAST) .c005: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,5,'i',2);

insert_table (insert_table. LAST) .c006: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,6,'i',2);

insert_table (insert_table. LAST) .c007: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,7,'i',2);

insert_table (insert_table. LAST) .c008: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,8,'i',2);

insert_table (insert_table. LAST) .c009: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,]*)',1,9,'i',2);

insert_table (insert_table. LAST) .c010: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 10, « i », 2) ;

--

insert_table (insert_table. LAST) .c011: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 11, « i », 2) ;

insert_table (insert_table. LAST) .c012: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 12, « i », 2) ;

insert_table (insert_table. LAST) .c013: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 13, « i », 2) ;

insert_table (insert_table. LAST) .c014: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 14, « i », 2) ;

insert_table (insert_table. LAST) .c015: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 15, « i », 2) ;

insert_table (insert_table. LAST) .c016: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 16, « i », 2) ;

insert_table (insert_table. LAST) .c017: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 17, « i », 2) ;

insert_table (insert_table. LAST) .c018: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 18, « i », 2) ;

insert_table (insert_table. LAST) .c019: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 19, « i », 2) ;

insert_table (insert_table. LAST) .c020: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 20, « i », 2) ;

--

insert_table (insert_table. LAST) .c021: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 21, « i », 2) ;

insert_table (insert_table. LAST) .c022: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 22, « i », 2) ;

insert_table (insert_table. LAST) .c023: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 23, « i », 2) ;

insert_table (insert_table. LAST) .c024: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 24, « i », 2) ;

insert_table (insert_table. LAST) .c025: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 25, « i », 2) ;

insert_table (insert_table. LAST) .c026: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 26, « i », 2) ;

insert_table (insert_table. LAST) .c027: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 27, « i », 2) ;

insert_table (insert_table. LAST) .c028: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 28, « i », 2) ;

insert_table (insert_table. LAST) .c029: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 29, « i », 2) ;

insert_table (insert_table. LAST) .c030: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 30, « i », 2) ;

--

insert_table (insert_table. LAST) .c031: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 31, « i », 2) ;

insert_table (insert_table. LAST) .c032: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 32, « i », 2) ;

insert_table (insert_table. LAST) .c033: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 33, « i », 2) ;

insert_table (insert_table. LAST) .c034: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 34, « i », 2) ;

insert_table (insert_table. LAST) .c035: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 35, « i », 2) ;

insert_table (insert_table. LAST) .c036: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 36, « i », 2) ;

insert_table (insert_table. LAST) .c037: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 37, « i », 2) ;

insert_table (insert_table. LAST) .c038: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 38, « i », 2) ;

insert_table (insert_table. LAST) .c039: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 39, « i », 2) ;

insert_table (insert_table. LAST) .c040: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 40, « i », 2) ;

--

insert_table (insert_table. LAST) .c041: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 41, « i », 2) ;

insert_table (insert_table. LAST) .c042: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 42, « i », 2) ;

insert_table (insert_table. LAST) .c043: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 43, « i », 2) ;

insert_table (insert_table. LAST) .c044: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 44, « i », 2) ;

insert_table (insert_table. LAST) .c045: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 45, « i », 2) ;

insert_table (insert_table. LAST) .c046: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 46, « i », 2) ;

insert_table (insert_table. LAST) .c047: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 47, « i », 2) ;

insert_table (insert_table. LAST) .c048: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 48, « i », 2) ;

insert_table (insert_table. LAST) .c049: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 49, « i », 2) ;

insert_table (insert_table. LAST) .c050: = REGEXP_SUBSTR (v_substr,'(^|,?) ([^,] *)', 1, 50, « i », 2) ;

-----------------------------------------------------

END LOOP;

Data entry example:

998,9012238422,600454892,,7/1/2014,337555.11,493.06,,545.21,,,2,1104.93,,,563.5,,,1.75,100,,M,3,545.21,,7/8/2014,337555.11,0,0,,0,,338100.32,338100.32,

998,9044033,656848127,,7/1/2014,104269.9,533.3,,163.09,,,6.5,726.88,,,565.68,,,6.128,100,,M,3,163.09,,7/8/2014,104269.9,0,0,,0,,104432.99,104432.99,

998,2011011,426985586,,1/1/2013,74134.99,380.78,,236.58,,,6.5,520.82,,,805.06,,,6.144,100,,M,3,236.58,,7/2/2014,74134.99,0,0,,0,,74371.57,74371.57,

Please notify.

Let me know if you need some other information about it.

Thank you and best regards,

Nordine

(on Oracle 11.2.0.3.0)

Writing the BLOB in the disc and using an external table are likely to be more effective.

Disadvantage: you must serialize the process to ensure that simultaneous sessions do not alter the location of the external file.

A function in Java-based pipeline could also be an option, or even a custom parser csv (free regex) written in PL/SQL.

Tags: Database

Similar Questions

  • Max rows and columns

    What can be the maximum number of rows and columns, you can have in a table in an oracle database?

    See the limits of logical database in http://download.oracle.com/docs/cd/E11882_01/server.112/e17110/limits003.htm#i288032.

  • How to Exchange rows and columns where to access the paper web in html IE

    Hi all!

    I use web analytics studio Oracle hyperion with Version: 11.1.1.2.0.940. Design of web document analysis, I use the spreadsheet, then turn to the analysis view, I can swap the row and column position by dragging and pulling.

    But when I access the document by the smartcut in ie browser, opening in the html template, how can I exchange line and column position?

    Thank you very much in advance.

    OK, I think I understand what you're saying. The problem is that it does not show the left pane with a smartcut.

    Here's a tip. Add a button of 'Service '. Add "Information Toggle Pane" as the service.

    When you click the button that will open the left handle in HTML view panel. You will then see row and column and you should be able to switch the dimensions as needed. I just tested and it works.

    hope that helps.

  • How to change the rows and columns of newtabs?

    I can't change the rows and columns to mozilla version 33

    From topic: config browser.newtabpage.columns shows 5 by default, but these 5 columns appear not only 3 as before. Don't know why, but I use generally not even the default new tab page in my profile daily.

    Still works this - https://addons.mozilla.org/en-US/firefox/addon/new-tab-tools/ - extension to change the page of newTab via a user accessible interface name in the Addons, rather than routing autour Manager inside Firefox. I use this add-on in a second profile that I use for my favorite sites

  • How can I insert a number to a specific index (row and column) to a table

    I had the most with function 'insert into array' problem because of its counter-intuitiveness. I want to insert a number I got inside a loop IN a table. The ROW and COLUMN of this table I want enter the number is specified by the number of loops of two loops FOR. It did not work.

    So, I have isolated and tested this function further. Frankly, I initialized a table 2D with ZEROS and plugged into the "insert into array" function (on top of entry). I then put the number '1' for the index (line) and the number "2" for the index (column) and then put the entry number "6" for the "new item/sub-table. Then, I hung a picture of 2-D (indicator) output to the output of the function "insert into array. When I did all that, it means I want to just put the number '6' in line '1' and the column '2'... This isn't letting me do it.

    How can I do this SIMPLE?

    Hi Darrell h...,

    Looks like you can use the function "autoindexing. Take your value and connect it to your loop, it will be a default autoindexing. Right-click on the last tunnel of output and select Create indicator, the result is your table.

    It will be useful.

    Mike

  • Download the news lines and columns of a table Cluster

    I have a table with a cluster of 2 elements (string and double). In my application, I use the architecture of State Machine with a Structure of the event. When I click on an item in the table of the bunch, is there a way to retrieve the row and column? I saw the coordinates within the mouse event to the bottom, but I don't think it will work.

    Any ideas?

    How to return the Index of a table of mouse-Select item:

    https://decibel.NI.com/content/docs/doc-6406

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • Obtaining of row and column of a table element

    Hello

    I have a table of 24 rows and column 24 giving me a total of 576 items. How can I get the row and column of a particular element in a table in LabView. For example if I write to item 127 How can I get the column and line item 127 is located.

    Kind regards

    Bastien

    Hi Marion,.

    Maybe just need to find the right "address" element in your 2D table?

    Use something like this:

    Maybe you have to out of line & column according to your numbering scheme...

  • Write multiple rows and columns of the worksheet

    Is it possible to write several rows and columns of the spreadsheet, with the ability to add data to the file and create a new file if it does not exist?
    I tried to write to table vi, but I couldn't make it work.
    It won't let me write several lines in the same column.
    Can someone please give me an example?
    Thanks in advance.

    If you want to use the tab character (\t) as the delimiter, then check the txt file.  Then Excel will open as you wish.

    If you want to keep the csv extension, then use comma (,) as a separator.

  • How can I enlarge a photo after analysis there and its importation of photo gallery. ? I have Hp photosmart

    Yet once how can I enlarge a photo after analysis he and his photo gallery import?

    Hi ClydeVan Slyke,

    I suggest you to follow the steps in the article below and check if it helps.

    Resize photos in Windows Live Photo Gallery

    http://Windows.Microsoft.com/en-us/Windows-Vista/resize-photos-in-Windows-Live-Photo-Gallery

    I hope this helps!

  • I ran the system analysis tool and without result updates still won't work.

    * Original title: Windows 7 updates

    It seems I'm not the only one having problems with the updates of Windows 7. I ran the system analysis tool and without result updates still won't work. Is it possible miss me a the question .dll file not showing? I googled about it and still nothing.

    Appreciate any info someone might have on this

    Are there specific error messages or error report numbers given when it fails, or is it just apparently running, but does not find anything?

    If it is running, but apparently not finding anything, just leave it for a while 'loooooong. It was reported a few recent Wu take many hours to find anything, esp if she has a lot of updates to find and install.

    If its reports an error/message number, what (exactly) do report?

    Something to try:

    Update your anti-virus software and run a full scan. Then:

    If its doesn't work, check that service 'Windows Update' and 'Background Intelligent Transfer' are listed and running, according to the instructions of the ' how to check if services are running' section of this article - https://support.microsoft.com/en-us/kb/2730071 IF you have actually the error referred to in article, try the FixIt.

    If WU and BITS services are listed and running, try to reset the Windows Update components - https://support.microsoft.com/en-us/kb/971058

    If still no joy, run the update utility - http://windows.microsoft.com/en-US/windows7/Open-the-Windows-Update-troubleshooter what makes as that report?

  • How to copy/paste in rows and columns

    Let's say I have an object in PS (gummy bear for example) and I want to duplicate in rows and columns. Is there a way to do it automatically?

    1. open your file of gummy bear and resize the image to a smaller, if necessary.

    2 file > set the model. Name it and ok.

    3. open a new file, 8 x 10, for example

    4 edit > fill > model... and in the Custom model drop-down list, it will be the last of them. Choose it.

    5. click on OK

    Fact.

    If your want a space between gummy bear, add space in step 1

    Good luck

  • How to read the data of BLOB and save to the file system

    Hi friends.

    I have called DEMO table there image stored as a BLOB. now my requirement is to know how to read the data of BLOB and saved in the file system. is there a procedure
    to read the blob object and stored in the file system. pls suggest me with an example.
    Thank you

    HI - don't know what version you have, but have a read through this:

    http://www.Oracle-base.com/articles/9i/ExportBlob9i.php

    Hoek link is to import the blobs in the db, it is export, to a file.

  • Sortable rows and columns

    Is it possible to drag and drop the rows and columns of a multicolumn script to rearrange them. If this isn't the case, it would be appropriate.

    Please write to us.

    We do not expect to support mobile in an AV Scripts columns because they are only 2 columns fixed in script format.

    If you create a script to multiple columns and click on a column heading, you will end up by selecting the contents of that column. Press CTRL-X to cut this column, then press CTRLV to paste the column somewhere before an existing column.

    This should solve your problem.

    -Anubhav

    Anubhav Rohatgi

    Senior product manager

  • Rows and columns help

    Previously on AI9 when I wanted to change a matrix that I created using rows and columns, I select the cells in the matrix and then click rows and columns.  Now I have CS4 and the documentation says that I should be able to do the same thing using the Options of the Type of area.  However, when I select the cells of a matrix that I created in AI9, Options of Type box is ghost out.  How to change this matrix?

    I would copy and paste in front before I try this.

    Then select the text which is place the text cursor in the text frame, you want to split or select it with the selection tool.

    then see if the Type > text box Options are available. They should be.

    If this isn't the case, it means they aren't object path text box.

    Click on the image with the tool text box to make a block of text in box now the options should be available.

    The way to know if these are paths of purpose is to select one and go to object > path > split into grid and if it's available, then it is an object path.

    The text engine and this feature was changed to AI CS1 and this is probably the cause of the translation to be a little messed up.

Maybe you are looking for

  • 100 - 14iBR mouse does not

    Hello as the title suggests, I opened my laptop aged 4 last week to see a windows (windows 10) update, we started the pc I could not use the touchpad, note: keys work fine It will work with a plugin usb mouse but that defeats the purpose of a laptop,

  • In Vista, APC Index Mismatch blue screen error

    I recently started getting this error. I'm not entirely sure of what he calls, but I have some information here: Signature of the problem:Problem event name: BlueScreenOS version: 6.0.6001.2.1.0.256.1Locale ID: 1033 More information about the problem

  • problem to get the current date in qml

    Hello world I'm trying to get the current date in c ++ and qml and I used the class QDate, but it still has some problems: Code: ===================================================== QDate * nowdate = new QDate;QDeclarativePropertyMap * nowdateMap =

  • EBS database backup

    Hi allEBS R12.211 GR 2Rhel6.5We have set up a physical standby for our EBS R12.2 db.To save the resources of the PRIMARY, we do RMAN backup on the standby only and not in primary SCHOOL. Is this a good practice?Thank you very muchJC

  • RMAN - restoring Controlfile

    I'm trying to restore a controlfile from an earlier date.RMAN > backup controlfile listFull 146395371.50 MSBT_TAPE00:00:2614 DECEMBER 14 19:27:11BP key: 1463956 status: EXPIRED Tablet: NO Tag: TAG20141214T192638Handle: ctrl_uaipq5s3l_s54610_p1_t86631