Please help, I need to read blob and output in bytes from wwv_flow_files.

Hi all,
I am having a requirement to read a blob stored in the oracle table and convert it into bytes. I am loading this table (wwv_flow_files) with APEX.
The code under page 1 is as follows:
DECLARE
z number;
y varchar2(4000);
x varchar2(400);
b blob;
BEGIN
select filename,blob_content into x ,b from APEX_APPLICATION_files where name =:P1_FILE_NAME;
select length(convertBlobToBytes(b)) into z from dual;
:P1_RESULT := z;
end;
Java code is as follows:
import java.io.*;
import java.sql.Blob;
public class convertBlob {
* @param blob
* @return
public static byte[] convertBlobToBytes(Blob blob) {
if (blob==null) return null;
try {
InputStream in = blob.getBinaryStream();
int len = (int) blob.length(); //read as long
long pos = 1; //indexing starts from 1
byte[] bytes = blob.getBytes(pos, len);
in.close();
return bytes;
catch (Exception e) {
System.out.println(e.getMessage());
return null;
PL/SQL wrapper is as follows:
CREATE OR REPLACE FUNCTION convertBlobToBytes(p1 IN BLOB) RETURN LONG RAW AUTHID CURRENT_USER AS LANGUAGE JAVA NAME 'convertBlob.convertBlobToBytes(java.sql.Blob) return byte[]';
I loaded this java class and pl/sql wrapper into the database using JDEVELOPER.
But I am getting the length of the file, as twice the size.
For example, When I run the program which reads the file returns the length of the file as a byte array, the length is 819.
When I pass the same file as a blob from apex, to the java program that converts blob to bytes, the length of the file is 1638.
And hence I am getting wrong results, further in the process.
Can you please help me? Any help is appreciated.
rgds,
Suma.

The example on this page is showing how to read a blob in portions you determine yourself:
http://apex.oracle.com/pls/otn/f?p=31517:91
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
-------------------------------------------------------------------

Similar Messages

  • I am using windows 7 and itunes 11.7 my i phone 5s is not getting synced with my laptop it keeps showing backing up  please help i need to put music in my phone?

    i am using windows 7 and itunes 11.7 my i phone 5s is not getting synced with my laptop it keeps showing backing up  please help i need to put music ?

    Hi,
    Have you managed to solve this problem? if yes, please highlight how you solved it...i'm facing same problem with my new Iphone 5S but udner Windows, thanks.

  • After installing icloud, I can't open Photoshop CS, please help. I am an artist and need photoshop to work.

    After installing icloud, I can't open Photoshop CS, please help. I am an artist and need photoshop to work.

    Did you upgrade to Lion just before setting up iCloud? that's more likely to be the issue. PhotoShop CS2 is a PPC program and won't run on Lion - on Snow Leopard it requires Rosetta to emulate PPC, and this is not included in Lion. CS3 and lateer apparently work though with issues.
    Click on the program's icon in the Finder and hit command-i. Near the top of the pane it will say 'Kind': if it says 'PowerPC' then this is the problem. It will not run on Lion and there is no workaround. You will need to revert to Snow Leopard (you could install this on an external disk and start up from that).

  • Trying to download songs from Itunes store. Keeps saying unable to connect. I have tried from store on computer and on phone. Please help i have weddings to do and need these songs!!!!!!!!!!!!!!!

    Trying to download songs from Itunes store. Keeps saying unable to connect. I have tried from store on computer and on phone. Please help i have weddings to do and need these songs!!!!!!!!!!!!!!!

    Hey everybody Amazon.com works perfectly and no problems so Bye, Bye Itunes fix your junk *** program and ****** customer service telling me it's my computer and connection. Oh is that also why my phone can't download them either on a seperate cell network. Nice try garbage In the time it took for them to run me around i downloaded the songs i needed via Amazon.

  • Today I restore my phone, before I restored it I checked that my photos are saved on my icould, I did the backup and everything was back on my phone but not my photos! :( please help I need my photos back :|

    today I restore my phone, before I restored it I checked that my photos are saved on my icould, I did the backup and everything was back on my phone but not my photos! please help I need my photos back :|

    Hello purpleroses68
    To download any photos that were on your My Photos Stream, then you will need to have Photo Streamed turned on within your computer. Keep in mind that My Photos Stream only holds the last 30 days of photos and those will be the only one that will download. Check out the articles below for more information for the process and general information about getting your photos downloaded.
    Archive or make copies of your iCloud data
    http://support.apple.com/kb/ht4910
    iCloud: My Photo Stream FAQ
    http://support.apple.com/kb/ht4486
    Regards,
    -Norm G.

  • I updated my phone and it cleared everything on it and I don't have an icloud or itunes backup. Please help I need to get my pictures and information back

    I updated my phone and it cleared everything on it and I don't have an icloud or itunes backup. Please help I need to get my pictures and information back

    Sorry, but without a backup in iCloud or iTunes on your computer, your data is gone and can't be restored anymore.

  • My 2008 macbook will not turn on. the light on the corner is on. not flashing but on. its fully charged and has lion on it. please help! my classes start Monday and i need it before then!!

    my 2008 macbook will not turn on. the light on the corner is on. not flashing but on. its fully charged and has lion on it. please help! my classes start Monday and i need it before then!! It will turn on for a coupe seconds, and then turn off.

    Take it into an Apple store for evaluation.

  • I have a new Ipad and when I try to buy an app it asks for my  questions! I dont remember them so I press the button that send me an email to reset them. Ive sent it various times but it doesnt arrive. please help I need this app for school!!!

    I have a new Ipad and when I try to buy an app it asks for my  questions! I dont remember them so I press the button that send me an email to reset them. Ive sent it various times but it doesnt arrive. please help I need this app for school!!!

    See Kappy's great User Tips.
    See my User Tip for some help: Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities https://discussions.apple.com/docs/DOC-4551
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Send Apple an email request for help at: Apple - Support - iTunes Store - Contact Us http://www.apple.com/emea/support/itunes/contact.html
    Call Apple Support in your country: Customer Service: Contacting Apple for support and service http://support.apple.com/kb/HE57
     Cheers, Tom

  • Why my photomerge tool wont open and a dialog box pops up and wont allow me to close. Please help, I need this tool to do my work

    I want to merge several photos together and in both my CS4 and Bridge, it will not open photomerge. A dialog bo opens up that wont let me close it.
    Please help.

    Exact versions of your OS and of Photoshop, please.  Not just "Photoshop CS4".
    Machine specs, please.
    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Please help! can't uninstall photoshop and bridge... I've ended my subscription and I don't need it anymore

    Please help! can't uninstall photoshop and bridge... I've ended my subscription and I don't need it anymore

    Hi,
    Please refer to the help document below to uninstall the apps:
    Creative Cloud Help | Download, install, update, or uninstall apps
    In case of any error message, please specify or paste a screenshot.
    Regards,
    Sheena

  • My macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does

    my macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does not even let me turn it on

    Have you attempted to reset the SMC? That would be the first step. Hold the left control, option, shift key and the power button for about 5 seconds and release. Then try to reboot. Might as well reset the PRAM as well. Hold command, option, P, R on start up until the machine restarts. If that doesnt' have any affect we'll have to dig deeper into a potential hardware failure.
    If this method doesn't work, check the webcam that will tell the problem is on the iSight & WiFi cable. If your webcam is ok, then it'll be the WiFi card problem. Hope it can help ;-)
    - xia_us9

  • Please help, my iMac is running slow and plenty of memory available?

    Please help, my iMac is running slow and plenty of memory available? I tried reading some of these forums to see what to do, I have already deleted all of my downloads that were stored in the downloads file. Not sure what to do next, I ran the etrecheck and here is the following info from the scan:
    EtreCheck version: 2.2 (132)
    Report generated 4/20/15, 2:55 PM
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Click the [Click to remove] links for help removing adware.
    Hardware Information: ℹ️
        iMac (27-inch, Mid 2011) (Technical Specifications)
        iMac - model: iMac12,2
        1 2.7 GHz Intel Core i5 CPU: 4-core
        4 GB RAM Upgradeable
            BANK 0/DIMM0
                2 GB DDR3 1333 MHz ok
            BANK 1/DIMM0
                2 GB DDR3 1333 MHz ok
            BANK 0/DIMM1
                Empty  
            BANK 1/DIMM1
                Empty  
        Bluetooth: Old - Handoff/Airdrop2 not supported
        Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
        AMD Radeon HD 6770M - VRAM: 512 MB
            iMac 2560 x 1440
    System Software: ℹ️
        OS X 10.10.2 (14C109) - Time since boot: 5:29:18
    Disk Information: ℹ️
        ST31000528AS disk0 : (1 TB)
            EFI (disk0s1) <not mounted> : 210 MB
            Macintosh HD (disk0s2) / : 999.35 GB (872.44 GB free)
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
        OPTIARC DVD RW AD-5690H 
    USB Information: ℹ️
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple, Inc. Keyboard Hub
            Apple Inc. Apple Keyboard
        Apple Inc. BRCM2046 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Internal Memory Card Reader
        Apple Computer, Inc. IR Receiver
    Thunderbolt Information: ℹ️
        Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Adware: ℹ️
        Genieo, InstallMac Adware! [Click to remove]
        More adware files Adware! [Click to remove]
    Problem System Launch Agents: ℹ️
        [killed]    com.apple.CallHistoryPluginHelper.plist
        [killed]    com.apple.CallHistorySyncHelper.plist
        [killed]    com.apple.cloudd.plist
        [killed]    com.apple.cmfsyncagent.plist
        [killed]    com.apple.coreservices.appleid.authentication.plist
        [killed]    com.apple.EscrowSecurityAlert.plist
        [killed]    com.apple.gamed.plist
        [killed]    com.apple.icloud.fmfd.plist
        [killed]    com.apple.Maps.pushdaemon.plist
        [killed]    com.apple.nsurlsessiond.plist
        [killed]    com.apple.printtool.agent.plist
        [killed]    com.apple.scopedbookmarkagent.xpc.plist
        [killed]    com.apple.security.cloudkeychainproxy.plist
        [killed]    com.apple.spindump_agent.plist
        [killed]    com.apple.telephonyutilities.callservicesd.plist
        15 processes killed due to memory pressure
    Problem System Launch Daemons: ℹ️
        [killed]    com.apple.ctkd.plist
        [killed]    com.apple.icloud.findmydeviced.plist
        [killed]    com.apple.ifdreader.plist
        [killed]    com.apple.nehelper.plist
        [killed]    com.apple.nsurlsessiond.plist
        [killed]    com.apple.spindump.plist
        [killed]    com.apple.wdhelper.plist
        7 processes killed due to memory pressure
    Launch Agents: ℹ️
        [not loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [running]    com.adobe.AdobeCreativeCloud.plist [Click for support]
        [running]    com.dced8a8837572b7b.agent.plist [Click for support]
        [loaded]    com.oracle.java.Java-Updater.plist [Click for support]
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [not loaded]    com.dced8a8837572b7b.daemon.plist [Click for support]
        [running]    com.dced8a8837572b7b.helper.plist [Click for support]
        [loaded]    com.microsoft.office.licensing.helper.plist [Click for support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Click for support]
        [loaded]    com.oracle.java.JavaUpdateHelper.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [failed]    com.citrixonline.GoToMeeting.G2MUpdate.plist [Click for support] [Click for details]
        [loaded]    com.genieo.completer.download.plist  Adware! [Click to remove]
        [loaded]    com.genieo.completer.update.plist  Adware! [Click to remove]
        [running]    com.google.Chrome.framework.plist [Click for support]
        [loaded]    com.google.keystone.agent.plist [Click for support]
        [failed]    com.webtools.update.agent.plist [Click for support] [Click for details]
    User Login Items: ℹ️
        iTunesHelper    Application  (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
        AdobeResourceSynchronizer    Application  (/Applications/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)
        Dropbox    Application  (/Applications/Dropbox.app)
        AdobeResourceSynchronizer    Application Hidden (/Applications/Adobe Acrobat XI Pro/Adobe Acrobat Pro.app/Contents/Support/AdobeResourceSynchronizer.app)
        Google Chrome    Application Hidden (/Applications/Google Chrome.app)
    Internet Plug-ins: ℹ️
        Default Browser: Version: 600 - SDK 10.10
        Flip4Mac WMV Plugin: Version: 3.0.0.85 BETA  - SDK 10.7 [Click for support]
        AdobeAAMDetect: Version: AdobeAAMDetect 2.0.0.0 - SDK 10.7 [Click for support]
        FlashPlayer-10.6: Version: 17.0.0.169 - SDK 10.6 [Click for support]
        AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Click for support]
        Silverlight: Version: 5.1.30514.0 - SDK 10.6 [Click for support]
        Flash Player: Version: 17.0.0.169 - SDK 10.6 [Click for support]
        QuickTime Plugin: Version: 7.7.3
        iPhotoPhotocast: Version: 7.0
        SharePointBrowserPlugin: Version: 14.4.8 - SDK 10.6 [Click for support]
        AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Click for support]
        JavaAppletPlugin: Version: Java 8 Update 40 Check version
    User internet Plug-ins: ℹ️
        CitrixOnlineWebDeploymentPlugin: Version: 1.0.105 [Click for support]
        Google Earth Web Plug-in: Version: 7.1 [Click for support]
    Safari Extensions: ℹ️
        Omnibar  Adware! [Click to remove]
        MacMin
    3rd Party Preference Panes: ℹ️
        Flash Player  [Click for support]
        Flip4Mac WMV  [Click for support]
        Java  [Click for support]
    Time Machine: ℹ️
        Time Machine not configured!
    Top Processes by CPU: ℹ️
             3%    AddressBookSourceSync
             3%    Google Chrome Helper(10)
             3%    Google Chrome
             2%    mdworker(5)
             1%    WindowServer
    Top Processes by Memory: ℹ️
        729 MB    Google Chrome Helper(10)
        481 MB    kernel_task
        119 MB    Google Chrome
        115 MB    Mail
        74 MB    softwareupdated
    Virtual Memory Information: ℹ️
        58 MB    Free RAM
        3.94 GB    Used RAM
        218 MB    Swap Used
    Diagnostics Information: ℹ️
        Apr 20, 2015, 09:21:25 AM    Self test - passed

    So I looked up the info on OWC as suggested and found the correct memory to upgrade but not sure how much to get and which option? I wanted to know how much space I have available to upgrade so I don't buy something that's more than what can be used. I'm not sure if I need 4GB or 8GB of ram? Also there are two options with every memory choice for instance:
    8.0GB PC3-10600 1333MHZ SO Kit (4GB + 4GB) w/Lifetime Limited Warranty
    Same Day
    $78.79
    8.0GB PC3-10600 SO-DIMM 204 Pin w/Lifetime Limited Warranty
    Same Day
    $82.79
    Not sure what the difference is in the two and which I would need to purchase? Thank you for all your help!

  • I recently purchased a Canon 7D. I own Adobe Photoshop/Bridge CS5. I cannot open my raw images in Bridge. I have tried to download the plug in but does not seem to work. Please Help, I need to be able to open my raw images in Bridge ASAP. I do not want to

    I recently purchased a Canon 7D. I own Adobe Photoshop/Bridge CS5. I cannot open my raw images in Bridge. I have tried to download the plug in but does not seem to work. Please Help, I need to be able to open my raw images in Bridge ASAP. I do not want to upgrade to CS6 at this time.

    If you had given us sensible information, I could look it up for you if your efforts fail.
    Right now, I don't even know if you are on a Mac or on a Windows box.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand, such as your platform (Mac or Win), exact versions of your OS, of Photoshop and of Bridge, machine specs, what troubleshooting steps you have taken so far, what error message(s) you receive, if having issues opening raw files also the exact camera make and model that generated them, etc., someone may be able to help you.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Hi support please help me to sync my ipod and iphone 5 . Since i have installed new itunes version 12 , i am not able to sync to transfer data to my devices through itunes.  I think there is some issue with tunes new version .kindly support ASAP.  Ra

    Hi support please help me to sync my ipod and iphone 5 . Since i have installed new itunes version 12 , i am not able to sync to transfer data to my devices through itunes.
    I think there is some issue with tunes new version .kindly support ASAP.
    Rachna khanna
    [email protected]

    you might need to buy a new cable from the apple store.

  • Please help : itunes download disconnect my internet and TV box !

    Please help : itunes download disconnect my internet and TV box. How can I fix this ?

    Unless the instructions on this page are followed when creating an account : Create an iTunes Store, App Store, or iBooks Store account without a credit card or other payment method.
    then credit card details will need to be entered before the account can be used to download any item from the store.
    You could see if this post by mountaingoatgirl lets you review your account without needing to enter credit card details : https://discussions.apple.com/message/24303054#24303054
    If not, and as you say that you don't have a credit or debit card (though not all debit cards appear to be accepted anyway) then you will need to create a new account, and use the instructions on the about 'create an iTunes ...' page when creating it.

Maybe you are looking for

  • IPhone, iPod Touch will not work with Skullcandy Icon2,  Icon 2

    I pulled my Skullcandy Icon 2 's out for my ski trip and found that the mic and control had stopped working with my iPhone. Thinking that the Mic/Button had broke I went out and picked up a new pair, which also didn't work. Both sets of head phones w

  • Pictures from LR to I-movie...HELP, please! :)

    Hi all. First post here. You seem to all be so helpful that I know I will get a quick reply! I know I can't export photos from Lightroom into I-movie, but that I drag them into it, right?  So, 2 important questions regarding that:  1)  How do I highl

  • Passing Ref Cursor as IN parameter

    I have a situation where I have to send whole table into the stored procedure, I read from the oracle new feature for .Net documentation, It is possible to pass an ref cursor as IN parameter to an stored procedure. Please help me in this, it is urgen

  • Reg : Procurment  Type Change From F to X

    Hi,     Can we able to change the Procurment Type From F to X  in MRP 2 View ?

  • IOS7 not viewing PDF files or allowing downloads, suggestions?

    the website in question is www.dynaflexproducts.com. If you view this site on your mobile device running iOS7 in either Safari or Chrome, the first slider cannot read the PDF. in all other OSs, it works. On iOS6, android, everything is fine... I am n