..:: MX Studio Fóruns ::..: Duvida com update - ..:: MX Studio Fóruns ::..

Jump to content

Publicidade




Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Duvida com update

#1 User is offline   Marcony 

  • Group: Membros
  • Posts: 12
  • Joined: 13-May 11

Posted 16 May 2011 - 03:09 PM

Olá pessoal, estou com uma dúvida em um processo do Lumine.

Quando executo a rotina :

<?php
Lumine::import( Recado );
		$Recado = new Recado;
		$Recado->indStatus = 'D';
		$Recado->alias('r');
		$Recado->where('r.codRecado IN(1)');
		$Recado->update(true);

O sistema me retorna uma série de erros, abaixo :

16/05/2011 14:29:13 - LOG:  Executando consulta: UPDATE tb_recado  SET ind_status = 'D' WHERE r.codRecado IN(1) (/home/projetosweb/public_html/mystante.com.br/lib/Lumine/lib/Dialect/PostgreSQL.php, 179)

16/05/2011 14:29:13 - LOG:  Utilizando conexao cacheada com mystante (/home/projetosweb/public_html/mystante.com.br/lib/Lumine/lib/Connection/PostgreSQL.php, 43)

16/05/2011 14:29:13 - ALERTA:  Falha na consulta: ERROR:  missing FROM-clause entry for table "r"
LINE 1: UPDATE tb_recado  SET ind_status = 'D' WHERE r.codRecado IN(...
                                                     ^ (/home/projetosweb/public_html/mystante.com.br/lib/Lumine/lib/Dialect/PostgreSQL.php, 224)


Fatal error: Uncaught exception 'Lumine_SQLException' with message 'ERROR: missing FROM-clause entry for table "r" LINE 1: UPDATE tb_recado SET ind_status = 'D' WHERE r.codRecado IN(... ^' in /home/projetosweb/public_html/mystante.com.br/lib/Lumine/lib/Base.php:4219 Stack trace: #0 /home/projetosweb/public_html/mystante.com.br/lib/Lumine/lib/Base.php(1132): Lumine_Base->_execute('UPDATE tb_recad...') #1 /home/projetosweb/public_html/mystante.com.br/controllers/socialController.php(236): Lumine_Base->update(true) #2 /home/projetosweb/public_html/mystante.com.br/lib/engine.php(165): socialController->deletarRecadoAction(NULL) #3 /home/projetosweb/public_html/mystante.com.br/lib/engine.php(57): engine->classManager() #4 /home/projetosweb/public_html/mystante.com.br/index.php(77): engine->start() #5 {main} thrown in /home/projetosweb/public_html/mystante.com.br/lib/Lumine/lib/Base.php on line 4219


Alguém pode me dar alguma dica ?
0

#2 User is offline   hufersil 

  • Group: Moderadores
  • Posts: 1265
  • Joined: 15-January 04

Posted 16 May 2011 - 03:11 PM

O banco de dados não suporta ALIAS em update's.

Coloque o nome do campo que quer fazer a condição entre chaves:

<?php
Lumine::import( Recado );
$Recado = new Recado;
$Recado->indStatus = 'D';
$Recado->where('{codRecado} IN(?)', array(1));
$Recado->update(true);


@braços e fique com Deus!
0

#3 User is offline   Marcony 

  • Group: Membros
  • Posts: 12
  • Joined: 13-May 11

Posted 16 May 2011 - 03:17 PM

Obrigado Hugo, mais uma vez deu certo! Recomendo a ferramenta !
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic



Publicidade




1 User(s) are reading this topic
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)