Home » Developer & Programmer » Forms » display BLOB to form's image
icon8.gif  display BLOB to form's image [message #445570] Tue, 02 March 2010 10:17 Go to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
Hello, I am using developer 10.1.2.0.2

I have created a table to store the BLOB, which is jpg image originally. And I have uploaded those image into the database successfully.

Table name: images
img_id number
img blob

I know that I can set display one image each time if I create the image icon on the form using "data block wizard"

But the problem is that I cannot display multiple image on a form at the same time

Could anyone help??? Sad
Re: display BLOB to form's image [message #445724 is a reply to message #445570] Wed, 03 March 2010 10:04 Go to previous messageGo to next message
gregor
Messages: 86
Registered: March 2010
Location: Germany
Member
Hi,

-- in a multi-record block you can display a picture
with Image-typ-Item for every row.

-- If you want show different pictures from different
tables, perhaps it is
a idea to make a new block for each picture.


Re: display BLOB to form's image [message #445729 is a reply to message #445724] Wed, 03 March 2010 10:47 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
gregor wrote on Wed, 03 March 2010 10:04
Hi,

-- in a multi-record block you can display a picture
with Image-typ-Item for every row.

-- If you want show different pictures from different
tables, perhaps it is
a idea to make a new block for each picture.




Thanks for your reply


I would like to know what do you mean of "Image-typ-Item for every row."
Do I still need to create a new block for each image?
Since each image needs to get different row within the same table
Re: display BLOB to form's image [message #445730 is a reply to message #445570] Wed, 03 March 2010 10:52 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
One datablock set to display multiple rows.
The item which is mapped to your blob column should have its item type property set to image.
Re: display BLOB to form's image [message #445734 is a reply to message #445730] Wed, 03 March 2010 12:04 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
cookiemonster wrote on Wed, 03 March 2010 10:52
One datablock set to display multiple rows.
The item which is mapped to your blob column should have its item type property set to image.


Hi,
I am a bit new to Oracle

do you mean setting "number of records displayed" in the property palette of the datablock to display multiple rows?
would you mind listing some steps for me?

I used to use the "where clause" under database in the property palette of the datablock to map the blob column
How can I map multi-image with single statement in this method?
or is there any other way to do it?

Many thanks
Re: display BLOB to form's image [message #445735 is a reply to message #445734] Wed, 03 March 2010 12:14 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
casiofd wrote on Wed, 03 March 2010 18:04
cookiemonster wrote on Wed, 03 March 2010 10:52
One datablock set to display multiple rows.
The item which is mapped to your blob column should have its item type property set to image.


Hi,
I am a bit new to Oracle

do you mean setting "number of records displayed" in the property palette of the datablock to display multiple rows?
would you mind listing some steps for me?

That is the step.

casiofd wrote on Wed, 03 March 2010 18:04

I used to use the "where clause" under database in the property palette of the datablock to map the blob column
How can I map multi-image with single statement in this method?
or is there any other way to do it?

Many thanks


You've got an image stored in one column in table right?
And you've got different images in different rows in that table (but always the same column)?

In which case the where clause tells it which rows to get.
The column mapping is done by the item properties - the Database section, specifically Column Name.

To be honest if you're struggling with these bits I suggest you:
a) read up on the documentation
b) practice with normal data - varchars, dates, numbers etc
before moving on to images.

There are practice forms on the oracle web-site you can play with and you can install the scott schema in your db if you don't already have it to get some sample tables to play with.
Re: display BLOB to form's image [message #445755 is a reply to message #445570] Wed, 03 March 2010 21:02 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
thanks for your advice

in fact i can link the data block with a specific item to map the image
however, i want to know is that any way that i do not need to create a new block for each image to do the mapping
Re: display BLOB to form's image [message #445800 is a reply to message #445570] Thu, 04 March 2010 03:46 Go to previous messageGo to next message
gregor
Messages: 86
Registered: March 2010
Location: Germany
Member
Hi,

