PSLine2000Documentation/Queries/TEMPORARY.md

3.4 KiB

TEMPORARY

Analysis generated on: 4/2/2025 10:12:42 AM

SQL Statement

SELECT DISTINCTROW junk.Programmer
FROM PressBrakeOPs, PunchPress, ((DataSheet INNER JOIN ((Process INNER JOIN ((((junk INNER JOIN (AddnlProc INNER JOIN Labor ON AddnlProc.WC2 = Labor.WC2) ON junk.WC2 = Labor.WC2) INNER JOIN MachineNames ON Labor.WC2 = MachineNames.WC2) INNER JOIN Machines ON MachineNames.MachineName = Machines.MachineName) INNER JOIN PressBrakes ON Labor.WC2 = PressBrakes.WC2) ON Process.PartNumber = AddnlProc.PartNumber) INNER JOIN Metals ON Process.MetalType = Metals.PartNo) ON DataSheet.PartNumber = Process.PartNumber) INNER JOIN ProcessMachines ON Process.PartNumber = ProcessMachines.PartNumber) INNER JOIN WorkCenter ON Labor.WC2 = WorkCenter.WC2
WHERE ((junk.Programmer="TEMP"));

Dependencies

Parameters

  • Error analyzing parameters: For loop not initialized

What it does

SQL Query Description

This SQL query retrieves a list of distinct programmers from the PressBrakeOPs table that are associated with certain manufacturing operations.

Table Joins and Relationships

The query performs several joins to combine data from various tables, including:

  1. PressBrakeOPs: The main table containing information about press brake operators.
  2. PunchPress: Not used in this query, but likely a reference to punch presses used in conjunction with the press brakes.
  3. DataSheet: Contains information about raw materials or products being processed.
  4. Process: Represents manufacturing processes, including part numbers and metal types.
  5. AddnlProc: Additional processing steps that may be required for certain parts.
  6. Labor: Information about labor associated with each process, including work centers (WC2).
  7. MachineNames: Maps machine names to their corresponding WC2 values.
  8. Machines: The actual machines used in the manufacturing process.
  9. PressBrakes: Press brake equipment information.
  10. Metals: Metal type information.

The query joins these tables based on various relationships, including:

  • Part numbers
  • WC2 (work center) values
  • Machine names

Query Logic

The query filters the results to only include rows where junk.Programmer = "TEMP", indicating that a temporary programmer is being used. The DISTINCTROW clause ensures that each programmer is only returned once, even if they are associated with multiple manufacturing operations.

Subqueries and Conditions

The query includes several subqueries and conditions to filter the data:

  • INNER JOIN clauses combine tables based on matching relationships.
  • ON clauses specify the join conditions.
  • The final condition filters results to only include rows where junk.Programmer = "TEMP".

Example Output

The query will return a list of distinct programmers associated with manufacturing operations, filtered by the presence of a temporary programmer. The output might look something like this:

junk.Programmer
TEMP

Note that the actual output may vary depending on the data in the input tables and the specific join relationships.