Cannot display image from blob column in stored procedure [message #528830] |
Thu, 27 October 2011 06:42 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/644047db7ba958f8b42e58cca57f0cee?s=64&d=mm&r=g) |
trungquan710
Messages: 4 Registered: October 2011 Location: Viet Nam
|
Junior Member |
![trungquan710](/forum/theme/orafaq/images/yahoo.png)
|
|
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.
|
|
|
|
|
|
|