Hola. Con runsqlstm no puedes ejecutar select, han de ser  sentencias
insert, update, delete, create table, ...

respecto al sqlrpg, puede ser problema del control de compromiso. Cuando lo
compiles selecciona control de compromiso: *none

El 21 de abril de 2011 17:14, Fco. Javier B. L. <[email protected]>escribió:

>
> *Aquí tengo el miembro con la sentencia SQL : *
> -----------------------------------------------------------------------
>
>  Columnas  . . :    1  71           Examen
> DEPOTS/QSQLSRC
>  SEU==>
> SQL1
>         *************** Principio de datos
> ************************************
> 0001.00 SELECT COUNT(*) FROM
> DEPOTF/MTIVASF
>         ****************** Fin de datos
> ***************************************
> **
> *Ejecuto el mandato :*
> -------------------------------
>
>
>  ===> RUNSQLSTM SRCFILE(DEPOTS/QSQLSRC) SRCMBR(SQL1)
> El mandato RUNSQLSTM ha tenido errores.
>
>
> Como véis, da errores.
>
> *Otra cosa*, he observado lo siguiente también.
> -------------
> He creado un RPG/400 con sentencias SQL, en concreto :
>
>      H            D/
>      C*****************************************************************
>      C* Programa principal
>      C*****************************************************************
>       *
>      C/EXEC SQL
>      C+ UPDATE DEPOTF/SALIDA1 SET FDIMPO = FDIMPO*-1 WHERE FCSERI='ABN'
>      C/END-EXEC
>       *
>      C                     SETON                     LR
>  **
> Y no se ejecuta.
> Entro con STRSQL y pongo exactamente el mismo UPDATE y funciona
> perfectamene.
> ¿Alguien me puede explicar este otro misterio?
>
> Muchas gracias.
>
> Javier.
> *
> ------------------------------
> *
>
> *Este mensaje y cualquier fichero adjunto esta dirigido únicamente a sus
> destinatarios y pueden contener información confidencial. Si usted
> considera que ha recibido este correo electrónico por error (por el asunto,
> por el remitente o por cualquier otra causa), le informamos que cualquier
> revisión, alteración, impresión, copia o transmisión de este mensaje o de
> cualquier fichero adjunto está prohibida y puede constituir un acto ilegal.
> Por favor, notifíquele el error al remitente respondiendo a este e-mail
> y elimine el mensaje y su contenido inmediatamente. ** *
>
> **
>
> *This e-mail and any files transmitted with it are intended solely for the
> use of the intended recipients and may contain confidential information. If
> it appears (from the subject matter or address information or otherwise)
> that you received this email in error, please note that any review,
> dissemination, disclosure, alteration, printing, copying or transmission of
> this e-mail or any file transmitted with it is prohibited and may be
> unlawful. Please notify us by return email and delete this email and its
> contents immediately. *
> *
> ------------------------------
> *
>
>
>
>
>
> > From: [email protected]
> > Subject: Resumen de Forum.help400, Vol 54, Envío 28
>
> > To: [email protected]
> > Date: Thu, 21 Apr 2011 16:54:09 +0200
> >
> > Envíe los mensajes para la lista Forum.help400 a
>
> > [email protected]
> >
> > Para subscribirse o anular su subscripción a través de la WEB
> > http://listas.combios.es/cgi-bin/mailman/listinfo/forum.help400
> >
> > O por correo electrónico, enviando un mensaje con el texto "help" en
> > el asunto (subject) o en el cuerpo a:
> > [email protected]
> >
> > Puede contactar con el responsable de la lista escribiendo a:
> > [email protected]
> >
> > Si responde a algún contenido de este mensaje, por favor, edite la
> > linea del asunto (subject) para que el texto sea mas especifico que:
> > "Re: Contents of Forum.help400 digest...". Además, por favor, incluya
> > en la respuesta sólo aquellas partes del mensaje a las que está
> > respondiendo.
> >
> >
> > Asuntos del día:
> >
> > 1. EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > (Fco. Javier B. L.)
> > 2. RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > (Pedro Molina)
> > 3. RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > (Sergio Bortolo)
> > 4. QUERY CON PARAMETROS (Fco. Javier B. L.)
> > 5. RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > (Pedro Molina)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
>
> > Date: Thu, 21 Apr 2011 15:35:23 +0200
> > From: "Fco. Javier B. L." <[email protected]>
>
> > Subject: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > To: Foro-Help400 <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="iso-8859-1"
>
> >
> >
> > Buenas tardes :
> >
> > Quiero ejecutar sentencias SQL que estén dentro de un miembro con vistas
> a hacerlo dentro de un CL.
> > Es posible? cómo se hace?
> > He visto el mandato, he creado una sentencia SQL dentro de un miembro y
> lo he ejecutado con RUNSQLSTM, pero no ha funcionado.
> >
> > Un saludo y gracias.
> > Javier.
> >
> >
> >
> >
> >
> >
> >
> >
> > Este mensaje y cualquier fichero adjunto esta dirigido únicamente a sus
> destinatarios y pueden contener información confidencial. Si usted considera
> que ha recibido este correo electrónico por error (por el asunto, por el
> remitente o por cualquier otra causa), le informamos que cualquier revisión,
> alteración, impresión, copia o transmisión de este mensaje o de cualquier
> fichero adjunto está prohibida y puede constituir un acto ilegal. Por favor,
> notifíquele el error al remitente respondiendo a este e-mail y elimine el
> mensaje y su contenido inmediatamente.
> >
> > This e-mail and any files transmitted with it are intended solely for the
> use of the intended recipients and may contain confidential information. If
> it appears (from the subject matter or address information or otherwise)
> that you received this email in error, please note that any review,
> dissemination, disclosure, alteration, printing, copying or transmission of
> this e-mail or any file transmitted with it is prohibited and may be
> unlawful. Please notify us by return email and delete this email and its
> contents immediately.
> >
> >
> >
> >
> >
> >
> > ------------ próxima parte ------------
> > Se ha borrado un adjunto en formato HTML...
> > URL: <
> http://listas.combios.es/cgi-bin/mailman/private/forum.help400/attachments/20110421/c18031ae/attachment-0001.html
> >
> >
> > ------------------------------
> >
> > Message: 2
>
> > Date: Thu, 21 Apr 2011 13:49:35 +0000
> > From: Pedro Molina <[email protected]>
>
> > Subject: RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > To: <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="utf-8"
>
> >
> >
> > Javier.
> >
> > Yo lo he hecho con miembro tipo TXT y me ha funcionado perfectamente,
> sobre todo que los he usado para crear procedimientos almacenados con un
> script de SQL, pero también he puesto sentencias puras SQL y también me
> funciona.
> >
> > No se como habrás hecho si pudieras poner el ejemplo que no te funciona,
> talvez pudieramos hacer algo.
> >
> > Salu2!!
> >
> > From: [email protected]
> > To: [email protected]
> > Subject: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > Date: Thu, 21 Apr 2011 15:35:23 +0200
> >
> >
> >
> >
> >
> >
> >
> >
> > Buenas tardes :
> >
> >
> >
> > Quiero ejecutar sentencias SQL que estén dentro de un miembro con vistas
> a hacerlo dentro de un CL.
> >
> > Es posible? cómo se hace?
> >
> > He visto el mandato, he creado una sentencia SQL dentro de un miembro y
> lo he ejecutado con RUNSQLSTM, pero no ha funcionado.
> >
> >
> >
> > Un saludo y gracias.
> >
> > Javier.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Este mensaje y cualquier fichero adjunto esta dirigido únicamente a sus
> destinatarios y pueden contener información confidencial. Si usted considera
> que ha recibido este correo electrónico por error (por el asunto, por el
> remitente o por cualquier otra causa), le informamos que cualquier revisión,
> alteración, impresión, copia o transmisión de este mensaje o de cualquier
> fichero adjunto está prohibida y puede constituir un acto ilegal. Por favor,
> notifíquele el error al remitente respondiendo a este e-mail y elimine el
> mensaje y su contenido inmediatamente.
> >
> > This e-mail and any files transmitted with it are intended solely for the
> use of the intended recipients and may contain confidential information. If
> it appears (from the subject matter or address information or otherwise)
> that you received this email in error, please note that any review,
> dissemination, disclosure, alteration, printing, copying or transmission of
> this e-mail or any file transmitted with it is prohibited and may be
> unlawful. Please notify us by return email and delete this email and its
> contents immediately.
> >
> >
> >
> >
> >
> >
> >
> > ____________________________________________________
> > ?nete a Recursos AS400, nuestra Comunidad ( http://bit.ly/db68dd )
> > Forum.Help400 ? Publicaciones Help400, S.L.
> > ------------ próxima parte ------------
> > Se ha borrado un adjunto en formato HTML...
> > URL: <
> http://listas.combios.es/cgi-bin/mailman/private/forum.help400/attachments/20110421/c0b731d3/attachment-0001.htm
> >
> >
> > ------------------------------
> >
> > Message: 3
>
> > Date: Thu, 21 Apr 2011 11:33:35 -0300
> > From: Sergio Bortolo <[email protected]>
>
> > Subject: RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > To: "forum.help400" <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="utf-8"
>
> >
> >
> > Lo que debes hacer es un OVRDBF antes de ejecutar el SQL indicando a que
> miembro vas a apuntar dentro del archivo.
> >
> > Saludos.
> >
> > Sergio
> >
> >
> >
> >
> > From: [email protected]
> > To: [email protected]
> > Subject: RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > Date: Thu, 21 Apr 2011 13:49:35 +0000
> >
> >
> >
> >
> > Javier.
> >
> > Yo lo he hecho con miembro tipo TXT y me ha funcionado perfectamente,
> sobre todo que los he usado para crear procedimientos almacenados con un
> script de SQL, pero también he puesto sentencias puras SQL y también me
> funciona.
> >
> > No se como habrás hecho si pudieras poner el ejemplo que no te funciona,
> talvez pudieramos hacer algo.
> >
> > Salu2!!
> >
> >
> >
> > From: [email protected]
> > To: [email protected]
> > Subject: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > Date: Thu, 21 Apr 2011 15:35:23 +0200
> >
> >
> >
> > Buenas tardes :
> >
> > Quiero ejecutar sentencias SQL que estén dentro de un miembro con vistas
> a hacerlo dentro de un CL.
> > Es posible? cómo se hace?
> > He visto el mandato, he creado una sentencia SQL dentro de un miembro y
> lo he ejecutado con RUNSQLSTM, pero no ha funcionado.
> >
> > Un saludo y gracias.
> > Javier.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Este mensaje y cualquier fichero adjunto esta dirigido únicamente a sus
> destinatarios y pueden contener información confidencial. Si usted considera
> que ha recibido este correo electrónico por error (por el asunto, por el
> remitente o por cualquier otra causa), le informamos que cualquier revisión,
> alteración, impresión, copia o transmisión de este mensaje o de cualquier
> fichero adjunto está prohibida y puede constituir un acto ilegal. Por favor,
> notifíquele el error al remitente respondiendo a este e-mail y elimine el
> mensaje y su contenido inmediatamente.
> >
> > This e-mail and any files transmitted with it are intended solely for the
> use of the intended recipients and may contain confidential information. If
> it appears (from the subject matter or address information or otherwise)
> that you received this email in error, please note that any review,
> dissemination, disclosure, alteration, printing, copying or transmission of
> this e-mail or any file transmitted with it is prohibited and may be
> unlawful. Please notify us by return email and delete this email and its
> contents immediately.
> >
> >
> >
> >
> >
> >
> > ____________________________________________________ ?nete a Recursos
> AS400, nuestra Comunidad ( http://bit.ly/db68dd ) Forum.Help400 ?
> Publicaciones Help400, S.L.
> > ____________________________________________________ ?nete a Recursos
> AS400, nuestra Comunidad ( http://bit.ly/db68dd ) Forum.Help400 ?
> Publicaciones Help400, S.L.
> > ------------ próxima parte ------------
> > Se ha borrado un adjunto en formato HTML...
> > URL: <
> http://listas.combios.es/cgi-bin/mailman/private/forum.help400/attachments/20110421/a847c693/attachment.htm
> >
> >
> > ------------------------------
> >
> > Message: 4
> > Date: Thu, 21 Apr 2011 16:38:43 +0200
> > From: "Fco. Javier B. L." <[email protected]>
> > Subject: QUERY CON PARAMETROS
> > To: Foro-Help400 <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> >
> > Buenas tardes :
> > Estoy haciendo un CL que llama a un query que recibe parámetros y me da
> un error.
> > Lo curioso es que he hecho otro, el primero, y me ha ido bien, y son muy
> parecidos.
> > El query lo coge de otros ficheros pero la "sustancia" es la misma.
> > No lo entiendo, ¿alguien me puede ayudar?
> >
> > CL :
> >
> > PGM PARM(&PCLI &PFECD &PFECH)
> > /* declaración de parámetros */
> >
> > DCL VAR(&PCLI) TYPE(*CHAR) LEN(4)
> > DCL VAR(&PFECD) TYPE(*CHAR) LEN(8)
> > DCL VAR(&PFECH) TYPE(*CHAR) LEN(8)
> >
> > /* crear query con salida a fichero */
> >
> > DLTF FILE(DEPOTF/SALIDA2)
> > MONMSG MSGID(CPF0000)
> > STRQMQRY QMQRY(CONSULTAS/FRASARKAS2) OUTPUT(*OUTFILE) +
> > QMFORM(*QMQRY) OUTFILE(DEPOTF/SALIDA2) +
> > ALWQRYDFN(*NO) SETVAR((WCLI &PCLI))
> > DLTSPLF FILE(QPQXPRTF)
> > MONMSG MSGID(CPF0000)
> >
> > ENDPGM
> >
> > Condiciones del query :
> >
> > INCLIE EQ :wcli
> > AND INFEPR RANGE 20110101 20110131
> > AND T02.TATIPO EQ 'TICO'
> > AND WCON LIST '01' '02' '03' '07'
> >
> > Error :
> >
> > No se ha encontrado el objeto SALIDA2 en DEPOTF de tipo *FILE.
> > No se ha encontrado el objeto FRASARKAS2 en la biblioteca CONSULTAS.
> > El mandato RUN QUERY finalizó debido a un error.
> > Anomalía en mandato STRQMQRY.
> > Error de función. QWM2701 no supervisado por MTU086C en la sentencia 477,
> > instrucción X'0017'.
> > MTU086C ha recibido QWM2701 en la sentencia 477. (C D I R)
> > MTU086C ha recibido QWM2701 en la sentencia 477. (C D I R)
> >
> > Un saludo y muchas gracia.
>
> > Javier.
> >
> >
> >
> >
> >
> >
> >
> > Este mensaje y cualquier fichero adjunto esta dirigido únicamente a sus
> destinatarios y pueden contener información confidencial. Si usted considera
> que ha recibido este correo electrónico por error (por el asunto, por el
> remitente o por cualquier otra causa), le informamos que cualquier revisión,
> alteración, impresión, copia o transmisión de este mensaje o de cualquier
> fichero adjunto está prohibida y puede constituir un acto ilegal. Por favor,
> notifíquele el error al remitente respondiendo a este e-mail y elimine el
> mensaje y su contenido inmediatamente.
> >
> > This e-mail and any files transmitted with it are intended solely for the
> use of the intended recipients and may contain confidential information. If
> it appears (from the subject matter or address information or otherwise)
> that you received this email in error, please note that any review,
> dissemination, disclosure, alteration, printing, copying or transmission of
> this e-mail or any file transmitted with it is prohibited and may be
> unlawful. Please notify us by return email and delete this email and its
> contents immediately.
> >
> >
> >
> >
> >
> >
> > ------------ próxima parte ------------
> > Se ha borrado un adjunto en formato HTML...
> > URL: <
> http://listas.combios.es/cgi-bin/mailman/private/forum.help400/attachments/20110421/83bb5b1a/attachment-0001.htm
> >
> >
> > ------------------------------
> >
> > Message: 5
> > Date: Thu, 21 Apr 2011 14:47:25 +0000
> > From: Pedro Molina <[email protected]>
>
> > Subject: RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > To: <[email protected]>
> > Message-ID: <[email protected]>
> > Content-Type: text/plain; charset="utf-8"
>
> >
> >
> > Sergio.
> >
> > Creo que cuando Javier se refiere a un miembro, asumo que es a un miembro
> fuente...es así Javier?
> >
> > Salu2!!
> >
> > From: [email protected]
> > To: [email protected]
> > Subject: RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > Date: Thu, 21 Apr 2011 11:33:35 -0300
> >
> >
> >
> >
> >
> >
> >
> >
> > Lo que debes hacer es un OVRDBF antes de ejecutar el SQL indicando a que
> miembro vas a apuntar dentro del archivo.
> >
> >
> >
> > Saludos.
> >
> >
> >
> > Sergio
> >
> >
> >
> >
> >
> >
> > From: [email protected]
> > To: [email protected]
> > Subject: RE: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > Date: Thu, 21 Apr 2011 13:49:35 +0000
> >
> >
> >
> >
> > Javier.
> >
> > Yo lo he hecho con miembro tipo TXT y me ha funcionado perfectamente,
> sobre todo que los he usado para crear procedimientos almacenados con un
> script de SQL, pero también he puesto sentencias puras SQL y también me
> funciona.
> >
> > No se como habrás hecho si pudieras poner el ejemplo que no te funciona,
> talvez pudieramos hacer algo.
> >
> > Salu2!!
> >
> >
> >
> > From: [email protected]
> > To: [email protected]
> > Subject: EJECUTAR SENTENCIAS SQL QUE ESTAN DENTRO DE UN MIEMBRO
> > Date: Thu, 21 Apr 2011 15:35:23 +0200
> >
> >
> >
> > Buenas tardes :
> >
> > Quiero ejecutar sentencias SQL que estén dentro de un miembro con vistas
> a hacerlo dentro de un CL.
> > Es posible? cómo se hace?
> > He visto el mandato, he creado una sentencia SQL dentro de un miembro y
> lo he ejecutado con RUNSQLSTM, pero no ha funcionado.
> >
> > Un saludo y gracias.
> > Javier.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Este mensaje y cualquier fichero adjunto esta dirigido únicamente a sus
> destinatarios y pueden contener información confidencial. Si usted considera
> que ha recibido este correo electrónico por error (por el asunto, por el
> remitente o por cualquier otra causa), le informamos que cualquier revisión,
> alteración, impresión, copia o transmisión de este mensaje o de cualquier
> fichero adjunto está prohibida y puede constituir un acto ilegal. Por favor,
> notifíquele el error al remitente respondiendo a este e-mail y elimine el
> mensaje y su contenido inmediatamente.
> >
> > This e-mail and any files transmitted with it are intended solely for the
> use of the intended recipients and may contain confidential information. If
> it appears (from the subject matter or address information or otherwise)
> that you received this email in error, please note that any review,
> dissemination, disclosure, alteration, printing, copying or transmission of
> this e-mail or any file transmitted with it is prohibited and may be
> unlawful. Please notify us by return email and delete this email and its
> contents immediately.
> >
> >
> >
> >
> >
> >
> > ____________________________________________________ ?nete a Recursos
> AS400, nuestra Comunidad ( http://bit.ly/db68dd ) Forum.Help400 ?
> Publicaciones Help400, S.L.
> > ____________________________________________________ ?nete a Recursos
> AS400, nuestra Comunidad ( http://bit.ly/db68dd ) Forum.Help400 ?
> Publicaciones Help400, S.L.
> >
> > ____________________________________________________
> > ?nete a Recursos AS400, nuestra Comunidad ( http://bit.ly/db68dd )
> > Forum.Help400 ? Publicaciones Help400, S.L.
> > ------------ próxima parte ------------
> > Se ha borrado un adjunto en formato HTML...
> > URL: <
> http://listas.combios.es/cgi-bin/mailman/private/forum.help400/attachments/20110421/bf4fbfa5/attachment.htm
> >
> >
> > ------------------------------
> >
> > __________________________________________________
> > Forum.HELP400 es un servicio m&amp;amp;#225;s de ServerNEWS.
> > &amp;amp;#169; Publicaciones Help400, S.L. - Todos los derechos
> reservados
> > http://www.help400.es
> > _____________________________________________________
> >
> > Para darte de baja visita la siguente URL:
> > http://listas.combios.es/mailman/listinfo/forum.help400
> >
> > Fin de Resumen de Forum.help400, Vol 54, Envío 28
> > *************************************************
>
>
> ____________________________________________________
> Únete a Recursos AS400, nuestra Comunidad ( http://bit.ly/db68dd )
> Forum.Help400 © Publicaciones Help400, S.L.
>
____________________________________________________
Únete a Recursos AS400, nuestra Comunidad ( http://bit.ly/db68dd )
Forum.Help400 © Publicaciones Help400, S.L.

Responder a