update sql control question
Posted on 2001-06-03
Ok, I'm using MIDAS and need to do a multiple table update, so I decided to use a query and then update the query. However, I recently learned that because of SQL-92 these type of queries are read only, so I was lost. However, I've now found that the UPDATESQL control I've never in my life used comes to solve my problem. Unfortunately, I don't know how to access it's MODIFYSQL, INSERTSQL AND DELETESQL properties from the client application. I don't even know exactly how to use it. Note: the delphi help was very unclear here.
So, this is the SQL I want to execute, how do this?
SQL := ' UPDATE ' + NombreBase + ' SET CuotasPagadas = CuotasPagadas + 1, CodigoRech = ''' + MyError + '''' + ' , FechaDebito = ''' + Fecha + ''', Marca = ''P''' + ' WHERE C.IdAfiliado = ''' + IdAfiliado + ''' AND C.CuotasPagadas < C.CantCuotas';
I would also like to know if I need to link this UPDATESQL control with the actual TTable or with the TQuery.