I am making user queries based on a table, so my application can reply with the correct…
- User
I am making user queries based on a table, so my application can reply with the correct T-SQL query, for example for this table:
table = "['ID: a4c67e46-6cc4-4bdd-bb23-1f44cf7fa682\nTable Name: cn_baja_adh\nIndices: False\nTexto: | id | colid | type | DESCRIPCION | TIPO_RELACION | CAMPO |\n| --- | --- | --- | --- | --- | --- |\n| 909454514 | 1 | ba_id_emp | 39 | EMPRESA | T |\n| 909454514 | 2 | ba_prestacion | 39 | PRESTACION | NULL |\n| 909454514 | 3 | ba_clave_adh | 39 | CLAVE | ADH |\n...\n\n']"
user_query = "delete sobre cob_sueldos..cn_baja_adh para EMPRESA = 10 y prestacion = 2"
gave this reply:
use cob_sueldos go declare @w_k_registros int, @w_n_error int, @w_d_error varchar(54) select @w_n_error = 0 print 'REGISTROS A ELIMINAR' delete cob_sueldos..cn_baja_adh from cob_sueldos..cn_baja_adh where ba_id_emp = 10 and ba_prestacion = 2 select @w_k_registros = @@rowcount , @w_n_error = @@error if @w_n_error <> 0 begin select @w_n_error = 107540 select @w_d_error = 'ERROR AL BORRAR TABLA CN_BAJA_ADH' goto FIN end if @w_k_registros = 0 begin select @w_n_error = 900131 select @w_d_error = 'ERROR NO EXISTE REGISTRO TABLA CN_BAJA_ADH' goto FIN end FIN: select @w_n_error select @w_d_error select 'CANTIDAD REGISTROS ELIMINADOS' select @w_k_registros goNow I need more examples to test this, give me a good set of different simpler and complex delete user queries based on this table, in spanish.
- Assistant
Here are a variety of user queries that you can use to test your application. These queries range from simple to more complex conditions based on the provided table structure:
-
Simple condition:
- "Eliminar registros de la tabla cn_baja_adh donde EMPRESA es igual a 5"
-
Multiple conditions:
- "Borrar todos los registros de cn_baja_adh para EMPRESA = 3 y CLAVE = 'ABC'"
-
Null value condition:
- "Eliminar registros donde la PRESTACION sea nulo en la tabla cn_baja_adh"
-
Numero y texto:
- "Eliminar de cn_baja_adh donde EMPRESA es igual a 8 y TIPO_RELACION es 'PRESTACION'"
-
Combination with OR condition:
-