Retrieve image file from FORMS 10G using BLOB

Dear all,
i inserted one record in a table for the following procedure.
Create Or Replace Procedure Blob_Xl Is
l_blob Blob;
l_bfile Bfile;
Begin
Insert Into LOB_TABLE Values ( 'TEST1', Empty_Blob() )
Returning BLOBDATA Into l_blob;
l_bfile := Bfilename( 'TEST1', 'I.JPG');
dbms_lob.fileopen( l_bfile,dbms_lob.file_readonly );
dbms_lob.loadfromfile( l_blob, l_bfile, dbms_lob.getlength( l_bfile ) );
dbms_lob.fileclose( l_bfile );
Commit;
End Blob_Xl;
after that
record also inserted, i check thro count.
i try to retrieve that image from that table for using following procedure, in that procedure i called from one button in forms 10g and wrote in when button pressed , when i clicked it wont show any images.
where i am wrong?
Create Or Replace Procedure get_img As
vblob Blob;
buffer Raw(32000);
buffer_size Integer := 32000;
offset Integer := 1;
Length Number;
Begin
owa_util.mime_header('image/JPG');
Select BLOBDATA Into vblob From LOB_TABLE Where No = 'TEST1';
Length := dbms_lob.getlength(vblob);
While offset < Length Loop
dbms_lob.Read(vblob, buffer_size, offset, buffer);
htp.prn(utl_raw.cast_to_varchar2(buffer));
offset := offset + buffer_size;
End Loop;
Exception
When Others Then
htp.p(Sqlerrm);
End;
/

hi
try something like this for retrieve.May it helps u.
DECLARE
directions CLOB;
directions_1 VARCHAR2(300);
directions_2 VARCHAR2(300);
chars_read_1 BINARY_INTEGER;
chars_read_2 BINARY_INTEGER;
offset INTEGER;
BEGIN
--Retrieve the LOB locator inserted previously
SELECT falls_directions
INTO directions
FROM waterfalls
WHERE falls_name='Munising Falls';
--Begin reading with the first character
offset := 1;
--Attempt to read 229 characters of directions, chars_read_1 will
--be updated with the actual number of characters read
chars_read_1 := 229;
DBMS_LOB.READ(directions, chars_read_1, offset, directions_1);
--If we read 229 characters, update the offset and try to
--read 255 more.
IF chars_read_1 = 229 THEN
offset := offset + chars_read_1;
chars_read_2 := 255;
DBMS_LOB.READ(directions, chars_read_2, offset, directions_2);
ELSE
chars_read_2 := 0;
directions_2 := '';
END IF;
--Display the total number of characters read
DBMS_OUTPUT.PUT_LINE('Characters read = ' ||
TO_CHAR(chars_read_1+chars_read_2));
--Display the directions
DBMS_OUTPUT.PUT_LINE(directions_1);
DBMS_OUTPUT.PUT_LINE(directions_2);
END;
sarah
Edited by: S@R@h on Oct 7, 2009 11:29 PM

