TDbException

Description

TDbCommand failed to execute the query SQL "SELECT * FROM basico.recessos_municipais WHERE codigo_polo =": SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at end of input LINE 1: SELECT * FROM basico.recessos_municipais WHERE codigo_polo = ^

Source File

/dados/sites/www/apl/prado/framework/Data/TDbCommand.php (230)

0219:         try
0220:         {
0221:             // Prado::trace('Query: '.$this->getDebugStatementText(), 'System.Data');
0222:             if($this->_statement instanceof PDOStatement)
0223:                 $this->_statement->execute();
0224:             else
0225:                 $this->_statement=$this->getConnection()->getPdoInstance()->query($this->getText());
0226:             return new TDbDataReader($this);
0227:         }
0228:         catch(Exception $e)
0229:         {
0230: throw new TDbException('dbcommand_query_failed',$e->getMessage(),$this->getDebugStatementText());
0231: } 0232: } 0233: 0234: /** 0235: * Executes the SQL statement and returns the first row of the result. 0236: * This is a convenient method of {@link query} when only the first row of data is needed. 0237: * @param boolean whether the row should be returned as an associated array with 0238: * column names as the keys or the array keys are column indexes (0-based). 0239: * @return array the first row of the query result, false if no result. 0240: * @throws TDbException execution failed 0241: */ 0242: public function queryRow($fetchAssociative=true)

Stack Trace

#0 /dados/sites/www/apl/prado/framework/Data/DataGateway/TDataGatewayCommand.php(134): TDbCommand->query()
#1 /dados/sites/www/apl/prado/framework/Data/ActiveRecord/TActiveRecordGateway.php(225): TDataGatewayCommand->findAll(Object(TActiveRecordCriteria))
#2 /dados/sites/www/apl/prado/framework/Data/ActiveRecord/TActiveRecord.php(600): TActiveRecordGateway->findRecordsByCriteria(Object(ARRecessosMunicipais), Object(TActiveRecordCriteria), true)
#3 /dados/sites/www/apl/curso_polo/protected/ar/ARRecessosMunicipais.php(27): TActiveRecord->findAll('codigo_polo = ')
#4 /dados/sites/www/apl/curso_polo/protected/pages/PoloPerfil.php(168): ARRecessosMunicipais->buscarFeriadosPolo(NULL)
#5 /dados/sites/www/apl/curso_polo/protected/pages/PoloPerfil.php(17): PoloPerfil->preencherPolo(Object(ARPolo))
#6 /dados/sites/www/apl/prado/framework/Web/UI/TControl.php(1286): PoloPerfil->onLoad(NULL)
#7 /dados/sites/www/apl/prado/framework/Web/UI/TPage.php(215): TControl->loadRecursive()
#8 /dados/sites/www/apl/prado/framework/Web/UI/TPage.php(198): TPage->processNormalRequest(Object(THtmlWriter))
#9 /dados/sites/www/apl/prado/framework/Web/Services/TPageService.php(498): TPage->run(Object(THtmlWriter))
#10 /dados/sites/www/apl/prado/framework/Web/Services/TPageService.php(444): TPageService->runPage(Object(PoloPerfil), Array)
#11 /dados/sites/www/apl/prado/framework/TApplication.php(1095): TPageService->run()
#12 /dados/sites/www/apl/prado/framework/TApplication.php(382): TApplication->runService()
#13 /dados/sites/www/apl/curso_polo/index.php(24): TApplication->run()
#14 {main}
2024-05-03 22:31 Apache/2.4.29 (Ubuntu) PRADO/3.1.9