Oracle con Zend Framwork 2

12 views
Skip to first unread message

Carlos Miguel Sing Ramos

unread,
Apr 16, 2014, 6:25:06 PM4/16/14
to zend-framew...@googlegroups.com, phplatin...@googlegroups.com, php...@googlegroups.com
Buenas, tengo un problemila con Zend Db, cuando realizo esta consulta:

SELECT 
      *
FROM MSISITDAC.CD_DOCTRAMITE
WHERE NRODOC LIKE 'REC-%'

en el SQLDeveloper me retorna los datos correspondientes,
pero cuando la realizo desde el mismo Zend, no me retorna filas.
Esta es el codigo:
$adapter = $this->tableGateway->getAdapter('msgral');
        $query = "
            SELECT 
                *
            FROM MSISITDAC.CD_DOCTRAMITE
            WHERE NRODOC LIKE 'REC-%'            
            ";

        $stmt = $adapter->createStatement($query);

        $rs = $stmt->execute();
        $data = array();
        foreach ($rs as $row) {
            array_push($data, $row);
        }

        return($data);

Es la primera vez que me pasa algo como esto.

Gracias.
--
Salu2
Ing. Carlos Sing Ramos.
Linux Register User  #525697.

Carlos Miguel Sing Ramos

unread,
Apr 16, 2014, 6:42:20 PM4/16/14
to Francis Angelino Gonzales Tello, php...@googlegroups.com, zend-framew...@googlegroups.com, phplatin...@googlegroups.com
hice esto, usando la clase SQL:

$sql = new Sql($this->tableGateway->getAdapter('msgral'));
        $select = $sql->select()
                ->columns(array('*'),false)
                ->from('MSISITDAC.CD_DOCTRAMITE')
                ->where(function(Where $where){
                        $where->like('NRODOC','REC%');
                })
                
                ;
        $stmt = $sql->prepareStatementForSqlObject($select);
        $logger->info($select->getSqlString());
        $rs =  $stmt->execute();
        $data = array();
        foreach ($rs as $row) {
            array_push($data, $row);
        }
        return($data);


Pero me dio el mismo resultado, lo curioso es que cuando quito el LIKE si me ejecuta, pero necesito ese LIKE para poder filtrar los datos jejeje.


2014-04-16 17:32 GMT-05:00 Francis Angelino Gonzales Tello <f.gonzale...@gmail.com>:


2014-04-16 17:26 GMT-05:00 Luis Cordova <cord...@gmail.com>:

usa un ladybug_dump mas arriba


--
You received this message because you are subscribed to the Google Groups "PHP Perú" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpperu+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "PHP Perú" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phpperu+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlos Miguel Sing Ramos

unread,
Apr 16, 2014, 7:29:55 PM4/16/14
to Francis Angelino Gonzales Tello, php...@googlegroups.com, zend-framew...@googlegroups.com, phplatin...@googlegroups.com
si, bro, es lo mas curioso.


2014-04-16 18:05 GMT-05:00 Francis Angelino Gonzales Tello <f.gonzale...@gmail.com>:
Agregaste los USE correctos en la parte superior?

Francis Angelino Gonzales Tello

unread,
Apr 16, 2014, 7:05:05 PM4/16/14
to Carlos Miguel Sing Ramos, php...@googlegroups.com, zend-framew...@googlegroups.com, phplatin...@googlegroups.com
Agregaste los USE correctos en la parte superior?
Reply all
Reply to author
Forward
0 new messages