예제 #1
0
 public function GetSQL()
 {
     try {
         $obj = $this->object;
         $fields = GerenciadorSQL::GetFields($obj, true);
         $values = GerenciadorSQL::GetValues($obj, $fields, true);
         $numf = count($values);
         $sql = null;
         $sql .= "UPDATE " . $obj->GetTableName();
         $sql .= "   SET " . $this->MontaUpdate($numf, $fields, $values);
         $sql .= $this->MontaWherePK($numf, $fields, $values);
         $sql = trim($sql);
         return $sql;
     } catch (Exception $e) {
         $this->ShowException($e);
     }
 }
예제 #2
0
 public function GetSQL()
 {
     try {
         $obj = $this->object;
         $fields = GerenciadorSQL::GetFields($obj, true);
         $values = GerenciadorSQL::GetValues($obj, $fields, true);
         $numf = count($values);
         $sql = null;
         $sql .= "INSERT INTO " . $obj->GetTableName();
         $sql .= "(" . $this->MontaFieldsInsert($numf, $fields) . ")";
         $sql .= " VALUES ";
         $sql .= "(" . $this->MontaValuesInsert($numf, $values) . ")";
         $sql = trim($sql);
         return $sql;
     } catch (Exception $e) {
         $this->ShowException($e);
     }
 }
예제 #3
0
 public function GetSQL($isList = false)
 {
     try {
         $obj = $this->object;
         $fields = GerenciadorSQL::GetFields($obj, false);
         $values = GerenciadorSQL::GetValues($obj, $fields, false);
         $numf = count($values);
         $sql = null;
         $sql .= "SELECT *\n";
         $sql .= "  FROM " . $obj->GetTableName() . "\n";
         if (!$isList) {
             $sql .= $this->MontaWhere($numf, $fields, $values);
         }
         $sql = trim($sql);
         return $sql;
     } catch (Exception $e) {
         $this->ShowException($e);
     }
 }