Home » Developer & Programmer » Forms » Help me please..Can not insert image to database with webutil (merged 2) & PROBLEM with insert i (window server2003 , oracle form dev10g suite)
Help me please..Can not insert image to database with webutil (merged 2) & PROBLEM with insert i [message #432659] |
Wed, 25 November 2009 09:45 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Hello everybody
I do my project that have 2 form ,first is login form ,second form will recieve parameter username,password and user id from first form the problem is when i pressed update button to update username and password it was error FRM-40508
I was really confuse about this error,
i cannot resolve it for 3 days ,so help me please to config this problem ,and i'am not sure about pl/sql script about update.
thank you very very much for your kind to help me..
and this is UPDATE button
WHEN-BUTTON-PRESSED
BEGIN
-------------USERNAME------------------
IF :USERNAME.USERNAME IS NULL THEN
BELL;
MESSAGE ('PLEASE ENTER USERNAME ');
--MESSAGE(' ');
GO_ITEM('USERNAME.USERNAME');
RAISE FORM_TRIGGER_FAILURE;
END IF;
IF :USERNAME.NEW_USERNAME IS NULL THEN
BELL;
MESSAGE('PLEASE ENTER NEW USERNAME. ');
--MESSAGE(' ');
GO_ITEM('USERNAME.NEW_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
END IF;
----------------------------------
--------------PASSWORD---------------------
IF :USERNAME.OLD_PASSWORD IS NULL THEN
BELL;
MESSAGE ('PLEASE ENTER OLD PASSWORD ');
--MESSAGE(' ');
GO_ITEM('USERNAME.OLD_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
END IF;
IF :USERNAME.NEW_PASSWORD IS NULL THEN
BELL;
MESSAGE('PLEASE ENTER NEW PASSWORD. ');
--MESSAGE(' ');
GO_ITEM('USERNAME.NEW_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
ELSIF :USERNAME.RETYPE_NEW_PASSWORD IS NULL THEN
BELL;
MESSAGE('PLEASE ENTER NEW PASSWORD VERIFICATION. ');
--MESSAGE(' ');
GO_ITEM('USERNAME.RETYPE_NEW_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
ELSIF :USERNAME.NEW_PASSWORD != :USERNAME.RETYPE_NEW_PASSWORD THEN
BELL;
MESSAGE('PLEASE RETYPE NEW PASSWORD. VERIFICATION FAILED. ');
--MESSAGE(' ');
GO_ITEM('USERNAME.NEW_PASSWORD');
:USERNAME.NEW_PASSWORD := NULL;
:USERNAME.RETYPE_NEW_PASSWORD := NULL;
RAISE FORM_TRIGGER_FAILURE;
END IF;
-------------------------------------
-------UPDATE---------------
IF :USERNAME.USERNAME != :PARAMETER.P_USERNAME THEN
MESSAGE('PLEASE TYPE CORRECT USERNAME.');
GO_ITEM('USERNAME.USERNAME');
ELSIF :USERNAME.OLD_PASSWORD != :PARAMETER.P_USER_PASSWORD THEN
MESSAGE('PLEASE TYPE CORRECT PASSWORD.');
GO_ITEM('USERNAME.OLD_PASSWORD');
ELSE
-------------I'm not sure how to code pl/sql update is this correct or not ----------
UPDATE USERNAME
SET USERNAME.PASSWORD = :USERNAME.NEW_PASSWORD,
USERNAME.USERNAME = :USERNAME.NEW_USERNAME
WHERE USERNAME.USER_ID = :PARAMETER.P_USER_ID;
COMMIT_FORM;
-----------------------------------------
END IF;
END;
-
Attachment: RESTURANT.fmb
(Size: 172.00KB, Downloaded 1245 times)
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432660 is a reply to message #432659] |
Wed, 25 November 2009 09:54 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
First off when posting code can you please use code tags - see the orafaq forum guide if you're not sure how.
FRM-40508 is ORACLE error: unable to INSERT record.
What's probably happening is that the commit_form is making the form apply the values you've entered in the datablock to the database. I suspect you haven't queried a record in the block so forms is treating it as a new record and trying to insert it. But since there already is a record with the same user_id you'll be getting a primary key error.
Making the datablock a non-database block should fix this.
Next time you get an error like this try using help -> display error on the run time menu to get the full details of the error.
In this case it should probably tell you that you got an ORA-0001 error.
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432666 is a reply to message #432660] |
Wed, 25 November 2009 10:28 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Thank you for your reply ,but i still confuse i already making the datablock that's non-database block but i still cannot update username and password i'm not sure that my code is work for update or not and how to query record that's you said"queried a record in the block ", help me please i was very confuse and cannot resolve this problem for three days ,That's very kind of you, Thank you very very much..
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432668 is a reply to message #432666] |
Wed, 25 November 2009 10:40 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
tonna wrote on Wed, 25 November 2009 16:28
i already making the datablock that's non-database block
are you sure you've done that?
Because in the form you've attached the username block is set to be a database datablock.
tonna wrote on Wed, 25 November 2009 16:28
but i still cannot update username and password
What happens when you try it with the Database Data Block property of the username block set to No?
You certainly shouldn't be getting an FRM-40508 error, are you getting a different error?
tonna wrote on Wed, 25 November 2009 16:28
and how to query record that's you said"queried a record in the block "
That would be when you use execute_query to populate a datablock from the database.
You don't want to do that here.
|
|
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432682 is a reply to message #432673] |
Wed, 25 November 2009 12:24 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Sir,I replace commit_form with standard.commit after i complie and click button to update it's error that's
FRM-40735: ON-ERROR trigger raised unhandled exception ORA-06502
,and parameter.p_user_id is parameter that's i want to check if user login to first form then send parameter to second form will send parameter username ,password and user id and it will update right username who login in first form.
but i still debug it but it still cannot update T_T Could you please check my form again ? Thank you very much ,That's very kind of you..
-
Attachment: RESTURANT.fmb
(Size: 164.00KB, Downloaded 1195 times)
[Updated on: Wed, 25 November 2009 12:26] Report message to a moderator
|
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432775 is a reply to message #432659] |
Thu, 26 November 2009 04:18 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Unfortuneatly when I download your form it doesn't open the triggers properly so I can't check it.
Use messages to work out which exact line of code is giving the 6502 error then post the code from the trigger here (use code tags) and idicate which line is causing the problem.
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432845 is a reply to message #432683] |
Thu, 26 November 2009 11:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Hello ,sir i find what i'm wrong ,when i check to my parameter that you suggested ,i found that my parameter that's parmeter p_user_id doesn't send to second form ,Could you suggest me how can i send parameter p_user_id to second form with this login form , because it just send only parameter p_username and p_password ,please help me one more times i was really sad, i config with this all day for week.
could you please check my login form and send back to me ,that's very kind of you.
Thank you very very very much..
-
Attachment: LOGIN.fmb
(Size: 56.00KB, Downloaded 1154 times)
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432846 is a reply to message #432845] |
Thu, 26 November 2009 11:47 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
here is my triggers that i want to send parameter p_us
er_id but it not work what should i code..
first form login form
button login WHEN-BUTTON-PRESSED
DECLARE
e_invalid_username EXCEPTION;
v_param_list PARAMLIST;
------HOW CAN I SHOW USER_ID WHEN LOGIN CORRECT USERNAME AND HOW CAN I SEND PARAMETER P_USER_ID TOO.THANKYOU FOR YOUR HELP-------------
CURSOR cs_account IS
SELECT USER_ID,USERNAME,PASSWORD
FROM USERNAME
WHERE USERNAME.USERNAME =:USERNAME.USERNAME AND USERNAME.PASSWORD =:USERNAME.OLD_PASSWORD
ORDER BY USER_ID;
CS_ACCOUNT_ROW CS_ACCOUNT%ROWTYPE;
---------------
BEGIN
OPEN CS_ACCOUNT;
FETCH CS_ACCOUNT INTO CS_ACCOUNT_ROW ;
IF CS_ACCOUNT%FOUND THEN
MESSAGE('YES!! CORRECT USERNAME AND PASSWORD');
--------------------------------------------------
v_param_list:=GET_PARAMETER_LIST('login_list');
IF NOT ID_NULL(v_param_list) THEN
DESTROY_PARAMETER_LIST(v_param_list);
END IF;
v_param_list:=CREATE_PARAMETER_LIST('login_list');
ADD_PARAMETER(v_param_list,'p_user_id',TEXT_PARAMETER,:username.user_id);
ADD_PARAMETER(v_param_list,'p_user_password',TEXT_PARAMETER,:username.old_password);
ADD_PARAMETER(v_param_list,'p_username',TEXT_PARAMETER,:username.username);
--------------------------------------------
CALL_FORM('C:\DevSuiteHome_1\forms\project\form\RESTURANT.FMX', NO_HIDE,NO_REPLACE, NO_QUERY_ONLY, v_param_list);
ELSE
RAISE e_invalid_username;
END IF;
CLOSE CS_ACCOUNT;
-------------------------------------------
EXCEPTION
WHEN e_invalid_username THEN
MESSAGE('INVALID USERNAME OR PASSWORD!!');
MESSAGE('');
GO_ITEM('USERNAME.USERNAME');
RAISE FORM_TRIGGER_FAILURE;
WHEN OTHERS THEN
message('Error can''t be classified, Please contact Administrator.');
MESSAGE('');
CLEAR_FORM(NO_VALIDATE, FULL_ROLLBACK);
END;
[Updated on: Thu, 26 November 2009 11:54] Report message to a moderator
|
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432851 is a reply to message #432846] |
Thu, 26 November 2009 12:14 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
At five minutes ago i try my second form that's resturant form
that recieve parameter from login form,
this is my trigger update button that's update username and password
BEGIN
-------------USERNAME------------------
IF :USERNAME.USERNAME IS NULL THEN
BELL;
MESSAGE ('PLEASE ENTER USERNAME ');
MESSAGE(' ');
GO_ITEM('USERNAME.USERNAME');
RAISE FORM_TRIGGER_FAILURE;
END IF;
IF :USERNAME.NEW_USERNAME IS NULL THEN
BELL;
MESSAGE('PLEASE ENTER NEW USERNAME. ');
--MESSAGE(' ');
GO_ITEM('USERNAME.NEW_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
END IF;
----------------------------------
--------------PASSWORD---------------------
IF :USERNAME.OLD_PASSWORD IS NULL THEN
BELL;
MESSAGE ('PLEASE ENTER OLD PASSWORD ');
MESSAGE(' ');
GO_ITEM('USERNAME.OLD_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
END IF;
IF :USERNAME.NEW_PASSWORD IS NULL THEN
BELL;
MESSAGE('PLEASE ENTER NEW PASSWORD. ');
MESSAGE(' ');
GO_ITEM('USERNAME.NEW_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
ELSIF :USERNAME.RETYPE_NEW_PASSWORD IS NULL THEN
BELL;
MESSAGE('PLEASE ENTER NEW PASSWORD VERIFICATION. ');
MESSAGE(' ');
GO_ITEM('USERNAME.RETYPE_NEW_PASSWORD');
RAISE FORM_TRIGGER_FAILURE;
ELSIF :USERNAME.NEW_PASSWORD != :USERNAME.RETYPE_NEW_PASSWORD THEN
BELL;
MESSAGE('PLEASE RETYPE NEW PASSWORD. VERIFICATION FAILED. ');
MESSAGE(' ');
GO_ITEM('USERNAME.NEW_PASSWORD');
:USERNAME.NEW_PASSWORD := NULL;
:USERNAME.RETYPE_NEW_PASSWORD := NULL;
RAISE FORM_TRIGGER_FAILURE;
END IF;
-------------------------------------
-------UPDATE---------------
IF :USERNAME.USERNAME != :PARAMETER.P_USERNAME THEN
MESSAGE('PLEASE TYPE CORRECT USERNAME.');
GO_ITEM('USERNAME.USERNAME');
ELSIF
:USERNAME.OLD_PASSWORD != :PARAMETER.P_USER_PASSWORD THEN
MESSAGE('PLEASE TYPE CORRECT PASSWORD.');
GO_ITEM('USERNAME.OLD_PASSWORD');
ELSIF
:USERNAME.NEW_PASSWORD = :USERNAME.RETYPE_NEW_PASSWORD THEN
UPDATE USERNAME
SET USERNAME.PASSWORD = :USERNAME.NEW_PASSWORD,
USERNAME.USERNAME = :USERNAME.NEW_USERNAME
WHERE USERNAME.USERNAME = :PARAMETER.P_USERNAME; <---it's work when i try to update that check from parameter p_username
--[color=red]WHERE USERNAME.USERNAME=:PARAMETER.P_USER_ID;[/color]<--- [color=red]This is my Objective that i want to update that check with parameter p_user_id ,but it doesn't send from login form ,so i confuse how can i code for send parameter p_user_id.thank you for your help....[/color]
COMMIT;
--------I DON'T KNOW WHAT'S DIFF ABOUT COMMIT,COMMIT_FORM,FORMS_DDL('COMMIT')AND STANDARD.COMMIT----
--COMMIT_FORM;
--FORMS_DDL('COMMIT');
END IF;
END;
|
|
|
Re: error FRM-40508 help me please how to resolve [message #432852 is a reply to message #432851] |
Thu, 26 November 2009 12:23 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Hello,sir when i try to change
ADD_PARAMETER(v_param_list,'p_user_id',TEXT_PARAMETER,:username.user_id);
TO
ADD_PARAMETER(v_param_list,'p_user_id',TEXT_PARAMETER,CS_ACCOUNT_ROW.user_id);
when i press update button
it was error this "FRM-40735:WHEN BUTTON_PRESSED trigger raised unhandled exception ORA-01722. "
|
|
|
|
Re: error FRM-40508 help me please how to resolve [message #433194 is a reply to message #432854] |
Mon, 30 November 2009 10:34 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Dear Sir,
I'm very thank you for your help in everything with update my form update data finish.
Sorry again to disturb you in to day i have the problem with insert image in to database use webutil with function client_image.read_image_file(),when i click to save button my resturant picture it's doesn't save image resturant to blob table it's just only show image ,although datablock is database block too.
i'm very confuse and don't know why? Could you please check my pl/sql code? Thank you verymuch,That's very kind of you..
This trigger is in button Browse
BEGIN
:RESTURANT.R_PICTUREPATH:= CLIENT_GET_FILE_NAME('C:\TEMP', NULL,'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)|*.JPG|Bitmap Image (*.bmp)|*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|', NULL,NULL,NULL);
END;
This trigger is in button save image
DECLARE
IMAGE_PATH VARCHAR2(300);
BEGIN
IMAGE_PATH := :RESTURANT.R_PICTUREPATH;
client_image.read_image_file(IMAGE_PATH, 'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)|*.JPG|Bitmap Image (*.bmp)|*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|', 'RESTURANT.R_PICTURE');
client_image.write_image_file(IMAGE_PATH, 'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)|*.JPG|Bitmap Image (*.bmp)|*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|', 'RESTURANT.R_PICTURE');
COMMIT_FORM;
END;
Fixed code tags - cm
-
Attachment: RESTURANT.fmb
(Size: 156.00KB, Downloaded 1154 times)
[Updated on: Mon, 30 November 2009 11:07] by Moderator Report message to a moderator
|
|
|
Re: error FRM-40508 help me please how to resolve [message #433258 is a reply to message #433194] |
Tue, 01 December 2009 01:30 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
deeneshjoshi
Messages: 3 Registered: November 2009 Location: Hyderabad, India
|
Junior Member |
|
|
write_image_file writes the image from a Oracle Forms image item into the specified file. But here you want to store it in db.
For that you need to use webutil_file_transfer.Client_To_DB. This function is used to upload a named file on the client into a BLOB column in the database. You must define the name of the target table, the name of the column, and a where clause that defines one and only one row in that table. This upload is carried out using the current database connection and schema privileges.
PS: jpg file more than 750 to 800 kb cannot be read. but you can read bmp file of any size.
|
|
|
Help me please..Can not insert image to database with webutil (merged 2) & PROBLEM with insert i [message #433271 is a reply to message #432659] |
Tue, 01 December 2009 03:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Dear sir,
I got problem with insert image to database field blob,
i have resturant form and use webutil ,because i want client to browse and insert their resturant picture sir, but the problem i don't know how send parameter with insert image together
,because i have 2 form first is login form have parameter username,password,user id ,so i send parameter from first form to second and i want to check restuarant id is equal to parameter user id then insert client restuarant image ,
when i complie and click at Browse button it already read image but cannot insert image to field blob sir , Could you please check pl/sql code for me or any suggestion to give client insert image to database that's parameter user id(p_user_id) qual to restuarant id(R_ID). Thank you for your help,That's very kind of you..
I Attach two form first is login form .
the second form is Restuarant form.
This trigger is in button Browse
BEGIN
:RESTURANT.R_PICTUREPATH:= CLIENT_GET_FILE_NAME('C:\TEMP', NULL,'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)|*.JPG|Bitmap Image (*.bmp)|*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|', NULL,NULL,NULL);
END;
This trigger is in button save image
DECLARE
IMAGE_PATH VARCHAR2(300);
BEGIN
IMAGE_PATH := :RESTURANT.R_PICTUREPATH;
client_image.read_image_file(IMAGE_PATH, 'JPEG Image (*.JPG,*.JPEG,*.JPE,*.JFIF)|*.JPG|Bitmap Image (*.bmp)|*.bmp|GIF Image (*.GIF)|*.GIF|TIFF Files (*.tif)|*.tif|All Files (*.*)|*.*|', 'RESTURANT.R_PICTURE');
COMMIT_FORM;
END;
[EDITED by LF: fixed [code] tags, removed superfluous empty lines]
-
Attachment: LOGIN.fmb
(Size: 52.00KB, Downloaded 1104 times)
[Updated on: Tue, 01 December 2009 03:30] by Moderator Report message to a moderator
|
|
|
|
|
Help me please..Can not insert image to database with webutil (merged 2) [message #433603 is a reply to message #433271] |
Thu, 03 December 2009 04:49 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Hello,experts I was stuck in this problem for a week , Anybody who can insert image to database with webutil please give me suggestion ,how can i insert image to database with webutil,because i make form that's give client can insert image to database.
Could you please check pl/sql code in button? Thank you very very much, That's very kind of you.. I waiting for anwser..
This is my trigger button Browse
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
:RESTURANT.R_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 (*.*)|*.*|','RESTURANT.R_PICTURE');
END;
This is my trigger button save
(i want to save path picture and picture ,but the problem is picture's path can save but the picture cannot save to field blob how can i do ? Help me solve this problem please ....)
BEGIN
UPDATE RESTURANT
SET
RESTURANT.R_PICTUREPATH = :RESTURANT.R_PICTUREPATH
WHERE RESTURANT.R_ID = TO_NUMBER(:PARAMETER.P_USER_ID);
COMMIT_FORM;
END;
|
|
|
|
Help me please..Can not insert image to database with webutil [message #434335 is a reply to message #433603] |
Tue, 08 December 2009 13:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
tonna
Messages: 33 Registered: November 2009 Location: thai
|
Member |
|
|
Dear everybody,
I was stuck with this problem for two week i really need to know
how can i insert image with oracle form that use webutil , because
i want client can insert image to database
i create resturant form that this form can read image and insert path of image but cannot save image to database field blob i really need to know how to code pl/sql to insert image with webutil pleas please help me?
Thank you very much. my project dead line is 15th of this month
,so who know how to resolve please tell me to this e-mail (ton_liu@hotmail.com) or this forum, That's very kind of you.
this is my sample trigger code
browse 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
:RESTURANT.R_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 (*.*)|*.*|','RESTURANT.R_PICTURE');
END;
this is trigger code
save image button
BEGIN
UPDATE RESTURANT
SET
RESTURANT.R_PICTUREPATH = :RESTURANT.R_PICTUREPATH
WHERE RESTURANT.R_ID = TO_NUMBER(:PARAMETER.P_USER_ID);
COMMIT_FORM;
END;
and this is my resturant.fmb
-
Attachment: RESTURANT.fmb
(Size: 168.00KB, Downloaded 1156 times)
|
|
|
Re: Help me please..Can not insert image to database with webutil [message #434877 is a reply to message #434335] |
Fri, 11 December 2009 06:39 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
beginnerHere
Messages: 55 Registered: October 2009
|
Member |
|
|
hey tonna,
i don't really know about web_util but if you simply want to insert image into database you could simply do it.
create a table with a blob datatype column, use the forms datablock wizard to create a form from that table. the blob column will ensure that on the form it shows an image item mapped to the column. place a button that reads the image from the system into the image item. behind the button write:
begin
read_image_file('c:\1.gif', 'GIF', 'BLOCK_NAME.photo');
end;
where "C:\1.gif" is the full path of the image file and "photo" is the name of the image item created on the canvas by the datablock wizard.
commit the form. the image gets saved in the database. done.
hope it helps.
|
|
|
|
Goto Forum:
Current Time: Mon Feb 10 05:01:55 CST 2025
|