<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-26801181.post1916387523400812370..comments</id><updated>2011-12-01T13:37:56.088+01:00</updated><category term='Tutorial PL/SQL'/><category term='Optimización y tuning de bases de datos'/><category term='Librerías estándar PLSQL'/><category term='Utilidades PLSQL'/><category term='Bases de datos Oracle'/><title type='text'>Comments on Programación PL/SQL y bases de datos Oracle: Ejecución de cursores PLSQL y sentencias DML utili...</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.plsql.biz/feeds/1916387523400812370/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html'/><author><name>José Luis Pérez</name><uri>https://profiles.google.com/102634062599347146150</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh5.googleusercontent.com/-4QS7hkQaOzk/AAAAAAAAAAI/AAAAAAAAGhg/FWpeXVJY9cg/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-26801181.post-890316212267156544</id><published>2011-09-28T18:53:35.475+02:00</published><updated>2011-09-28T18:53:35.475+02:00</updated><title type='text'>Hola Pepelu, estoy intentando usar sql dinamico pa...</title><content type='html'>Hola Pepelu, estoy intentando usar sql dinamico para crear un bloque anonimo y ejecutarlo dinámicamente. El problema que tengo es que no se si esto realmente funciona. Uso un bloque anonimo, en lugar de un procedimiento almacenado porque no quiero crear la paqueteria en la BBDD. Además necesito crear un tipo de dato rowtype pasando el nombre de la tabla como parámetro.&lt;br /&gt;Quizás puedas orientarme en como hacerlo ya que soy nuevo en el uso de pl/sql dinámico. Gracias de antemano, explendido blog.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/890316212267156544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/890316212267156544'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1317228815475#c890316212267156544' title=''/><author><name>Cristobal</name><uri>http://www.blogger.com/profile/08753044879409750367</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1618961570'/></entry><entry><id>tag:blogger.com,1999:blog-26801181.post-8808472154971300932</id><published>2010-11-23T19:12:05.957+01:00</published><updated>2010-11-23T19:12:05.957+01:00</updated><title type='text'>Una buena observación JG. Ciertamente si Juan esta...</title><content type='html'>Una buena observación JG. Ciertamente si Juan estaba intentando hacer lo que mencionas, sun función PL/SQL no funcionaría y una solución es la que tu propones.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/8808472154971300932'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/8808472154971300932'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1290535925957#c8808472154971300932' title=''/><author><name>Pepelu</name><uri>http://www.blogger.com/profile/00891045835734721638</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='18072941500668390493'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp2.blogger.com/_ObxKtfPuuSQ/RZbWU_RnoqI/AAAAAAAAAFA/MVY1NBWkkFM/s200/compuntoes-caballo.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1588385999'/></entry><entry><id>tag:blogger.com,1999:blog-26801181.post-4891335738638097803</id><published>2010-11-23T16:31:55.710+01:00</published><updated>2010-11-23T16:31:55.710+01:00</updated><title type='text'>Hola, soy nueva por aca pero leyendo queria coment...</title><content type='html'>Hola, soy nueva por aca pero leyendo queria comentarle a Juan que su codigo no funciona porque al parecer esta intentando pasar en la variable p_empleados una cadena con valores separados por comas para que funcione la condicion IN y esto asi no funciona, debe construir la query dinamicamente concatenandole la cadena:&lt;br /&gt;open p_cursor for &amp;#39;SELECT COUNT(1)FROM empleados&lt;br /&gt;WHERE emple_id IN (&amp;#39;||p_id_empleados||&amp;#39;)&amp;#39;;&lt;br /&gt;fetch p_cursor in p_cantidad;&lt;br /&gt;close p_cursor;&lt;br /&gt;Espero haber sido de ayuda,&lt;br /&gt;&lt;br /&gt;saludos&lt;br /&gt;JG</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/4891335738638097803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/4891335738638097803'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1290526315710#c4891335738638097803' title=''/><author><name>Adrián Gil "El Tigre"</name><uri>http://www.blogger.com/profile/12433559285423291447</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-162725840'/></entry><entry><id>tag:blogger.com,1999:blog-26801181.post-3904726282219525497</id><published>2010-10-05T20:50:28.265+02:00</published><updated>2010-10-05T20:50:28.265+02:00</updated><title type='text'>Muchas Gracias Amigo! Si esos &amp;quot;punto y coma&amp;q...</title><content type='html'>Muchas Gracias Amigo! Si esos &amp;quot;punto y coma&amp;quot;(;) eran los que estaban fastidiando. Ok, ya le quite el TO_CHAR al ERROR_MESSAGE y anda bien. Gracias de nuevo. Seguiré por acá preguntandote cosas de Oracle PL/SQL, hasta luego. Full éxito.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/3904726282219525497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/3904726282219525497'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1286304628265#c3904726282219525497' title=''/><author><name>José Gabriel González</name><uri>http://www.blogger.com/profile/07275134482262416803</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_Wan56wJ8i5w/TAMgHZ1VLRI/AAAAAAAAAAM/QI5vf3HIG-I/S220/n1088596731_30059586_5314.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-58419053'/></entry><entry><id>tag:blogger.com,1999:blog-26801181.post-4777672771200812554</id><published>2010-10-05T12:48:12.165+02:00</published><updated>2010-10-05T12:48:12.165+02:00</updated><title type='text'>Hola José Gabriel,

