<div dir="ltr"><div><span style="font-size:12.8px">El día 22 de diciembre de 2015, 6:03, SocGer <</span><a href="mailto:socger@gmail.com" style="font-size:12.8px">socger@gmail.com</a><span style="font-size:12.8px">> escribió:</span><br style="font-size:12.8px"><span style="font-size:12.8px">> Buenas, uso los componentes TSQLQUery para hacer consultas, Insert o update.</span><br style="font-size:12.8px"><span style="font-size:12.8px">> Pero no consigo por ejemplo hacer varias cosas al mismo tiempo con estos</span><br style="font-size:12.8px"><span style="font-size:12.8px">> componentes. Por ejemplo un insert, después un update y despues una select.</span><br style="font-size:12.8px"><span style="font-size:12.8px">></span><br style="font-size:12.8px"><span style="font-size:12.8px">> En Delphi 5 conseguía hacerlo sin problemas mediante ODBC, pero deseo</span><br style="font-size:12.8px"><span style="font-size:12.8px">> hacerlo con los componentes TSQLQUery por la facilidad de cambiar de base de</span><br style="font-size:12.8px"><span style="font-size:12.8px">> datos sin modificar los componentes.</span><br style="font-size:12.8px"><span style="font-size:12.8px">></span><br style="font-size:12.8px"><span style="font-size:12.8px">> Además también necesito crear funciones o procedimientos en la base de datos</span><br style="font-size:12.8px"><span style="font-size:12.8px">> en tiempo real desde estos componentes y no consigo tampoco hacerlo.</span><br style="font-size:12.8px"><span style="font-size:12.8px">></span><br style="font-size:12.8px"><span style="font-size:12.8px">> Tiene que ser posible seguro, pero igual no lo estoy haciendo bien. ¿Puede</span><br style="font-size:12.8px"><span style="font-size:12.8px">> alguien enviarme ejemplos o un link, que me aclare como conseguir hacer las</span><br style="font-size:12.8px"><span style="font-size:12.8px">> dos cosas que no consigo?. La de hacer varias consultas dentro de una misma</span><br style="font-size:12.8px"><span style="font-size:12.8px">> estructura SQL (Insert, update y select) y la de conseguir crear sobre la</span><br style="font-size:12.8px"><span style="font-size:12.8px">> base de datos un procedimiento o una función.</span><br style="font-size:12.8px"><span style="font-size:12.8px">></span><br style="font-size:12.8px"><span style="font-size:12.8px">> Muchas gracias por vuestra labor de formación y gracias de antemano por</span><br style="font-size:12.8px"><span style="font-size:12.8px">> vuestra ayuda.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><br></div><div>*****************************************************************************************</div><div>*****************************************************************************************</div><div><br></div>Gracias a todos, pero creo que me expliqué a medias.<div><br></div><div>Lo que nos comenta Maxi, es cierto</div><div><br></div><div><span style="font-size:12.8px">> </span><span style="font-size:12.8px">Para crear algo en la base lo haces con un query pero en vez de hacer</span><br style="font-size:12.8px"><span style="font-size:12.8px">> </span><span style="font-size:12.8px">open, usas excecsql.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Y así lo hago.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Pero imaginar que tengo que hacer un Insert en una tabla y luego después un Update. Ok?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Pues si los dos los intento hacer dentro de un solo query y usando execSQL, me genera un error.</span></div><div><span style="font-size:12.8px">Sin embargo si los hago por separado ... dos query, funciona perféctamente.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Pero no me interesa hacer dos query, porque otro usuario puede entrar al mismo tiempo (entre el Insert y el Update) y modificarme algo que no debe mientras estoy haciendo estos pasos. Es decir que tengo que entrar yo primero en el motor de base de datos hacer el Insert y el Update, y luego otro usuario si quiere después de mi.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Por eso de hacerlo todo sobre una SQL y en un solo query.</span></div><div><br></div><div>Si alguien lo consiguió, me puede decir como. Por supuesto sin usar funciones sobre la Base de Datos ni procedimientos almacenados.</div><div><br></div><div>Saludos y gracias de antemano.</div><div><br></div></div>