Home » Developer & Programmer » Forms » insert datablock with oracle form developer suite10g (window server 2003, Oracle DB,Oracle developer suite 10g)
insert datablock with oracle form developer suite10g [message #440403] Sat, 23 January 2010 16:40 Go to next message
tonna
Messages: 33
Registered: November 2009
Location: thai
Member
Hello , experts i got problem with insert data by use datablock with oracle form , the problem is when i want to insert data and picture together into database by press button in oracle form with this pl/sql



browse picture button [when-pressed-button]


DECLARE
	V_FILE_NAME VARCHAR2(300) := CLIENT_GET_FILE_NAME('C:\', NULL,'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)|*.JPG|Bitmap Image (*.bmp)|*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|', 'Browse Restuarant Picture',OPEN_FILE,TRUE);

BEGIN

 :EDITMENU.F_PICTUREPATH:= V_FILE_NAME;
CLIENT_IMAGE.read_image_file(V_FILE_NAME, 'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)|*.JPG|Bitmap Image (*.bmp)|*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|','EDITMENU.F_PICTURE');


END;





 save button [when-pressed-button]

begin

INSERT INTO MENU(RESTAURANT_ID,F_NAME,F_TYPE,F_PRICE,F_DESCRIPTION,F_PICTUREPATH,F_PICTURE) 
	 VALUES(TO_NUMBER(:GLOBAL.GLOBAL_USER_ID),:EDITMENU.F_NAME,:EDITMENU.F_TYPE,:EDITMENU.F_PRICE,:EDITMENU.F_DESCRIPTION,:EDITMENU.F_PICTUREPATH,VIMAGE);

COMMIT_FORM; // this point i don't know how can i save data  together with picture that i read from datablock

end;


the result in oracle database have 2 records , first it's only data ,second it's only picture that's in field blob ,so i want the result just have only one record that's include picture in field blob and other data in database in one record ,so how can i do i was very confuse, Could you please give me any suggestion? or how can i do make in oracle form. Thank you very much ,That's very kind of you if you answer to me. i will look forward for answer...
Re: insert datablock with oracle form developer suite10g [message #440405 is a reply to message #440403] Sat, 23 January 2010 22:30 Go to previous message
tamzidulamin
Messages: 132
Registered: October 2009
Location: Dhaka
Senior Member
Dear,

u cann't use INSERT INTO command for insering an image value
(i.e BLOB data).
u can create a database block with your required table.so that
u can save an image item into your table directly.If u want to insert image vlaue by using "Insert Into" command, first u have to convert your image data(that is a BFILE data) into BLOB, after
that u can use insert into command to inserting an BLOB data.

(Remember that, when u browse an image, the data is like BFILE NOT BLOB.u must have convert BFILE to BLOB by Using DBMS_LOB package.)

please see the following link:
http://tamzidul-amin.blogspot.com/2009/10/data-convert-from-file-to-blob.html

Regard's

Tamzid.
Previous Topic: make report for current form
Next Topic: Need F.I.F.O example
Goto Forum:
  


Current Time: Fri Sep 20 03:31:12 CDT 2024