IMAGE ON FORM 6i [message #415103] |
Fri, 24 July 2009 15:56 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
HI EVERYONE
Please assist me on how to display an image(blob) on a form . i have tried all i could but still failed to display it on the form.Yes i searched the forum without any break through.
below is the code i used to create data block and upload photos (JPG). the only problem am facing is retrieving them from forms. am using form 6i 10g database.
Thankyou.
i ll applreciate if one gives me a step by step on doin this.
the below code works fine.
conn system
grant connect, resource, imp_full_database, exp_full_database to en;
grant create any directory to EN;
grant create any library to EN;
GRANT EXECUTE ON CTX_DDL en;
CONN en/en@pacific
Connected
CREATE TABLE my_docs (
id NUMBER(10) NOT NULL,
name VARCHAR2(200) NOT NULL,
doc BLOB NOT NULL
)
ALTER TABLE my_docs ADD (
CONSTRAINT my_docs_pk PRIMARY KEY (id)
);
CREATE SEQUENCE my_docs_seq;
CREATE OR REPLACE DIRECTORY documents AS 'C:\work';
CREATE OR REPLACE PROCEDURE load_file_to_my_docs (p_file_name IN my_docs.name%TYPE) AS
v_bfile BFILE;
v_blob BLOB;
BEGIN
INSERT INTO my_docs (id, name, doc)
VALUES (my_docs_seq.NEXTVAL, p_file_name, empty_blob())
RETURN doc INTO v_blob;
v_bfile := BFILENAME('DOCUMENTS', p_file_name);
Dbms_Lob.Fileopen(v_bfile, Dbms_Lob.File_Readonly);
Dbms_Lob.Loadfromfile(v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
Dbms_Lob.Fileclose(v_bfile);
COMMIT;
END
;
/
-- CREATE A FOLDER NAMED WORK IN C DRIVE OF ORACLE SERVER MACHINE & PUT THE IMAGE FILE (APPL_FORM.PDF,CIMG1860.JPG)
-- YOU WANT TO STORE IN ORACLE TABLE IN THAT FOLDER. THEN EXECUTE THE PROCEDURE load_file_to_my_docs.
EXEC load_file_to_my_docs('APPL_FORM.PDF');
EXEC load_file_to_my_docs('CIMG1860.JPG');
COMMIT;
|
|
|
|
|
Re: IMAGE ON FORM 6i [message #415283 is a reply to message #415269] |
Mon, 27 July 2009 01:10 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hi Davd, my problem isnt sql .my problem is retrieving image stored on a datablock from oracle forms 6i .i have searched the forum but still failed to solve my problem.
Thankyou.
|
|
|
Re: IMAGE ON FORM 6i [message #415285 is a reply to message #415269] |
Mon, 27 July 2009 01:11 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
djmartin wrote on Mon, 27 July 2009 07:19 | Although you may be using Oracle Forms, your question is more SQL related that Forms related. I will move your thread.
David
|
The OP mentioned that the code does work fine, he just doesn't seem to know how to implement this in Forms. I wonder why you think this is not For128232716531729
Content-Disposition: form-data; name="msg_id"
415285
[Updated on: Mon, 27 July 2009 01:12] Report message to a moderator
|
|
|
|
|
Re: IMAGE ON FORM 6i [message #415352 is a reply to message #415298] |
Mon, 27 July 2009 06:16 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
hi shaz.Thankyou very much for your quick reply.
may be am doin it wrong somewhere.just help please me with the codes to write on the actual form.Also i want the blob image retrieved to match with employee_number field on the form(:employee_details.employee_number).
am using forms 6i and 10G databaSE.
Thankyou.
Goodtimes.
|
|
|
|
|
Re: IMAGE ON FORM 6i [message #604112 is a reply to message #604006] |
Tue, 24 December 2013 03:48 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hi Shahzad-ul-hasan
Thank you for your assistance.
i have done everything as you instructed Unfortunately I'm getting an error when I compile and the error is related to (:IID).
The actual scenario of my form is, it has a unique reg number plus other Items and now an image has to be linked to reg number. How do I do it chief?
Thank you,Merry Christmas.
|
|
|
|
|
|
|
Re: IMAGE ON FORM 6i [message #604896 is a reply to message #604225] |
Sun, 05 January 2014 17:09 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hi Shahzad-ul-hasan,
Happy new year.
Sorry for the late come back and Thank you for your help .Unfortunately it doesn't work. I corrected the IID issue and compiled successful.But I get an error "unable to resolve reference to item out.im"
Any help?
Thank again
|
|
|
|
Re: IMAGE ON FORM 6i [message #604916 is a reply to message #604225] |
Mon, 06 January 2014 02:46 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hi Igjeetu
I have Google everywhere still not getting it.I want the image to match the ren_number on the form this is what i have done so far.
create table graphics_table(
bfile_id varchar(20),
bfile_loc bfile,
bfile_type varchar2(4)
)
/
then
INSERT INTO graphics_table
VALUES(4,bfilename('C:\PHOTO\','SRB000002.JPG'),'JPEG');
ist right?
what do I right on the form now?
Please help.
|
|
|
Re: IMAGE ON FORM 6i [message #604917 is a reply to message #604896] |
Mon, 06 January 2014 02:47 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hi
I have Google everywhere still not getting it.I want the image to match the ren_number on the form this is what i have done so far.
create table graphics_table(
bfile_id varchar(20),
bfile_loc bfile,
bfile_type varchar2(4)
)
/
then
INSERT INTO graphics_table
VALUES(4,bfilename('C:\PHOTO\','SRB000002.JPG'),'JPEG');
ist right?
what do I right on the form now?
Please help.
|
|
|
|
|
|
|
|