Categories
BLOB Load File Into BLOB Oracle PL/SQL

Loading a File Into a BLOB Object in Oracle

Loading a file into a BLOB object in Oracle is easy. All we need to do is use the DBMS_LOB package to load the file into a temporary LOB object. This is demonstrated in the following example.

This example assumes that you have a directory object set up where the files are stored. In this example the following object is used:

CREATE DIRECTORY FILEUPLOADS AS '/home_new/dmt/public_html/fileuploads';

Use the following function to load a file based on the filename parameter and return the BLOB reference for processing:


CREATE OR REPLACE FUNCTION loadBlobFromFile(p_file_name VARCHAR2) RETURN BLOB AS
  dest_loc  BLOB := empty_blob();
  src_loc   BFILE := BFILENAME('FILEUPLOADS', p_file_name);
BEGIN
  -- Open source binary file from OS
  DBMS_LOB.OPEN(src_loc, DBMS_LOB.LOB_READONLY);
  
  -- Create temporary LOB object
  DBMS_LOB.CREATETEMPORARY(
        lob_loc => dest_loc
      , cache   => true
      , dur     => dbms_lob.session
  );
    
  -- Open temporary lob
  DBMS_LOB.OPEN(dest_loc, DBMS_LOB.LOB_READWRITE);
  
  -- Load binary file into temporary LOB
  DBMS_LOB.LOADFROMFILE(
        dest_lob => dest_loc
      , src_lob  => src_loc
      , amount   => DBMS_LOB.getLength(src_loc));
  
  -- Close lob objects
  DBMS_LOB.CLOSE(dest_loc);
  DBMS_LOB.CLOSE(src_loc);
  
  -- Return temporary LOB object
  RETURN dest_loc;
END loadBlobFromFile;
/

Easy as that.

Categories
DivX DVR-MS MP4 MPG Video Conversion

MP4 to DivX Conversion

I’ve just found out that MCEBuddy also works for converting MP4 to DivX.

To convert MP4 to DivX, just follow the instructions below.

  1. Go to http://mcebuddy.com/, and follow the instruction to install MCEBuddy.
  2. Once installed, open MCEBuddy, tick “File Selection” and enter either *.mp4 (to convert only MPG files) or *.* (to convert any format to AVI – I’ve found that MCEBuddy converts DVR-MS, MPG, and MP4 files effectively!).

What a great tool!

Categories
CHAR Datatype Oracle VARCHAR2

Oracle VARCHAR2(1) vs CHAR(1)?

Well, minimum size for both Oracle datatypes is 1 byte. So in terms of storage, they’ll both consume either null or 1 byte in storage space. So, when declaring a character datatype with a length of 1, it doesn’t really matter which one you use. The rules change when the length is greater than 1 though.

This is because CHAR is a fixed character data, so values held in this datatype is always RPAD’ed with blanks. Storing character data as VARCHAR2 will save space on, not just the character field, but any indexes that reference it.

As a personal preference, I always use VARCHAR2. The most important practice though is to be consistent. For example, if you use CHAR for a 1 byte character datatype and VARCHAR2 for everything else, then stick with it throughout your whole database.

Categories
seo website backlinks website marketing

SEO and Quality Backlinks

Internet TrafficIt is almost impossible to generate regular traffic to your website without backlinks pointing to your site. Quality web backlinks play a vital part when it comes to optimizing your website, which directly impacts its SERPs position and Page Rank. Better SERPs position and a better Page Rank, means more traffic for your website!

The reason behind the importance of web backlinks is because Search Engine spiders primarily examine website backlinks when determining a site’s significance. In a nutshell, a site’s popularity is predominantly based on the number of quality links dispersed all over the internet pointing back to the site. The more “good friends” your website has, the more popular it will be, and it will be more inclined to attract and make more good friends.

The term “quality backlinks” simply means that website containing the link back to your site has rich meaningful textual content that is relevant to the nature of your site. So it’s a good idea to be selective when deciding which site or service to approach to provide the backlink for you.

The most successful means of acquiring backlinks pointing back to your website is through link trading. This is the method of exchanging your link for someone else’s. Effectively, your link partner will agree to create a link to your website, if you agree to create a link to his website.

Categories
instant contact form

Instant Contact Form For Your Web Page

Start receiving messages via a contact web form on your web page instantly by including one line of code! That’s right, one line of javascript code.

There no need to write a complex program in order to receive messages for your web page. We’ve done the hard work for you. Messages are also moderated so you’ll never receive any spam email. Just add the code and we’ll look after the rest.

For more information, visit http://www.web-backlinks.com/instantcontactform/.

Adding the code will include a web form similar to the one below (Try it out, this is a live demo):

Categories
instant comment form

Instant Comment Form For Your Web Page

Start receiving and publishing comments on your static web page instantly by including one line of code! That’s right, one line of  javascript code.

There no need to write a complex program in order to receive comments for your web page. We’ve done the hard work for you. Comments are also moderated so you don’t need to do any form of administration on your end. Just add the code and we’ll look after the rest.

For more information, visit http://www.web-backlinks.com/instantcommentform/.

Adding the code will include a web form similar to the one below (Try it out, this is a live demo):