Similar Messages

  • Opening image file from Form 6i deployed on Application server

    Hi
    I am working on an applictaion where a form 6i is deployed on application server.The application reads an image file from hard disk.The form works fine when I run in form developer . But when I deploy on application server the form using get_file_name do not reads the image file.
    Please help
    Prashant

    Hi!
    In forms 10g we use webutil for that. I think forms 6i do not support that.
    May search here in the forum for webutil for 6i.
    Some guys had built a webutil.pll that s working on 6i.
    Here is the thread: Converting to Webutil? 6i and 9i equivalents.
    Regards
    Edited by: Magoo on 18.09.2009 11:10

  • Problem using CLIENT_HOST to FTP files from forms 10g

    Hi,
    I'm trying to use forms 10g ODS & webutil on NT to allow a user to select a file on their machine or the network and transfer the file to a DB server. I want to transfer the file to the file system on the server NOT to a BLOB column on a table. I've used webutil (client_get_file_name) to display the dialog box and allow the user to select a file. This works fine. However, when I try to use CLIENT_HOST to FTP the selected
    to the remote server it fails. I'm issuing the following
    command from within forms:
    CLIENT_HOST('CMD /C ftp -n -s:C:\test_ftp.txt');
    Something tries to kick off and a grey area the size of a dos window flashes on to the screen for a couple of seconds but the FTP does not happen. The test_ftp.txt script is a simple ftp script that transfers one file and I know it works as I can run it successfully from DOS or NT command prompt.
    Questions:
    (1) Does anyone know how to pause the DOS window so you
    can see what is actually happening ?
    (2) Has anyone implemented FTP functionality
    successfully using CLIENT_HOST in the same way that's
    I'm trying ?
    Any help would be appreciated.
    Declan.

    Okay...
    Try this. For testing put your command in a .bat-file. In this .bat-file spool the output to a text-file. I'm not sure about the spooling syntax under Windows, check the Windows documentation for that. Like:
    ftp.bat
    start spooling to ftp.out
    cmd /c .... (your ftp commando line)
    stop spooling
    Perhaps the problem is that it doesn't find the ftp commando? Try hardcode the path like c:\windows\ftp ... etc!

  • Error while calling BI Publisher from Forms 10g using Webservice - Urgent !

    Hi,
    I am calling a BI Publisher(10.1.3.4.1) webservice from the Forms 10g (10.1.2.0.2). I developed a jar file which works fine when I run from the Jdeveloper. I have successfully attached jar file to the Forms 10g but when I am calling from the when-button-pressed trigger I am getting beow error
    Exception: java.lang.Exception: java.lang.NoSuchMethodError: oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.setPreemptiveBasicAuth(Z)V
    Thanks in advance

    What steps did you follow to successfully attached jar file to the Forms 10g? To me, it sounds like you don't have your .jar file configured with Forms Builder and/or your App Server. Your .jar file needs to be added to the FORMS_CLASS_PATH in the default.env and the FORMS_CLASS_PATH registry entry. You will likely need to modify the formsweb.cfg also to include your .jar in the archive= or archive_jini= variables (depending on your JRE [Jinitiator or Sun JRE respectively]).
    It could also be a dependency on an additional Java library. Is "setPreemptiveBasicAuth" a method that you created or it is a dependent method from an additional library?
    Let us know this; as well as which Java version you're using.
    By the way, with respects to your "Urgent!" request. You have to understand that forum contributers are purely voluntary - this is not our full-time job. If your issue is truely urgent, it is always best to open a Service Request (SR) with Oracle Support than to rely on the forum for an urgent reply! ;-)
    Hope this helps,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on Sep 20, 2010 2:48 PM

  • Retrieving the files from inbound directory using RZL_READ_DIR

    Hi,
      I am using the function module RZL_READ_DIR to pick the files from AL11 (application server)  some times it is picking all files and in foreground also it is picking the all files from AL11,  but in background sometimes it is not picking the files but when i check in foreground all the files are showing , after 2 or 3 days the function module is picking those files also from background .
    please suggest what would be the reason for not picking in background?
    Any help please.
    Thanks
    Kiran
    Edited by: kiran sure on Sep 21, 2010 8:25 AM

    Note that the domain for your input parameter is of type text200.  TEXT* domains in SAP support upper/lower.  Supply the value to the FM in the needed case (by inserting the value into a declared variable of type text200) and the FM will work.

  • Calling html file from Forms 10g

    Hi,
    I am working in forms 10.1.2.0.2 in the unix server. I have a push button in which I'm creating a html file as under:
    MYFILE := TEXT_IO.FOPEN('/tmp/ab.html','W');
    When I click the push button, the above file gets created in the tmp directory. But it does not open. Could someone please let me know how to get it to view from my forms. I am using the following command but its not working:
    WEB.SHOW_DOCUMENT('http://formsserver:port/test_virtual_dir/ab.html','_BLANK');
    Thanks

    hmm....
    I assume you have 10g AS installed in Unix.
    Go to $ORACLE_HOME/forms/server
    edit the forms.conf with your virtual directory values similar to
    AliasMatch ^/forms/java/(..*) "/opt/oracle/product/10gas/forms/java/$1
    And to test without any virtual configuration , I would try writing the html file to the folder "/opt/oracle/product/10gas/forms/java" and use
    http://www.Alexyscorp.com/forms/java/myfile.htm
    Also note that u might need to add the hostname as a trusted site otherwise new version of IE wont allow to open.
    Rajesh ALex

  • How to open word doc. from forms 10g

    hi all
    i am trying to open word doc. from forms 10g using ole2.
    but it is not working.
    basiccaly this command is not working
    app := CLIENT_OLE2.CREATE_OBJ('Word.Application');
    can anybody help
    thanx

    I found this searching this forum and it works..however, my issue is to open up Microsoft Word passing in data from a query.
    I am working on Forms 10g
    DECLARE AppID PLS_INTEGER;
    BEGIN
    AppID := DDE.App_Begin('C:\Program Files\Microsoft Office\OFFICE11\winword.exe C:\test.doc',
    DDE.APP_MODE_NORMAL);
    END;

  • Upload Image file and retrieve image file

    How to upload image and How to retrieve image file from Database?
    Plz., give some example
    I am waiting for your valuable guidance.
    Plz., help me any one.

    This question has been asked and answred so meny times.
    I dont feel like writing the answer yet another time so please doa search.

  • Execute sql file from forms

    Hello, how is it possible to execute a sql file from forms without using sqlplus, because we have only the forms runtime on our pc.
    We can't use forms_ddl because we have a very big sql script for creating a package.
    Please help,
    GJ

    Strange, whenever I have installed forms I got sqlplus too without asking for it. If it is not installed, wouldn't your best bet be to install it ?

  • How use PHP to read image files from a folder and display them in Flex 3 tilelist.

    Hello. I need help on displaying images from a folder dynamically using PHP and display it on FLEX 3 TileList. Im currently able to read the image files from the folder but i don't know how to display them in the TileList. This is my current code
    PHP :
    PHP Code:
    <?php
    //Open images directory
    $imglist = '';
    $dir = dir("C:\Documents and Settings\april09mpsip\My Documents\Flex Builder 3\PHPTEST\src\Assets\images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "filename: " . $file . "\n";
    $dir->close();
    ?>
    FLEX 3 :
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="pic.send();">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.rpc.events.ResultEvent;
    public var image:Object;
    private function resultHandler(event:ResultEvent):void
    image = (event.result);
    ta1.text = String(event.result);
    private function faultHandler(event:FaultEvent):void
    ta1.text = "Fault Response from HTTPService call:\n ";
    ]]>
    </mx:Script>
    <mx:TileList x="31" y="22" initialize="init();" dataProvider = "{image}" width="630" height="149"/>
    <mx:String id="phpPicture">http://localhost/php/Picture.php</mx:String>
    <mx:HTTPService id="pic" url="{phpPicture}" method="POST"
    result="{resultHandler(event)}" fault="{faultHandler(event)}"/>
    <mx:TextArea x="136" y="325" width="182" height="221" id="ta1" editable="false"/>
    <mx:Label x="136" y="297" text="List of files in the folder" width="182" height="20" fontWeight="bold" fontSize="13"/>
    </mx:Application>
    Thanks. Need help as soon as possbile. URGENT.

    i have made some changes, in the php part too, and following is the resulting code( i tried it, and found that it works.):
    PHP Code:
    <?php
    echo '<?xml version="1.0" encoding="utf-8"?>';
    ?>
    <root>
    <images>
    <?php
    //Open images directory
    $dir = dir("images");
    //List files in images directory
    while (($file = $dir->read()) !== false)
    if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
    echo "<image>" . $file . "</image>"; // i expect you to use the relative path in $dir, not C:\..........
    //$dir->close();
    ?>
    </images>
    </root>
    Flex Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="callPHP();">
    <mx:Script>
    <![CDATA[
    import mx.rpc.http.HTTPService;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import mx.rpc.events.FaultEvent;
    import mx.events.ItemClickEvent;
    import mx.collections.ArrayCollection;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var arr:ArrayCollection = new ArrayCollection();
    private function callPHP():void
    var hs:HTTPService = new HTTPService();
    hs.url = 'Picture.php';
    hs.addEventListener( ResultEvent.RESULT, resultHandler );
    hs.addEventListener( FaultEvent.FAULT, faultHandler )
    hs.send();
    private function resultHandler( event:ResultEvent ):void
    arr = event.result.root.images.image as ArrayCollection;
    private function faultHandler( event:FaultEvent ):void
    Alert.show( "Fault Response from HTTPService call:\n " );
    ]]>
    </mx:Script>
    <mx:TileList id="tilelist"
    dataProvider="{arr}">
    <mx:itemRenderer>
    <mx:Component>
    <mx:Image source="images/{data}" />
    </mx:Component>
    </mx:itemRenderer>
    </mx:TileList>
    </mx:Application>

  • How do I retrieve a file from Trash using Time Machine in Mavericks?

    Is it even possible to retrieve a file from Trash from a Time Machine backup? Does Time Machine even back up the Trash? I've been told a total restore from a Time Machine backup will put the past Trash back on the Mac, but what if I just want to restore an individual file?
    Shortly after emptying my Trash on my Mac (10.9.4) for the first time in weeks, I realized I needed one of the files I'd just erased. Trying to retrieve with Time Machine was not fruitful, however, because I couldn't find the file on any of the past backups using the normal Enter Time Machine interface. However, I know it would have been in the Trash during all of the most recent backups.
    So I researched how to find the backups of Trash with Time Machine, but I think all of the solutions I found on various online forums were pre-Mavericks and do not seem to work now. I've basically tried 2 things:
    Show Trash in Finder using the Terminal command: open ~/.Trash
    It shows the hidden Trash folder in Finder, located in Macintosh HD/Users/User. For easy access, I added the .Trash folder to the Finder Sidebar. But I can't get to it in the backups. The Trash shortcut in the Finder Sidebar is always grayed out in the old backups using the Time Machine app. And it does not show up in ~ when looking through the backups.backupdb folder on my external HD.
    I also tried the Terminal command to show all hidden files in Finder: defaults write com.apple.finder AppleShowAllFiles YES
    But while many hidden files do suddenly appear in Finder, curiously, the User's .Trash folder is not one. This is true for the Finder of the Mac, the backups.backupdb folder on the External HD, and Time Machine app.
    Thanks.

    How do I retrieve a file from my backup in Time Capsule?
    It depends on the type of file that you are trying to retreive.
    In general.....
    Open Time Machine by clicking on the clock icon on the dock
    Wait a few minutes for Time Machine to fully load
    Use the timeline at the far right of the window to go back in time to a date when the file was still on your Mac
    Click that date
    Navigate using the Finder interface to locate the file that you want
    Click on the file to highlight it
    Click Restore at the lower right of the window to be brought back to the present
    You have to retrieve other types of files differently. For details, see:
    http://pondini.org/TM/28.html

  • Opening .pdf files from forms using OLE

    Hi,
    I want to open, print , save and save as pdf files from forms using OLE . Please help me with the same.
    Thanks
    Vidya

    If you are in client/server mode, you can put an OLE container component on your form. However, be warned that this method does not work when you convert to the forms server web enabled mode. If you anticipate moving your application to the web anytime soon, my advice would be to web-enable first and then add in the feature to view .pdf (or other) files. In our client/server app, I went to a lot of trouble to add in OLE features such as you describe, and now I have to completely re-write those features for the web.

  • REP 110 & REP 0110 .calling reports from Form 10g(10.1.2.0.2)

    Hi All,
    We are migrating form from Oracle form 6i to Oracle 10g(10.1.2.0.2). I am calling reports from forms
    using Web.Show_Docment(). When we run reports in report builder 10g it works fine.
    But when we try to run reports from Forms 10g it throws error which is given below.
    We want to run reports from UNIX. After using this url to submit report we get error REP 110 and REP 0110
    URL
    http://GEM:7777/reports/rwservlet?server=rep_server&report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
    ERROR
    REP-110: File '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2' not found.
    REP-0110: Unable to open file '/u01/forms/QA_Forms10g/GEMREP.rdf DESTYPE=CACHE DESFORMAT=HTML p_user_id=XYZ p_client=2'.
    I will really appreciate your help.
    Thanks
    Sandy

    Hello,
    You are mixing 2 separators in the URL : & and +
    Use only one separator in the URL :
    Example :
    http://GEM:7777/reports/rwservlet?server=rep_server+report=/u01/forms/QA_Forms10g/GEMREP.rdf+DESTYPE=CACHE+DESFORMAT=HTML+p_user_id=XYZ+p_client=2
    Regards

  • Display in "Oracle Forms 10g" a BLOB item

    Hey, anybody know if there was any java component or a way to display in "Oracle Forms 10g" a BLOB item, which contains no images, but files of type PDF, DOC, TXT ....
    Thank you

    <p>The Enhanced HTML browser bean allows showing amost everything in its window. See this screen shot</p>
    So you could download your stored document onto the AS or the client with the Webutil FILE_TRANSFERT package, or you could envisage top develop
    a nice PL/SQL procedure that would send the content via the UTL_HTTP package.
    Francois

  • How to save SQL result to file in forms 10g

    Hi All,
         I am using Oracle/forms 10g and need to create a file from a predefined sql statement .
    Just wondering if there is a build-in provided by oracle to export sql result to a file from Forms?.
    Your quick response will be of great help.
    Thanks
    Aalishan

    Aalishan,
    I guess it all depends on where you need to create the output file. You can use the database package UTL_FILE to write a file to the database server file system or you can use the Forms TEXT_IO built-in to write to the client file system. Is your intent to export the data in a multi-line block to a file? If so, TEXT_IO is what you want to use. The Forms help system has all the information and a few examples you will need to get started.
    Hope this helps.
    Craig...

Maybe you are looking for

  • Generic Data Extraction From SAP R/3 to BI server using Function Module

    Hi, I want step by step procedure for Generic Extraction from SAP R/3 application to BI application using Functional module. If any body have any Document or any PPT then please reply and post it in forum, i will give point for them. Thanks & Regards

  • PORTAL screen got down

    hi all , i am working for ess mss portal , all of a suddden portal screen got down with unwanted sizing , kindly suggest me .....how to get default sizing ...any idea ?

  • Drag and Drop and JGraph

    Hi, I'm trying to use drag and drop for adding nodes to a panel which has a JGraph component in it. The problem is that when I add the JGraph, the panel which holds it (a JScrollPane) stops listening the drops... is there any way to solve this? I tho

  • Mozilla brower is messing with Alignment

    I use Mozilla as my main browser and it has always displayed text and paragraphs as Left-Aligned (default). A couple of hours ago, I discovered while browsing that the text alignment has somehow switched to CENTERED. This is most obvious on sites lik

  • E51 + WLAN + sipgate

    Hallo @all! I'm new here, so let me introduce myself: saxa. Some of you may know me from other discussions, some of you will ) My little problem is the following. I've got an account at sipgate. It's a VoIP provider in Germany. I set up my E51 device