Forum Home › Forums › Uncategorized Issues › ModDBExport
Tagged: DBEXPORT
- This topic has 36 replies, 3 voices, and was last updated 6 years, 9 months ago by
Mikhail.
-
AuthorPosts
-
February 20, 2019 at 2:18 pm #5038
MikhailModeratorbut how to doit?
See T-SQL manual. Also we can develop scripts for you for a fee.
February 20, 2019 at 4:17 pm #5041aluy069
Participanti performed in SQL 2017
——————-
SELECT [DateTime],
case when cnlnum = 22 then val else 0 end as Modelo,
case when cnlnum = 26 then val else 0 end as Q,
case when cnlnum = 29 then val else 0 end as Efici,
case when cnlnum = 30 then val else 0 end as Disp,
case when cnlnum = 32 then val else 0 end as Turno,
case when cnlnum = 58 then val else 0 end as OEE,
case when cnlnum = 65 then val else 0 end as Run,
StatFROM CnlData
where CnlNum in (22,29, 30, 26,58,32,65) AND stat = ‘1’
—————–
it almost do what i need from SQL server but, i just need to send those CnlNum (22,29, 30, 26,58,32,65) to the SQL2017 instead all values cor CnlNum.I need to do something in the SCADA server like this:
———-
— Insert current data CnlDataLS
INSERT INTO CnlDataLSt (DateTime, CnlNum, Modelo, Calidad, Eficiencia, Disp, Turno, OEE, Run, Stat)
VALUES (@dateTime, @cnlNum, @Val(22), @Val(29), @Val(30), @Val(26), @Val(58), @Val(32), @Val(65), @stat)
——–my question in what should be the arguments for “INSERT INTO CnlDataLSt” and “VALUES”
May I explain myself?
February 21, 2019 at 12:34 pm #5051
MikhailModeratorAn INSERT statement executes for each channel separately.
That’s why the default expression is simpleINSERT INTO CnlData (DateTime, CnlNum, Val, Stat) VALUES (@dateTime, @cnlNum, @val, @stat)You have to change it to executing a stored procedure. Example for Postgres
SELECT my_schema.proc_cur_data(@cnlNum, @val, @stat);And then perform filtering in the stored procedure my_schema.proc_cur_data.
February 26, 2019 at 11:28 pm #5076aluy069
ParticipantSorry but i dont know what you mean with “Example for Postgres”
February 27, 2019 at 5:11 pm #5083
MikhailModeratorI mean that the SQL syntax of my example is for Postgres.
February 28, 2019 at 10:15 pm #5092aluy069
ParticipantMikhail
Give me a quote to do the programation necesarely to:
Send the data to SQL 2017 sever using db export to construct a table with the cnlnum I choose in the same line, also I beed timestamp and status
The table headers in sql should look like:
id | time | quality | oee | model | disp | stat
I need when the dbexport send the data to sql send all colloms of the row at the same time
tanksMarch 1, 2019 at 2:59 pm #5098
MikhailModeratorPlease write the request to info@…org and I will prepare a quote.
-
AuthorPosts
- You must be logged in to reply to this topic.