SQL, how t write correctly a query on cicode

Hello,

I received from database manager the request to create this query to cicode to copy data between twp SQL table on the same Database. I cannot find the correct way to write it on cicode,  and other problem, Citect respond me that query is too long.. Someone can help me?

INSERT INTO [_PIZZA_PARAMETRI_RICETTE_HISTORY]

      (PPR_MAC_NUM
      ,PPR_NUMERO_ORDINE
      ,PPR_DATETIME
      ,PPR_RICETTA
      ,PPR_PARAMETRO
      ,PPR_VALORE_A
      ,PPR_VALORE_N)
SELECT
      PPR_MAC_NUM
      ,PPR_NUMERO_ORDINE
      ,PPR_DATETIME
      ,PPR_RICETTA
      ,PPR_PARAMETRO
      ,PPR_VALORE_A
      ,PPR_VALORE_N
  FROM [dbo].[_PIZZA_PARAMETRI_RICETTE]
  WHERE  PPR_MAC_NUM = 1

Thank you

Parents
  • Assuming you have SQL Server. Instead of creating large SQL statements in Cicode you could create a stored procedure. In Cicode you only need an EXEC {stored procedure name}. So you only have to trigger it at the right moment. Also better from a security point of view. The database manager should be able to help you with creating the stored procedure if you don't have experience with that.
Reply
  • Assuming you have SQL Server. Instead of creating large SQL statements in Cicode you could create a stored procedure. In Cicode you only need an EXEC {stored procedure name}. So you only have to trigger it at the right moment. Also better from a security point of view. The database manager should be able to help you with creating the stored procedure if you don't have experience with that.
Children
No Data