Dr. Dobb's Journal - February 2009 - (Page 28) d02will_p1db 12/12/08 10:31 AM Page 28 State of the Art by Greg Williams Videos and Oracle Forms 10g Accessing unstructured data Although Oracle Forms is no longer a flagship development tool, Oracle continues to devote resources so users can store unstructured data such as videos, word documents, and XML docGreg is a Senior Database Administrator for Lockheed Martin. He can be contacted at gregory.j.williams@lmco.com. uments. In this article, I show how you take advantage of unstructured data in the database— video, in this case—and access this data from Forms. Inserting Videos Into Oracle 9i Databases The other day I showed a client that I could insert and call a video from Oracle Portal. He suggested that I call the video from our in-house application, which is written in Oracle Forms and Reports 10g release 2. I told him that it could be done, but I didn’t know how to do it. Consequently, I began searching Google and Ask.com, using search phrases such as “oracle forms 10g video” and the like. Because this didn’t give me useful results, I submitted an SR with Oracle support, who offered up suggestions that led me in the right direction. What I learned is that before you can insert the video, you need a table to store the video. To store videos, you need a datatype that can hold the video. Since most videos are binary and larger than 4000 characters, a varchar2 datatype won’t work. Therefore, the best datatype for binary data source is a Blob—a binary large object that can store up to 4 GB of unstructured or binary data. Listing One creates a table called Multimedia with a Blob field called theblob. Notice that Multimedia is stored in tablespace table_data1, and Blob data is stored in table_data2. 28 Dr. Dobb’s Journal l www.ddj.com l February 2009 Assuming that the two tablespaces are stored on datafiles located on two different drives, this separation helps in reducing the access time for table Multimedia. To insert the video into the database, I use a procedure called Load_multimedia(). For this procedure, you need a directory path setup pointing to where the video file is located. Listing Two sets up a directory from the database. The Load_multimedia() procedure inserts a video from the filesystem into the table Multimedia. In this procedure, I use these procedures from the dbms_lob package: • dbms_lob.fileopen() • dbms_lob.loadfromfile() • dbms_lob.fileclose() which open, load, and close the video file, respectively; see Listing Three. For this example, I hardcoded the directory name and filename, where DOCHOME is the name of my directory and Gulfport.wmv the name of my video file. http://www.Ask.com http://www.ddj.com
Table of Contents Feed for the Digital Edition of Dr. Dobb's Journal - February 2009 Dr. Dobb's Journal - February 2009 Contents Friday Night Fish Fry Alia Vox Developer Diaries Conversations Computing in the Clouds Software Development in the Cloud Videos and Oracle Forms 10g Parallel LINQ Decoupling C Header Files Effective Concurrency Disciplined Agility Swaine’s Flames Dr. Dobb's Journal - February 2009 Dr. Dobb's Journal - February 2009 - (Page BB1) Dr. Dobb's Journal - February 2009 - (Page BB2) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page Cover1) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page Cover2) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page 1) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page 2) Dr. Dobb's Journal - February 2009 - Dr. Dobb's Journal - February 2009 (Page 3) Dr. Dobb's Journal - February 2009 - Contents (Page 4) Dr. Dobb's Journal - February 2009 - Contents (Page 5) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 6) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 7) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 8) Dr. Dobb's Journal - February 2009 - Friday Night Fish Fry (Page 9) Dr. Dobb's Journal - February 2009 - Alia Vox (Page 10) Dr. Dobb's Journal - February 2009 - Alia Vox (Page 11) Dr. Dobb's Journal - February 2009 - Developer Diaries (Page 12) Dr. Dobb's Journal - February 2009 - Developer Diaries (Page 13) Dr. Dobb's Journal - February 2009 - Conversations (Page 14) Dr. Dobb's Journal - February 2009 - Conversations (Page 15) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 16) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 17) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 18) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 19) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 20) Dr. Dobb's Journal - February 2009 - Computing in the Clouds (Page 21) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 22) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 23) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 24) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 25) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 26) Dr. Dobb's Journal - February 2009 - Software Development in the Cloud (Page 27) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 28) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 29) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 30) Dr. Dobb's Journal - February 2009 - Videos and Oracle Forms 10g (Page 31) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 32) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 33) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 34) Dr. Dobb's Journal - February 2009 - Parallel LINQ (Page 35) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 36) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 37) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 38) Dr. Dobb's Journal - February 2009 - Decoupling C Header Files (Page 39) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 40) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 41) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 42) Dr. Dobb's Journal - February 2009 - Effective Concurrency (Page 43) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 44) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 45) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 46) Dr. Dobb's Journal - February 2009 - Disciplined Agility (Page 47) Dr. Dobb's Journal - February 2009 - Swaine’s Flames (Page 48) Dr. Dobb's Journal - February 2009 - Swaine’s Flames (Page Cover3) Dr. Dobb's Journal - February 2009 - Swaine’s Flames (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.