Browse Source

fixed get sp args

develop
Robin Thoni 8 years ago
parent
commit
9cde0b665b
2 changed files with 4 additions and 2 deletions
  1. 2
    1
      src/Utils/DataAccess/PgSqlDataAccess.php
  2. 2
    1
      tests/DatabaseTest.php

+ 2
- 1
src/Utils/DataAccess/PgSqlDataAccess.php View File

234
      */
234
      */
235
     public function getStoredProceduresArguments($pdo, $sp)
235
     public function getStoredProceduresArguments($pdo, $sp)
236
     {
236
     {
237
-        $sp_name = $sp["sp_name"];
237
+        $sp_name = $sp["sp"]["sp_name"];
238
         $spQuery = $pdo->prepare("SELECT parameters.parameter_name as name, parameters.data_type, parameters.parameter_mode
238
         $spQuery = $pdo->prepare("SELECT parameters.parameter_name as name, parameters.data_type, parameters.parameter_mode
239
 FROM information_schema.routines
239
 FROM information_schema.routines
240
 JOIN information_schema.parameters ON routines.specific_name=parameters.specific_name
240
 JOIN information_schema.parameters ON routines.specific_name=parameters.specific_name
243
         if ($spQuery->execute(array("sp_name" => $sp_name)))
243
         if ($spQuery->execute(array("sp_name" => $sp_name)))
244
         {
244
         {
245
             $sp_ = $spQuery->fetchAll();
245
             $sp_ = $spQuery->fetchAll();
246
+            var_dump($sp_);
246
             $sps = array("in" => array(), "out" => array());
247
             $sps = array("in" => array(), "out" => array());
247
             foreach ($sp_ as $p)
248
             foreach ($sp_ as $p)
248
                 $sps[strtolower($p["parameter_mode"])][] = $p;
249
                 $sps[strtolower($p["parameter_mode"])][] = $p;

+ 2
- 1
tests/DatabaseTest.php View File

169
 
169
 
170
         $pdo = TestTableDataAccess::getPdo();
170
         $pdo = TestTableDataAccess::getPdo();
171
         $pgsql = new PgSqlDataAccess();
171
         $pgsql = new PgSqlDataAccess();
172
-        var_dump($pgsql->getStoredProceduresFull($pdo));
172
+        $pgsql->getStoredProceduresFull($pdo);
173
+//        var_dump($pgsql->getStoredProceduresFull($pdo));
173
     }
174
     }
174
 }
175
 }

Loading…
Cancel
Save