Insert data from sql file when call hook_schema on drupal 7 I developed a module in drupal 7 that need a database table like "example_table". And i create "example_table" table using example_schema() function. Now I need to insert some default data. 

Here, I can use drupal_write_record('example_table', $data); function to insert data into example_install() function.

But, I want to insert data from example_db.sql file. 

How can I do it? Any Suggestions?
You can try this, hope it helps.

$db = new PDO($dsn, $user, $password);
$sql = file_get_contents('file.sql');
$qr = $db-&gt;exec($sql);


Otherwise try this, but i am also not aware of this correctly,

function my_module_install() {
  // Get the contents of the .sql file.
  $sql = file_get_contents(drupal_get_path('module', 'my_module') . '/module.sql');
  // Split into individual statements based on new lines.
  $statements = preg_split('/[\n\r]+/', $sql);
  foreach ($statements as $query) {
    db_query($query);
  }
}