El problema es que no debes po...</title><content type='html'>Hola José Gabriel,&lt;br /&gt;&lt;br /&gt;El problema es que no debes poner punto y coma (;) al final de la query SQL, si lo haces vas a recibir el error &amp;quot;ORA-03113 - end-of-file on communication channel&amp;quot;. Es decir, no debes añadir al final de la variable v_sql_query un punto y coma.&lt;br /&gt;&lt;br /&gt;También puede generar problemas el hecho de que utilices TO_CHAR(ERROR_MESSAGE) ya que ERROR_MESSAGE ya es un VARCHAR.&lt;br /&gt;&lt;br /&gt;Espero haber resuelto tus dudas.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/4777672771200812554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/4777672771200812554'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1286275692165#c4777672771200812554' title=''/><author><name>Pepelu</name><uri>http://www.blogger.com/profile/00891045835734721638</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='18072941500668390493'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp2.blogger.com/_ObxKtfPuuSQ/RZbWU_RnoqI/AAAAAAAAAFA/MVY1NBWkkFM/s200/compuntoes-caballo.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1588385999'/></entry><entry><id>tag:blogger.com,1999:blog-26801181.post-5419859842516149079</id><published>2010-10-05T00:15:14.330+02:00</published><updated>2010-10-05T00:15:14.330+02:00</updated><title type='text'>Hola Pepelu! Muy buenos tus post. De verdad muchas...</title><content type='html'>Hola Pepelu! Muy buenos tus post. De verdad muchas felicitaciones. Tengo una pregunta. Este codigo tiene un punto de ruptura y no lo veo.&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE FUNCTION GET_EMPLOYEES_BY_SALARY_VAR (SALARY_LESS IN NUMBER) RETURN NUMBER AS &lt;br /&gt;         &lt;br /&gt;    type T_PO_CURSOR is ref cursor;&lt;br /&gt;    PO_CURSOR T_PO_CURSOR;&lt;br /&gt;    V_SQL_QUERY varchar2(500);&lt;br /&gt;    &lt;br /&gt;    REGISTRO EMPLOYEES%ROWTYPE;&lt;br /&gt;    ERROR_MESSAGE VARCHAR(50);&lt;br /&gt;    SIN_REGISTROS EXCEPTION;&lt;br /&gt;    &lt;br /&gt;  begin&lt;br /&gt;    v_sql_query := &amp;#39;SELECT * FROM EMPLOYEES A WHERE 1=1&amp;#39;;&lt;br /&gt;      &lt;br /&gt;    if (SALARY_LESS is not null) then&lt;br /&gt;      v_sql_query := v_sql_query || &amp;#39; AND SALARY &amp;lt;= &amp;#39; || SALARY_LESS || &amp;#39;;&amp;#39;;&lt;br /&gt;    else&lt;br /&gt;      v_sql_query := v_sql_query || &amp;#39; AND SALARY &amp;lt;= 0;&amp;#39;;&lt;br /&gt;    END IF;&lt;br /&gt;    &lt;br /&gt;    OPEN PO_CURSOR FOR v_sql_query;&lt;br /&gt;      &lt;br /&gt;    FETCH PO_CURSOR INTO REGISTRO;&lt;br /&gt;    &lt;br /&gt;      IF PO_CURSOR%NOTFOUND THEN&lt;br /&gt;        RAISE SIN_REGISTROS;&lt;br /&gt;      END IF;&lt;br /&gt;      &lt;br /&gt;      WHILE PO_CURSOR%FOUND LOOP&lt;br /&gt;        FETCH PO_CURSOR into REGISTRO;&lt;br /&gt;        DBMS_OUTPUT.PUT_LINE(REGISTRO.EMPLOYEE_ID || &amp;#39;.- &amp;#39; || REGISTRO.FIRST_NAME || &amp;#39; &amp;#39; || REGISTRO.LAST_NAME);&lt;br /&gt;      END LOOP;&lt;br /&gt;      &lt;br /&gt;    CLOSE PO_CURSOR;&lt;br /&gt;    &lt;br /&gt;    RETURN 1;&lt;br /&gt;    &lt;br /&gt;  EXCEPTION&lt;br /&gt;    &lt;br /&gt;    WHEN SIN_REGISTROS THEN&lt;br /&gt;      DBMS_OUTPUT.PUT_LINE(&amp;#39;No existen empleados que estén cobrando actualmente un sueldo menor a este&amp;#39;);&lt;br /&gt;      RETURN 0;&lt;br /&gt;    &lt;br /&gt;    WHEN OTHERS THEN&lt;br /&gt;      ERROR_MESSAGE := SQLERRM;&lt;br /&gt;      RAISE_APPLICATION_ERROR(SQLCODE,TO_CHAR(ERROR_MESSAGE));&lt;br /&gt;    &lt;br /&gt;END GET_EMPLOYEES_BY_SALARY_VAR;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/5419859842516149079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/5419859842516149079'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1286230514330#c5419859842516149079' title=''/><author><name>José Gabriel González</name><uri>http://www.blogger.com/profile/07275134482262416803</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_Wan56wJ8i5w/TAMgHZ1VLRI/AAAAAAAAAAM/QI5vf3HIG-I/S220/n1088596731_30059586_5314.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-58419053'/></entry><entry><id>tag:blogger.com,1999:blog-26801181.post-6492348442496060527</id><published>2010-09-29T10:50:11.438+02:00</published><updated>2010-09-29T10:50:11.438+02:00</updated><title type='text'>Hola Juan, yo no veo ningún problema en el procedi...</title><content type='html'>Hola Juan, yo no veo ningún problema en el procedimiento que has definido. Es totalmente correcto. ¿Por qué dices que no funciona?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/6492348442496060527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/6492348442496060527'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1285750211438#c6492348442496060527' title=''/><author><name>Pepelu</name><uri>http://www.blogger.com/profile/00891045835734721638</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='18072941500668390493'/><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://bp2.blogger.com/_ObxKtfPuuSQ/RZbWU_RnoqI/AAAAAAAAAFA/MVY1NBWkkFM/s200/compuntoes-caballo.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1588385999'/></entry><entry><id>tag:blogger.com,1999:blog-26801181.post-5742558406858638463</id><published>2010-09-29T01:02:17.141+02:00</published><updated>2010-09-29T01:02:17.141+02:00</updated><title type='text'>Hola,
hace un tiempo que quiero hacerte esta pregu...</title><content type='html'>Hola,&lt;br /&gt;hace un tiempo que quiero hacerte esta pregunta pero no encuentro como andarte un MSN directamente&lt;br /&gt;&lt;br /&gt;La cosa es asi. dentro de un Paquete tengo un Store el que tiene dos paramentros. El de entrada es usado en el Query con la &amp;quot;funcion IN&amp;quot;. &lt;br /&gt;Pero no funciona, se te acurre alguna solicion.&lt;br /&gt;&lt;br /&gt;Aca abajo dejo un ejemplo (es solo el ejemplo)&lt;br /&gt;PROCEDURE calculo_empleados(p_id_empleados IN     VARCHAR2&lt;br /&gt;                           ,p_cantida         OUT NUMBER)&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;--&lt;br /&gt;  SELECT COUNT(1)&lt;br /&gt;    INTO p_cantida&lt;br /&gt;    FROM empleados&lt;br /&gt;   WHERE emple_id IN (p_id_empleados);&lt;br /&gt;--&lt;br /&gt;END calculo_empleados;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/5742558406858638463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/26801181/1916387523400812370/comments/default/5742558406858638463'/><link rel='alternate' type='text/html' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html?showComment=1285714937141#c5742558406858638463' title=''/><author><name>Juan</name><uri>http://www.blogger.com/profile/17021829160510205739</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://2.bp.blogspot.com/_i3DxzapjkdU/SLhaFebm4DI/AAAAAAAAACE/ojsoDZz2XVI/S220/SinRostro.bmp'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.plsql.biz/2010/09/sql-dinamico-nativo-cursor-dml-update.html' ref='tag:blogger.com,1999:blog-26801181.post-1916387523400812370' source='http://www.blogger.com/feeds/26801181/posts/default/1916387523400812370' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1685062151'/></entry></feed>
