Blobs and bfiles

i hav tried many examples of blobs and bfiles but without any success.
when i used bfiles it creates a directory but i cant see the directory in the drive.
even with blobs i have never been able to insert rows into it. i cannot even use Select * from tablename if it has a blob column
can somebody help

The directory is created in the DB and not on your disk
You should be able to see it with a "select * from all_directories" ( if you have enough
permisson )
Then when you try to select all the data of the table that contains BLOB, you can't obtain the result. But you can do :
select DBMS_LOB.GETLENGTH(name of the column that contains BFILE or BLOBS) from tabel
You will obtain the size of the file inserted ...
To see the images, you have to use Dev2k for instance.
null

Similar Messages

  • To store PDF into BLOB and retrieve into OLE/OCX

    We would like to:
    1. Store a PDF file (output of a report saved in file server) into a BLOB
    column.
    2. Retrieve previously stored PDF in the BLOB column and display using either
    OLE automation or ActiveX (OCX) control.
    I read all related documents in metalink that addresses this issue however cant
    get this to work. We have Acrobat Reader 4.0. Here are some issues from the
    tests that I did:
    1. To load the PDF file the program code that uses BFILE and LOADFROMFILE does
    not work since the database is on a remote server and the PDF file is on a
    local file server. The DIRECTORY created on the database is unable to find the
    PDF file.
    2. Though I want the loading of the file to be programmatic, I tried
    right-click on the OLE container and inserted object from file. This loaded the
    file into the container (Icon on the container appeared) however I was not able
    to view the document by double-clicking. An error in Adobe occured: 'There was
    an error opening this document. A file read error occured'. My guess is the
    'Insert Object' did not insert the file properly into the BLOB.
    3. When trying to display the PDF file stored in file server (in case storing
    into BLOB does not work), I used an OCX control, right-clicked and Insert
    Object and select Adobe Control for ActiveX. The problem here is when I run the
    form, the OCX control shows up empty and I have to 'Insert Object' again in
    runtime. Once I manually insert object from runtime the GET_INTERFACE POINTER &
    SET_PROPERTY works fine is displaying the document. Is there any way to
    maintain the control property of the OCX when the form is run?
    4. Are there any workarounds and better solution to store PDFs into BLOBs and
    retrieve and display in OLE/OCX controls? Using temporary file into local drive
    is not an issue.
    5. Would I be able to make use of 'PDF.PdfCtrl.1' OLE class?
    6. Does OLE automation work for Acrobat Reader 4.0.?
    I would appreciate all the help.
    Shyam

    Im facing a similar kind of problem. I want to store and retrieve Office files, PDF and Jpegs into/from the database to view them on web in disconnected mode. Please reply as I cant find any help/documentation regarding saving BLOB data into files. I was able to store file data into BLOB, using DBMS_LOB package.
    Shahzad

  • Using BLOB or BFILE datatype

    Hi, anyone used BLOB or BFILE before?
    Currently I am thinking of using BLOB or BFILE to store documents (.doc, .pdf, .ppt, .rft, .csv). Can decide yet on which to use. Anyone got any recommendation on which to use?
    1. Any performace issue when using blob after i had stored it in a different tablespace?
    2. Will it take much longer time for export if to use blob.
    3. As for BFILE will it get corrupted if the physical files is delete or been moved to some other location?
    Thanks you in advance, you comments/advice is greatly appreciated..
    Regards,
    lbinsoon

    1. If the blob is in a different tablespace from the row it resides in, that is not a performance impact.
    2. Yes. And how much depends on how much blob data you have. This is because BFILE data is not exported, only the pointers are. So, if you have blob data, it IS exported, making for longer running exports.
    3. Yes. Well, not corrupted, but, of course, you won't be able to access the file. You must update it to point to the new name or location, which can be done with a simple update stmt thus:
    update bf set b = bfilename('d:\tmp','some_binary_file.dat')
    assuming column b is of type BFILE.
    Tom Best

  • BLOB and CLOB data in BI Publisher

    Hello,
    I have an XML file with blob and clob data in it. I am using BI desktop publisher to load the xml file and create the rtf template. I am getting the following error:
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: C:\work\employee.rtf
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\work\employee.xml
    FOProcessor setLocale: en-us
    Do i need to install anything or am i missing any configuration to read the blob and clob? Please advise
    thanks

    Check this out, hopefully it'll help you
    http://oraclebizint.wordpress.com/2007/11/12/oracle-bi-ee-101332-working-with-clob-fields/
    Fiston

  • Reading the Blob and writing it to an external file in an xml tree format

    Hi,
    We have a table by name clarity_response_log and content of the column(Response_file) is BLOB and we have xml file or xml content in that column. Most probably the column or table may be having more than 5 records and hence we need to read the corresponding blob content and write to an external file.
    CREATE TABLE CLARITY_RESPONSE_LOG
      REQUEST_CODE   NUMBER,
      RESPONSE_FILE  BLOB,
      DATE_CRATED    DATE                           NOT NULL,
      CREATED_BY     NUMBER                         NOT NULL,
      UPDATED_BY     NUMBER                         DEFAULT 1,
      DATE_UPDATED   VARCHAR2(20 BYTE)              DEFAULT SYSDATE
    )The xml content in the insert statement is very small because of some reason and cannot be made public and indeed we have a very big xml file stored in the BLOB column or Response_File column
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (5, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (6, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (7, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (8, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');
    Insert into CLARITY_RESPONSE_LOG
       (REQUEST_CODE, RESPONSE_FILE, DATE_CRATED, CREATED_BY, UPDATED_BY, DATE_UPDATED)
    Values
       (9, '<?xml version="1.0" encoding="UTF-8"?><xml-response><phone-number>1212121212</tracking-number></xml-response>', TO_DATE('09/23/2010 09:01:34', 'MM/DD/YYYY HH24:MI:SS'), 1, 1, '23-SEP-10');THe corresponding proc for reading the data and writing the data to an external file goes something like this
    SET serveroutput ON
    DECLARE
       vstart     NUMBER             := 1;
       bytelen    NUMBER             := 32000;
       len        NUMBER;
       my_vr      RAW (32000);
       x          NUMBER;
       l_output   UTL_FILE.FILE_TYPE;
    BEGIN
    -- define output directory
       l_output :=
          UTL_FILE.FOPEN ('CWFSTORE_RESPONCE_XML', 'extract500.txt', 'wb', 32760);
       vstart := 1;
       bytelen := 32000;
    ---get the Blob locator
       FOR rec IN (SELECT response_file vblob
                     FROM clarity_response_log
                    WHERE TRUNC (date_crated) = TRUNC (SYSDATE - 1))
       LOOP
    --get length of the blob
    len := DBMS_LOB.getlength (rec.vblob);
          DBMS_OUTPUT.PUT_LINE (len);
          x := len;
    ---- If small enough for a single write
    IF len < 32760
          THEN
             UTL_FILE.put_raw (l_output, rec.vblob);
             UTL_FILE.FFLUSH (l_output);
          ELSE  
    -------- write in pieces
             vstart := 1;
             WHILE vstart < len AND bytelen > 0
             LOOP
                DBMS_LOB.READ (rec.vblob, bytelen, vstart, my_vr);
                UTL_FILE.put_raw (l_output, my_vr);
                UTL_FILE.FFLUSH (l_output);
    ---------------- set the start position for the next cut
                vstart := vstart + bytelen;
    ---------- set the end position if less than 32000 bytes
                x := x - bytelen;
                IF x < 32000
                THEN
                   bytelen := x;
                END IF;
                UTL_FILE.NEW_LINE (l_output);
             END LOOP;
    ----------------- --- UTL_FILE.NEW_LINE(l_output);
          END IF;
       END LOOP;
       UTL_FILE.FCLOSE (l_output);
    END;The above code works well and all the records or xml contents are being written simultaneously adjacent to each other but we each records must be written to a new line or there must be a line gap or a blank line between any two records
    the code which I get is as follow all all xml data comes on a single line
    <?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7369</empno><ename>James</ename><job>Manager</job><salary>1000</salary></emp><?xml version="1.0" encoding="ISO-8859-1"?><emp><empno>7370</empno><ename>charles</ename><job>President</job><salary>500</salary></emp>But the code written to an external file has to be something like this.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <emp>
      <empno>7369</empno>
      <ename>James</ename>
      <job>Manager</job>
      <salary>1000</salary>
    </emp>
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <emp>
    <empno>7370</empno>
    <ename>charles</ename>
    <job>President</job>
    <salary>500</salary>
    </emp>Please advice

    What was wrong with the previous answers given on your other thread:
    Export Blob data to text file(-29285-ORA-29285: file write error)
    If there's a continuing issue, stay with the same thread, don't just ask the same question again and again, it's really Pi**es people off and causes confusion as not everyone will be familiar with what answers you've already had. You're just wasting people's time by doing that.
    As already mentioned before, convert your BLOB to a CLOB and then to XMLTYPE where it can be treated as XML and written out to file in a variety of ways including the way I showed you on the other thread.
    You really seem to be struggling to get the worst possible way to work.

  • Error deleting VHD: There is currently a lease on the blob and no lease ID was specified in the request

    When attempting to delete a VHD's blob you may receive the following error:
    There is currently a lease on the blob and no lease ID was specified in the request
    While these errors are expected if a VHD is still registered as a disk or image in the portal, we have identified an issue where a lease remains even if the blob is not registered as a disk or image in the portal.
    If you receive one of these errors, first make sure the VHD is not in use:
    In the Windows Azure management portal, if the disk shows up under Virtual Machines,
    Disks, and the Attached To column is not blank, you should first remove that VM in the
    Attached To column by going to VM Instances, selecting the VM, then clicking
    Delete.
    If Attached To is blank, or the VM in the Attached To column was already removed, try removing the disk by highlighting it under
    Disks and clicking Delete Disk (this will not physically delete the VHD from blob storage, it only removes the disk object in the portal). If you have multiple pages of disks it can be easier to search for a specific disk by
    clicking the magnifying glass icon at the top right.
    If Delete Disk is grayed out, or the disk is not listed under Disks, but you still cannot reuse it or delete it, review the options below.
    Breaking the lease
    You can use the
    Lease Blob API to break the lease in this scenario, which is also available in the Windows Azure PowerShell assembly
    Microsoft.WindowsAzure.StorageClient.dll using
    LeaseAction Enumeration.
    To use the BreakLease.ps1 script to break the lease:
    Download Azure PowerShell by clicking Install under Windows here:
    http://www.windowsazure.com/en-us/manage/downloads/
    Start, Search, type Windows Azure PowerShell and open that console.
    Run Get-AzurePublishSettingsFile to launch a browser window to
    https://windows.azure.com/download/publishprofile.aspx to download the management certificate in a
    .publishsettings file in order to manage your subscription with PowerShell.
    Get-AzurePublishSettingsFile
    Run Import-AzurePublishSettingsFile to import the certificate and subscription information. Replace the path below with the full path to the .publishsettings file if you didn't save it to your
    Downloads folder. If you saved it to Downloads you can run it as-is, otherwise replace the path with the full path to the
    .publishsettings file.
    Import-AzurePublishSettingsfile $env:userprofile\downloads\*.publishsettings
    Copy the script below into a text editor such as Notepad and save it as
    BreakLease.ps1.
    Run Set-ExecutionPolicy to allow script execution:
    Set-ExecutionPolicy unrestricted
    Run BreakLease.ps1 with the URL to the VHD in order to break the lease. The script obtains the necessary storage account information, checks that the blob is not currently registered as a disk or as an image, then proceeds to break the
    current lease (if any).
    Sample output:
    BreakLease.ps1 -Uri 'http://clstorage.blob.core.windows.net/vhds/testvm1-testvm1-2012-06-26.vhd'
    Processing http://clstorage.blob.core.windows.net/vhds/testvm1-testvm1-2012-06-26.vhd
    Reading storage account information...
    Confirmed - storage account 'clstorage'.
    Checking whether the blob is currently registered as a disk or image...
    Confirmed - the blob is not in use by the Windows Azure platform.
    Inspecting the blob's lease status...
    Current lease status: Locked
    Unlocking the blob...
    Current lease status: Unlocked
    Success - the blob is unlocked.
    BreakLease.ps1
    Param([string]$Uri = $(Read-Host -prompt "Please specify a blob URL"))
    $ProgressPreference = 'SilentlyContinue'
    echo "Processing $Uri"
    echo "Reading storage account information..."
    $acct = Get-AzureStorageAccount | ? { (new-object System.Uri($_.Endpoints[0])).Host -eq (new-object System.Uri($Uri)).Host }
    if(-not $acct) {
    write-host "The supplied URL does not appear to correspond to a storage account associated with the current subscription." -foregroundcolor "red"
    break
    $acctKey = Get-AzureStorageKey ($acct.StorageAccountName)
    $creds = "DefaultEndpointsProtocol=http;AccountName=$($acctKey.StorageAccountName);AccountKey=$($acctKey.Primary)"
    $acctobj = [Microsoft.WindowsAzure.CloudStorageAccount]::Parse($creds)
    $uri = $acctobj.Credentials.TransformUri($uri)
    echo "Confirmed - storage account '$($acct.StorageAccountName)'."
    $blobclient = New-Object Microsoft.WindowsAzure.StorageClient.CloudBlobClient($acctobj.BlobEndpoint, $acctobj.Credentials)
    $blobclient.Timeout = (New-TimeSpan -Minutes 1)
    $blob = New-Object Microsoft.WindowsAzure.StorageClient.CloudPageBlob($uri, $blobclient)
    echo "Checking whether the blob is currently registered as a disk or image..."
    $disk = Get-AzureDisk | ? { (new-object System.Uri($_.MediaLink)) -eq $blob.Uri }
    if($disk) {
    write-host "The blob is still registered as a disk with name '$($disk.DiskName)'. Please delete the disk first." -foregroundcolor "red"
    break
    $image = Get-AzureVMImage | ? { $_.MediaLink -eq $blob.Uri.AbsoluteUri }
    if($image) {
    write-host "The blob is still registered as an OS image with name '$($image.ImageName)'. Please delete the OS image first." -foregroundcolor "red"
    break
    echo "Confirmed - the blob is not in use by the Windows Azure platform."
    echo "Inspecting the blob's lease status..."
    try {
    $blob.FetchAttributes()
    } catch [System.Management.Automation.MethodInvocationException] {
    write-host $_.Exception.InnerException.Message -foregroundcolor "red"
    break
    echo "Current lease status: $($blob.Properties.LeaseStatus)"
    if($blob.Properties.LeaseStatus -ne [Microsoft.WindowsAzure.StorageClient.LeaseStatus]::Locked) {
    write-host "Success - the blob is unlocked." -foregroundcolor "green"
    break
    echo "Unlocking the blob..."
    $request = [Microsoft.WindowsAzure.StorageClient.Protocol.BlobRequest]::Lease($uri, 0, [Microsoft.WindowsAzure.StorageClient.Protocol.LeaseAction]::Break, $null)
    $request.Timeout = $blobclient.Timeout.TotalMilliseconds
    $acctobj.Credentials.SignRequest($request)
    try {
    $response = $request.GetResponse()
    $response.Close()
    catch {
    write-host "The blob could not be unlocked:" -foregroundcolor "red"
    write-host $_.Exception.InnerException.Message -foregroundcolor "red"
    break
    $blob.FetchAttributes()
    echo "Current lease status: $($blob.Properties.LeaseStatus)"
    write-host "Success - the blob is unlocked." -foregroundcolor "green"
    Alternate method: make a copy of the VHD in order to reuse a VHD with a stuck lease
    If you have removed the VM and the disk object but the lease remains and you need to reuse that VHD, you can make a copy of the VHD and use the copy for a new VM:
    Download CloudXplorer. This will work with other
    Windows Azure Storage Explorers but for the sake of brevity these steps will reference CloudXplorer.
    In the Windows Azure management portal, select Storage on the left, select the storage account where the VHD resides that you want to reuse, select
    Manage Keys at the bottom, and copy the Primary Access Key.
    In CloudXplorer, go to File, Accounts,
    New, Windows Azure Account and enter the storage account name in the
    Name field and the primary access key in the Secret Key field. Leave the rest on the default settings.
    Expand the storage account in the left pane in CloudXplorer and select the
    vhds container (or if the VHD in question is one uploaded to a different location, browse to that location instead).
    Right-click the VHD you want to reuse (which currently has a stuck lease), select
    Rename, and give it a different name. This will throw the error
    could not rename…there is currently a lease on the blob… but click
    Yes to continue, then View, Refresh (F5) to refresh and you will see it did make a copy of the VHD since it could not rename the original.
    In the Azure management portal, select Virtual Machines,
    Disks, then Create Disk at the bottom.
    Specify a name for the disk, click the folder icon under VHD URL to browse to the copy of the VHD you just created, check the box for
    This VHD contains an operating system, select the drop-down to specify if it is
    Windows or Linux, then click the arrow at the bottom right to create the disk.
    After the portal shows Successfully created disk <diskname>, select
    New at the bottom left of the portal, then Virtual Machine,
    From Gallery, My Disks, and select the disk you just created, then proceed through the rest of the wizard to create the VM.
    Thanks,
    Craig

    Just to add an update to this, it looks like the namespaces have changed with the latest version of the SDK. I have updated the script to use the new namespaces, namely: Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob and Microsoft.WindowsAzure.Storage.CloudStorageAccount.
    Param([string]$Uri = $(Read-Host -prompt "Please specify a blob URL"))
    $ProgressPreference = 'SilentlyContinue'
    echo "Processing $Uri"
    echo "Reading storage account information..."
    $acct = Get-AzureStorageAccount | ? { (new-object System.Uri($_.Endpoints[0])).Host -eq (new-object System.Uri($Uri)).Host }
    if(-not $acct) {
    write-host "The supplied URL does not appear to correspond to a storage account associated with the current subscription." -foregroundcolor "red"
    break
    $acctKey = Get-AzureStorageKey ($acct.StorageAccountName)
    $creds = "DefaultEndpointsProtocol=http;AccountName=$($acctKey.StorageAccountName);AccountKey=$($acctKey.Primary)"
    $acctobj = [Microsoft.WindowsAzure.Storage.CloudStorageAccount]::Parse($creds)
    $uri = $acctobj.Credentials.TransformUri($uri)
    echo "Confirmed - storage account '$($acct.StorageAccountName)'."
    $blob = New-Object Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob($uri, $creds)
    echo "Checking whether the blob is currently registered as a disk or image..."
    $disk = Get-AzureDisk | ? { (new-object System.Uri($_.MediaLink)) -eq $blob.Uri }
    if($disk) {
    write-host "The blob is still registered as a disk with name '$($disk.DiskName)'. Please delete the disk first." -foregroundcolor "red"
    break
    $image = Get-AzureVMImage | ? { $_.MediaLink -eq $blob.Uri.AbsoluteUri }
    if($image) {
    write-host "The blob is still registered as an OS image with name '$($image.ImageName)'. Please delete the OS image first." -foregroundcolor "red"
    break
    echo "Confirmed - the blob is not in use by the Windows Azure platform."
    echo "Inspecting the blob's lease status..."
    try {
    $blob.FetchAttributes()
    } catch [System.Management.Automation.MethodInvocationException] {
    write-host $_.Exception.InnerException.Message -foregroundcolor "red"
    break
    echo "Current lease status: $($blob.Properties.LeaseStatus)"
    if($blob.Properties.LeaseStatus -ne [Microsoft.WindowsAzure.Storage.StorageClient.LeaseStatus]::Locked) {
    write-host "Success - the blob is unlocked." -foregroundcolor "green"
    break
    echo "Unlocking the blob..."
    $request = [Microsoft.WindowsAzure.Storage.StorageClient.Protocol.BlobRequest]::Lease($uri, 0, [Microsoft.WindowsAzure.Storage.StorageClient.Protocol.LeaseAction]::Break, $null)
    $request.Timeout = $blobclient.Timeout.TotalMilliseconds
    $acctobj.Credentials.SignRequest($request)
    try {
    $response = $request.GetResponse()
    $response.Close()
    catch {
    write-host "The blob could not be unlocked:" -foregroundcolor "red"
    write-host $_.Exception.InnerException.Message -foregroundcolor "red"
    break
    $blob.FetchAttributes()
    echo "Current lease status: $($blob.Properties.LeaseStatus)"
    write-host "Success - the blob is unlocked." -foregroundcolor "green"

  • How to create a table with datatype blob and insert a pdf file (ravi)

    how to create a table with datatype blob and insert a pdf file,
    give me the explain asap
    1.create the table?
    2.insert the pdffiles into tables?
    3.how to view the files?
    Thanks & Regards
    ravikumar.k
    Edited by: 895044 on Dec 5, 2011 2:55 AM

    895044 wrote:
    how to create a table with datatype blob and insert a pdf file,
    give me the explain asapPerhaps you should read...
    {message:id=9360002}
    especially point 2.
    We're not just sitting here waiting to answer your question as quickly as possible for you.

  • Create a Word document in a OLE container, save it in a BLOB and display it in a rep!

    When im saving a worddoc like a OLE container in a BLOB and trying to display it in a report the text does not look exactly like it did in word. What i happening whit the doc while saving it into the BLOB and tryning to display it in another OLE container?
    Best Regards
    Fredrik Hammarqvist

    You might want to add a browser layer over your flex
    application and let the browser manage the file types. I personally
    use the HTML component from
    http://drumbeatinsight.com/.

  • Uploading PDF in to BLOB and Retrieve PDF from BLOB

    hi
    I have recently started working in apex and run into a bump while trying to handle PDF file Attachments and BLOBs.
    I am trying to upload a PDF file into BLOB database Column using APEX, and later view this file from DB.
    I require assistance on how to upload PDF file into BLOB, and how i can later view this inside the browser window, using APEX
    thanks

    Maybe this blog post can help you.
    Regards,
    Sergio

  • Display BLOB and CLOB on browser

    Hi All.
    I need to display contents of BLOBs and CLOBs on the browser. They can be any docFlavour eg. .jpg, .gif, .pdf, .doc etc
    Is there some standard way of doing this ???
    If any all possible I would rather not use swing class because of its footprint and its slow performance over the net.

    Hi !
    Just in case anyone read this and is willing to comment on it...
    I have one BLOB and one CLOB column in the same record.
    I have been able to stream documents into and out of the BLOB's incl. MS .doc Also I have been able to get the content from BLOB and write it to a target directory.
    However I am having odd problems with CLOB, a simple text file. My servlet attempts to read the CLOB and does create the output file in the target directory, but does not copy the content over. It also returns 0 for clobLength !?! Here is the stub-code :
    ResultSet clobRS = thisStmt.executeQuery (
    "SELECT ATextMsg " +
    "FROM ... " +
    "WHERE ... " );
    clobRS.next();
    CLOB thisCLOB = ((OracleResultSet) clobRS).getCLOB("ATextMsg");
    int chunkSize = thisClob.getChunkSize();
    System.out.println("chunkSize is " + chunkSize); // default us 8132...
    char [] textBuffer = new char[chunkSize];
    String targetFile = targetDir + "retrieved_" + fileName;
    File thisFile = new File(targetFile); // it does create an empty target file...
    // read content as ASCII (text) content...
    FileOutputStream thisFileOutputStream = new FileOutputStream(thisFile);
    OutputStreamWriter thisWriter = new OutputStreamWriter(thisFileOutputStream);
    BufferedWriter thisBufferedWriter = new BufferedWriter(thisWriter);
    // things go wrong here, returns length of 0, why ?!?
    long clobLength = thisClob.length();
    System.out.println("clobLength is " + clobLength);
    // flush to targetFile - but since clobLength=0, nothing gets copied over...
    for (position=1; position<=clobLength; position+=chunkSize)
    int charsRead = thisClob.getChars(position, chunkSize, textBuffer);
    thisBufferedWriter.write(testBuffer);
    Since the clobLength is 0, obviously it will not copy from the database CLOB to the file.
    Manually change the clobLength = 8132, recompile and run, then it copies some junk to the targetFile, certainly not the textual data in the CLOB itself.
    The BLOB is fine...
    Can someone comment on this please and if possible, give me a hint on where I might have gone wrong with a simple text file ???

  • Export and Import Of Tables having BLOB and Raw datatype

    Hi Gurus,
    I had to export one schema in one database and import to another schema in another database.
    However my current database contains raw and blob datatype.I have exported the whole database by the following commnad
    exp SYSTEM/manager FULL=y FILE=jbrms_full_19APR2013.dmp log=jbrms_full_19APR2013.log GRANTS=y ROWS=y
    My question is if all the tables with raw and blob have been exported properly or not.I have done one more thing after taking the export , I have imported to local db and checked the no of rows in the both the envs are same.As I have not tested with the application to confirm.
    I am using this version of Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production
    not able to attach the complete log file but for the schema jbrms which has the blob and raw datatype.
    Please let me know if you find some potential concerns with the export for BLOB and raw
    . about to export JBRMS's tables via Conventional Path ...
    . . exporting table FS_FSENTRY 8 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table FS_WS_DEFAULT_FSENTRY 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BINVAL 60 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_BUNDLE 751 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table PM_WS_DEFAULT_REFS 4 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_FS_FSENTRY 1 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BINVAL 300 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_BUNDLE 11654 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_NAMES 2 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    . . exporting table VERSIONING_PM_REFS 1370 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.

    You could see the 'QUESTIONABLE STATISTICS' warning for a couple of reasons. I don't remember them all but.
    1. If the target and source character set is different.
    2. system generated names (I think?)
    the best solution if you don't need the exact statistics that are on your source database would be to add
    statistics=none
    to your imp command and then regather statistics when the imp command is done.
    Dean

  • How to retrieve xml file from BLOB and display on browser with css/xslt

    Hi All,
    I am new to xml. I am storing my xml file into BLOB in database. Now in my jsp page I want to retrieve this xml file from BLOB and display in HTML/CSS/XSLT form...
    Pl. guide me.. any docs..?? Logic...??
    Thanks in Advance.
    Sandeep Oza

    Hello Sandeep!
    I'm not familiar with jsp but logic should be as follows:
    -in jsp page instantiate XML parser
    -load specified BLOB into parser
    Now you may traverse the XML tree or you might load XSL file and use transform method to transform XML according to XSL file.
    I have an example where I'm selecting XML straight from relational database and then transform it using XSL into appropriate HTML output, but it's written in PSP.
    You can try http://www.w3schools.com/default.asp for basics on XML, CSS, XSL. It's easy to follow with good examples.
    Regards!
    miki

  • Error when trying to remove blob: There is currently a lease on the blob and no lease ID was specified in the request.

    I'm having this error when I try to remove a blob that was used for a VM in the pass, the VM was already removed and there's nothing using that blob nor even the storage account wh ere the blob is stored.
    There is currently a lease on the blob and no lease ID was specified in the request. RequestId:0a441667-0001-0044-7861-bc17ef000000 Time:2014-12-18T15:53:04.5315752Z
    I'm trying to delete the blob from the current web interface, and I haven't found a way to specify a lease ID or check what lease could it has.
    Thanks in advance

    Hi  jruiz,
    When you delete a Virtual Machine on the Management Portal, the "Disk" resource used to mount the Virtual Machines VHD is kept.The "Disk" resource is responsible for mounting the blob for the VHD file, so it can be attached to virtual
    machines as an OS Disk or Data Disk. It will continue to hold a lease on the blob for as long as it exists.
    So you need to delete the "Disk" resource to break the lease on the blob.
    Please refer to the link about how to delete disk resource to break lease on the blob.
    http://blogs.msdn.com/b/mast/archive/2013/02/05/iaas-unable-to-delete-vhd-there-is-currently-a-lease-on-the-blob.aspx
    Best Regards,
    Kevin Shen.

  • BLOBs and ASP: Store ok. How to View/Download?

    I hope this is not considered OT here; if so, please accept my apologies.
    I finally managed to upload a binary file to a BLOB field in my Oracle 8i table (through Oracle OLE-db). In the same table I also store size and content type of the file.
    What I'm trying to do now is to build an ASP page listing all the documents in this table and put beside each document two buttons: View and Download.
    Clicking the View button should open a pop-up window and display the document in the web page (if the MIME type is known), while clicking the Download button should open the standard dialog box (even if the MIME type is known).
    I know you can read the blob and save it to a file on the web server, but it is not clear to me when the file should be deleted. How do I know, for example, that the download is over?
    I've found examples of images sent from a BLOB field to the browser, but I'm not dealing with JPEGs of GIFs: doc, xls, pdf, ppt, etc. Is it possible to read the binary data of a BLOB and send it to the browser without saving to file?
    And how can I tell the browser to ignore the MIME type and open the download dialog?
    TIA for your patience and help.
    Alessandro

    Hi there, Thanks for your response. I'm in India. I usually access Ovi Store app through my Wi-Lan (not through telecom provider's internet as we have only GPRS, 3G services are expected to be launched this month). Having said that, I want to mention that I had already purchased Angry Bird game through the Ovi store in Nov using my CC. It was smooth and painless. Not sure why this issue is happening since the last 1 month.

  • Migrating LONG RAW to BLOB and optimizing extent size

    Hi all,
    I got a quite fragmented table with a LONG RAW column I want to migrate to BLOB and defragment.
    DB version is Oracle9i Release 9.2.0.4.0 and this is a production environment.
    I know MOVE and/or CTAS are not possible with LONG RAW columns
    So, how can I do that? Is ALTER TABLE MODIFY the only possibility to migrate from LOING RAW to BLOB?
    Since ALTER TABLE MODIFY will lock the whole table preventing any DML operation, I need at least a rough estimate of the time needed for this operation. How can I do that?
    Since this table is quite fragmented, I also want to rebuilt it using a different extent size.
    I think I should issue a ALTER TABLE MOVE... after having performed the "ALTER TABLE MODIFY".
    Can I do something better to minimize unavailability to DML operations?
    thanks,
    andrea

    Hi,
    Is this an OCCI question?
    I don't see that "to_blob" is documented anywhere. The "to_lob" function can be used to convert long raw columns, but its use is pretty specific and certainly not for general query use.
    Regards,
    Mark
    EDIT1: Well, my local documentation set does not have "to_blob" in it at all. However, it is in the 11.1 SQL Language Reference on OTN:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions186.htm#sthref2358
    Despite the fact that the documentation mentions "long raw" the function appears to only work with "raw" data in my 11.1 tests.
    What's your goal here?
    Edited by: Mark Williams on Jun 8, 2009 7:15 PM

Maybe you are looking for

  • How can I install new versions of Fifefox on Solaris 9 Sparc?

    I use Firefox 2.0.0.20 on Solaris 9 Sparc, but I couldn't install any verions of Firefox major version 3. There is a great site, http://www.sunfreeware.com/mozilla.html, that looks it has a possibles version compatibles whit my OS, but the links don`

  • XML data source in OBI-EE

    Hi, Simple question. Can an XML file be used directly as a data source for reporting in OBIEE or do we need to import the file in a database table first ?

  • Ipodmini--error 1417/1418 and no music

    when i plug in my ipod it connects, but when i try and update it says error 1417 - if i try and restore it says 1418, SO CONFUSED! also, when i try to play music after its unhooked, it just skips thru each song per second going from one to the other.

  • Which way of VS 2008 do you use for connecting WebServices in WebAS 7.0?

    Since a couple of days I do have problems connecting WebAS 7.0 post SPS 14 (SOAMANAGER) WebServices: Client in C#, Service on WebAS Which way in generating the Proxies are you using in VS 2008? a) ServiceReference as in .Net 3.5 b) WebReference as in

  • Limiting a many to many join

    Hello, I__m wondering if there is a way to limit a many to many join by a specific value in a column in the join table. I have a join table that has the two foreign key fields which are the ids to the tables and another column that I want to limit on