list di bawah, saya dapet dari www.orafaq.com
klo kita mau terapin di Oracle Form,
bagaimana caranya, waktu kita click di button langsung tampilin isi file yg ada di column ad_graphic ?
makasih atas bantuannya.
salaam.
SQL> CREATE TABLE tmp_media
2 ( product_id NUMBER(6)
3 , ad_id NUMBER(6)
4 , ad_graphic BFILE)
5 /
Table created.
SQL> -- directory name must be inserted in upper case:
SQL> INSERT INTO tmp_media (product_id, ad_id, ad_graphic)
2 VALUES (1, 32001, bfilename('TMP_DIR', 'digital_0.pdf'))
3 /
1 row created.
SQL> INSERT INTO tmp_media (product_id, ad_id, ad_graphic)
2 VALUES (2, 32002, bfilename('TMP_DIR', 'finalProject.pdf'))
3 /
1 row created.
SQL> INSERT INTO tmp_media (product_id, ad_id, ad_graphic)
2 VALUES (3, 32003, bfilename('TMP_DIR', 'test.txt'))
3 /
1 row created.
SQL> SELECT product_id, ad_id FROM tmp_media
2 /
PRODUCT_ID AD_ID
---------- ----------
1 32001
2 32002
3 32003
SQL> CREATE OR REPLACE PROCEDURE displayBFILE_proc
2 IS
3 File_loc BFILE;
4 Buffer RAW(1024);
5 Amount BINARY_INTEGER := 1024;
6 Position INTEGER := 1;
7 BEGIN
8 /* Select the LOB: */
9 SELECT ad_graphic INTO File_loc
10 FROM tmp_media WHERE Product_ID = 3;
11 /* Opening the BFILE: */
12 DBMS_LOB.OPEN (File_loc, DBMS_LOB.LOB_READONLY);
13 LOOP
14 DBMS_LOB.READ (File_loc, Amount, Position, Buffer);
15 /* Display the buffer contents: */
16 DBMS_OUTPUT.PUT_LINE(utl_raw.cast_to_varchar2(Buffer));
17 Position := Position + Amount;
18 END LOOP;
19 /* Closing the BFILE: */
20 DBMS_LOB.CLOSE (File_loc);
21 EXCEPTION
22 WHEN NO_DATA_FOUND THEN
23 DBMS_OUTPUT.PUT_LINE('End of data');
24 DBMS_LOB.CLOSE (File_loc);
25 END;
26 /
Send instant messages to your online friends http://uk.messenger.yahoo.com
[Non-text portions of this message have been removed]
--
-----------I.N.D.O - O.R.A.C.L.E---------------
Keluar: [EMAIL PROTECTED]
Website: http://indo-oracle.lizt.org (NEW)
-----------------------------------------------
Bergabung dengan Indonesia Thin Client User Groups,
Terminal Server, Citrix, New Moon Caneveral, di:
http://indo-thin.vze.com
SPONSORED LINKS
| Membership database software | Database mortgage software | Pda database software |
| Database management software | Oracle database administration | Oracle database management |
YAHOO! GROUPS LINKS
- Visit your group "indo-oracle" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

