Insert data from sql file when call hook_schema on drupal 7
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);
  }
}