Re[2]: [PHP-ES] String query en Oracle -Denme de baja

From: Date: Fri, 11 Jul 2003 15:31:08 +0000
Subject: Re[2]: [PHP-ES] String query en Oracle -Denme de baja
Groups: php.general.es 
Request: Send a blank email to general-es+get-38360@lists.php.net to get a copy of this message
Un consejo, monta primero el Sql en una variable y mira como lo monta.... ----- Original Message ----- From: <BRMEJIA@bancolombia.com.co> To: <lista@phpes.com> Sent: Thursday, July 10, 2003 5:44 PM Subject: [PHP-ES] String query en Oracle > Buenos Dias, > > Estoy accediendo a una base de datos Oracle, miren el siguiente pedazo de > codigo: > > > $connection = ocilogon("mdstatus", "mdstatus", "TIV1.ORGBC.COM"); > > > > > $query = 'select * from dist_node_state where DISTRIBUTION_ID='.$_id; > --> $_id es una variable que cambia de valor, es varchar en la tabla > oracle > > > > $stmt = OCIParse($connection, $query); --> Esta linea no funciona > pero la siguiente si funciona, en ella no uso la variable. > > /* Esta linea si funciona --> $stmt = OCIParse ($connection, "select * > from dist_node_state where distribution_ID ='$IdDistribucion'"); */ > > > Noten que estoy simplemente concatenando la parte fija del query con una > parte variable para adicionarle el where, pero no quiere funcionar. > El error que me genera es: > > Warning: OCIStmtExecute: ORA-01722: invalid number in C:\apache\htdocs\sd\prueba_dist_node_state.php on line 125 > > Alguien tiene un ejemplo en donde se arme la variable query con where > usando variables y que le funcione para que por favor me ayude. > > Gracias > > > > > > > > > > > > > > _______________________ > Bruno A Mejia C > Gerencia de Redes Locales > Tel: (574) 5108896 Ext 8595 > Dir: Cra 52 # 50-20 > Direccion General - Piso 15 > www.bancolombia.com > > This email is confidential and may contain proprietary or privileged > information. It is intended for use by the named recipient(s) only. > If you have received it in error, please notify the sender immediately > by reply email. Please do not copy or disclose its contents to any > person or body. Immediately delete it from your computer systems. --------------------------------------------------------------- ------ Archivo On-line: http://www.phpes.com/ via news: news://news.phpes.com/ Manual PHP en español: http://www.php.net/manual/es/ Para dar de baja la suscripción, mande un mensaje a: lista-unsubscribe@phpes.com

« previous php.general.es (#38360) next »