New query, new Questions.
Ok lets start with what I have. I have one table called progmode1, I have one view called djt_mt_info_to_prodtrack.
In each of these I have a column called ‘jobtask’.
In each of these I have a column called ‘numberup’
I know that FSQL runs on an actual table but can it be ran on a view? (we will come back to this later)
What I am trying to do is take the numberup column from the djt view and copy it over to the progmode1 table where the jobtask number is equal from both tables, and in the event it runs into a jobtask that is not in the database or is not properly set, instead of setting the value in numberup to zero or null it will default to a 1 (one).
I currently have a view that is doing this quite nicely, however every time I point the block group at the view instead of the table it blows up with an error message about the index not being in place. Which is why I asked the question earlier about can FSQL run on a view.
The reason I want this running in the background and running at all times is because the jobtask number can be changed from a variety of locations. One is thru a screen on FPMI, one is at the machine level, etc… So as the jobtask changes in the progmode1 table I want this numberup value to equal the numberup value in the djt view.
I would prefer to do this with something in SQL either stored procedure or something that will continually without human intervention monitor these tables and do what it needs to do.
Here is the query that I have written to create the view in question:
[code]SELECT dbo.progmode1.mach_num, dbo.progmode1.online, dbo.progmode1.JobTask , dbo.progmode1.shift, dbo.progmode1.assigned_operator,
dbo.progmode1.assigned_assist1, dbo.progmode1.assigned_assist2, dbo.progmode1.assigned_assist3, dbo.progmode1.assigned_floater,
dbo.progmode1.assigned_spec_op, dbo.progmode1.assigned_spec_a1, dbo.progmode1.batch_preset, dbo.progmode1.batch_select,
dbo.progmode1.logout, dbo.progmode1.t_stamp, dbo.progmode1.active, dbo.progmode1.fltmsg, dbo.progmode1.mach_sel, dbo.progmode1.cf_start,
ISNULL(dbo.djt_mt_info_to_prodtrack.NumberUP, N’1’) AS numberup
FROM dbo.progmode1 LEFT OUTER JOIN
dbo.djt_mt_info_to_prodtrack ON dbo.progmode1.JobTask = dbo.djt_mt_info_to_prodtrack.JobTask
Like I said all I want to do is be able to attach this numberup so I can send it with the jobtask number to each production floor box and in the event that the jobtask is flawed in someway make sure the numberup has a value of 1. If you have not guessed the number up is actually a multiplier type of number. Some of the jobs we do you perform one function but get two forms so that is called a two up job so for each cut it would count in steps of 2.
Hope this is clear.
Thanks and have a great day and a wonderful holiday.