I don't know what you want, is it so?
(Screen-Layout: one Block based on one Table )

row1-> Item1 Item2 Item3 Picture
row2-> Item1 Item2 Item3 Picture
row3-> Item1 Item2 Item3 Picture
...4
...5
Re: display BLOB to form's image [message #445836 is a reply to message #445800] Thu, 04 March 2010 05:35 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
gregor wrote on Thu, 04 March 2010 03:46
Hi,

I don't know what you want, is it so?
(Screen-Layout: one Block based on one Table )

row1-> Item1 Item2 Item3 Picture
row2-> Item1 Item2 Item3 Picture
row3-> Item1 Item2 Item3 Picture
...4
...5


the interface is as following

Item1 Picture1
Item2 Picture2
Item3 Picture3
Item4 Picture4
Item5 Picture5

since the pictures are different, do i need to create 5 new datablock to handle them?
Re: display BLOB to form's image [message #445844 is a reply to message #445570] Thu, 04 March 2010 05:50 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
No.

One datablock, displaying multiple rows.
Re: display BLOB to form's image [message #445857 is a reply to message #445844] Thu, 04 March 2010 06:58 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
cookiemonster wrote on Thu, 04 March 2010 05:50
No.

One datablock, displaying multiple rows.


thanks!
i finally know it~

but it raised another question...
since it is a search result in my case
i may just find 3 records insert of 5
can i hide part of the rows?
and display the remaining rows as usual?
Re: display BLOB to form's image [message #445858 is a reply to message #445570] Thu, 04 March 2010 07:00 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
I don't understand what you mean.
Re: display BLOB to form's image [message #445860 is a reply to message #445858] Thu, 04 March 2010 07:07 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
cookiemonster wrote on Thu, 04 March 2010 07:00
I don't understand what you mean.


let's say i have set 5 for the "number of records displayed" in the datablock's property palette
if the Query results only find 3 records match the condition,
2 of the image icon will be blank
so can i hide those 2 icons?
Re: display BLOB to form's image [message #445862 is a reply to message #445570] Thu, 04 March 2010 07:20 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
oh
i know the problem...

it's just because i have set the image to lower in Bevel...


one last question...
when i click on the different image
can i be redirected to different pages under this method?
since there is just one trigger...
how can i distinguish which record has clicked?
Re: display BLOB to form's image [message #445863 is a reply to message #445570] Thu, 04 March 2010 07:28 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Forms don't really have concepts of pages - do mean a new form, canvas or something else?

regardless you can use a WHEN-MOUSE-CLICK trigger couple with various system parameters (look them up in form builder help) to work out what record you are in.
Re: display BLOB to form's image [message #446072 is a reply to message #445570] Fri, 05 March 2010 06:28 Go to previous messageGo to next message
casiofd
Messages: 9
Registered: March 2010
Junior Member
i still have a question about displaying multiple rows

is it possible for me to write a sql statement in
"where clause" under database in the property palette
to display duplicate records
i.e. display same record twice

i have written
(id=:id_1) OR (id=:id_2) OR (id=:id_3) OR (id=:id_4)
it won't display the record twice if :id_1 is the same as :id_4
Re: display BLOB to form's image [message #446103 is a reply to message #445570] Fri, 05 March 2010 07:59 Go to previous message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
No.

There is no form of where clause you can write that'd get duplicate records. The only way to get duplicates would be to issue a SELECT that access the table twice (table listed twice in the from clause) - which is difficult to do in forms - you'd have to base the block on view.

I really think you need to read up on basic SQL. At the end of the day forms just builds select statements when it executes a query and sends that select to the database. The form lets modify different bits of the select in various properties - mainly the where clause.
If you don't understand basic SQL you are going to struggle.
Previous Topic: Tree Form
Next Topic: how to pass two parameter for graphs from form (merged by CM)
Goto Forum:
  


Current Time: Fri Sep 20 10:21:36 CDT 2024