Home » Developer & Programmer » Forms » Cannot display image from blob column in stored procedure
icon9.gif  Cannot display image from blob column in stored procedure [message #528830] Thu, 27 October 2011 06:42 Go to next message
trungquan710
Messages: 4
Registered: October 2011
Location: Viet Nam
Junior Member

I'm a newbie to Oracle Form. Please help me solve this problem.

I have a table named PRODUCT (ID Number , ProductImage BLOB). I have inserted some records in.

I want to create a form for user to view this table.

When I create Data Block, in Data Block Wizard, if I select option 'Table or View' to retrieve data, it's ok (Data type of item ProductImage is Image, when I run form and query, it display image normally).

BUT, I want to retrieve data from stored procedure in a package. This is my package code:

PACKAGE my_pkg IS
    TYPE my_rec IS RECORD
    (
      myID PRODUCT.ID%TYPE,      
      myImage PRODUCT.ProductImage%TYPE
    );
   TYPE my_tbl IS TABLE OF my_rec INDEX BY BINARY_INTEGER;   
   PROCEDURE Do_Query (p_my_tbl IN OUT my_tbl);
END my_pkg;

PACKAGE BODY my_pkg IS
  PROCEDURE Do_Query (p_my_tbl IN OUT my_tbl) IS
    CURSOR my_cur IS
      SELECT p.ID, p.ProductImage
      FROM PRODUCT p;
      idx NUMBER := 1;
  BEGIN
    FOR rec IN my_cur LOOP
      p_my_tbl(idx) := rec;
      idx := idx + 1;
    END LOOP;
  END Do_Query;

END my_pkg;



I select option 'Stored Procedure' in Data Block Wizard, then select my stored procedure (my_pkg.Do_Query). Next I choose 2 columns from my stored procedure (ID, ProductImage). The wizard still applys data type of ProductImage as Image. I finish Data Block Wizard and Layout Wizard... run form, query and an error message display:

FRM-40364: The data type of item 'ProductImage' does not match the corresponding column in the stored procedure.

I try to change 'myImage PRODUCT.ProductImage%TYPE' -> 'myImage BLOB' in my package but still get that error. I have searched on Internet for some hours, but couldn't find any solution.

Please help me. And sorry for my bad English.
Re: Cannot display image from blob column in stored procedure [message #528932 is a reply to message #528830] Thu, 27 October 2011 12:26 Go to previous messageGo to next message
trungquan710
Messages: 4
Registered: October 2011
Location: Viet Nam
Junior Member

Hix, 56 views but no one can help me?? Sad

Did anyone work with blob column from stored procedure?? Help me please !!!
Re: Cannot display image from blob column in stored procedure [message #528980 is a reply to message #528932] Thu, 27 October 2011 17:34 Go to previous messageGo to next message
itralarcon
Messages: 36
Registered: February 2011
Location: San Salvador
Member

Man, i think nobody will answer your question because:


  1. You don't specify your Forms Version
  2. It doesn't has so much time from being posted


But here is one topic maybe can help you (only forms 6i):
http://www.orafaq.com/forum/mv/msg/60477/0//161284/
Re: Cannot display image from blob column in stored procedure [message #529070 is a reply to message #528830] Fri, 28 October 2011 09:59 Go to previous messageGo to next message
trungquan710
Messages: 4
Registered: October 2011
Location: Viet Nam
Junior Member

Oh, I forgot. I use Form version 10.1.2.0.2 in Developer Suite 10g.
Thanks for your answer, but I also read that topic. And it's not my case. I can select image from client, insert, and query if I created Data Block by option 'Table or View', but I cannot if I chose 'Stored Procedured', I met this error:
FRM-40364: The data type of item 'ProductImage' does not match the corresponding column in the stored procedure.
Re: Cannot display image from blob column in stored procedure [message #534644 is a reply to message #528830] Thu, 08 December 2011 01:54 Go to previous message
trungquan710
Messages: 4
Registered: October 2011
Location: Viet Nam
Junior Member

OK.
I just searched on Google for some days. And I found the answer in a forum. That guy said that Stored Procedure didn't work well with BLOB type.
I will post the link of that topic later. Thank you
Previous Topic: parametrized cursor in oracle form
Next Topic: Running Oracle 10g DS and Oracle Forms 11g on same OS and on same machine
Goto Forum:
  


Current Time: Fri Aug 09 14:27:03 CDT 2024