All tables
tables · table

product2

The product2 table serves as the primary transaction log for the First Operation (Ist OPR) in the manufacturing process. It captures granular details of production runs, including the quantities of accepted, rejected, and scrapped pieces, the specific machine utilized, work shifts, and the linkage to material issue headers (mchdr or mchdrcoil).

Row count
39,035
Last entry
2026-01-16
Source
tables

Columns

30
ColumnTypeNullableMeaning
indexintegerNoPrimary Key
compcodestringNoCompany Identifier
prodnointegerNoProduction Entry Number
proddatedatetimeYesDate of Production
lotnostringYesManufacturing Lot Number
shiftstringYesWork Shift Identifier
itemcodestringYesProduced Item Code
machine_cdstringYesMachine Identifier
rmcodestringYesRaw Material Code
qtyinpicnumberYesTotal Quantity Produced (Pieces)
weightnumberYesTotal weight produced
oprcodestringYesOperation Code
downtimestringYesRecorded downtime (HH.MM)
dtreasonstringYesDowntime Reason Code
opernamestringYesOperator Name
issuenointegerYesMaterial Issue Reference
usernamestringYesDatabase User
acptqtynumberYesAccepted (Good) Quantity
rejqtynumberYesRejected (Reworkable) Quantity
scrapqtynumberYesScrapped (Non-reusable) Qty
operationcodestringYesNext Operation/Process Stage
irnointegerYesInspection Report Number
shifthrsnumberYesHours worked in the shift
sublotnostringYesDetailed Lot Identifier
rejcodestringYesRejection Reason Code
heatnostringYesMaterial Heat Number
cyclestringYesMachine Cycle Time
HoldQtynumberYesQuantity placed on hold
Hold_FlagstringYesQuality Hold Status
CurOprCodestringYesCurrent Operation Status

Full documentation

### 1. Overview
 The `product2` table serves as the primary transaction log for the **First Operation (Ist OPR)** in the manufacturing process. It captures granular details of production runs, including the quantities of accepted, rejected, and scrapped pieces, the specific machine utilized, work shifts, and the linkage to material issue headers (`mchdr` or `mchdrcoil`). 
 
 This table is critical for calculating Machine Efficiency (OEE), tracking Work-in-Progress (WIP) levels, and maintaining traceability from raw materials (`rmcode`) to intermediate manufacturing lots (`lotno`). It is frequently joined with downtime logs to reconcile actual production time versus machine availability.
 
 ### 2. Column Dictionary
 
 | Column | Type | Nullable | Meaning | Allowed Values | SQL Usage |
 | :--- | :--- | :--- | :--- | :--- | :--- |
 | **index** | integer | No | Primary Key | | Internal identifier. |
 | **compcode** | string | No | Company Identifier | e.g., "DAS", "BAM" | Filter/Join key for multi-tenant data. |
 | **prodno** | integer | No | Production Entry Number | | Unique ID for a specific production log. |
 | **proddate** | datetime | Yes | Date of Production | | Temporal analysis (Daily/Monthly production). |
 | **lotno** | string | Yes | Manufacturing Lot Number | | Traceability and WIP tracking. |
 | **shift** | string | Yes | Work Shift Identifier | e.g., "A", "B" | Efficiency analysis by shift. |
 | **itemcode** | string | Yes | Produced Item Code | e.g., "CP-128" | Joins to `itemmas`. |
 | **machine_cd** | string | Yes | Machine Identifier | e.g., "TRB5" | Joins to `machine.mccode`. |
 | **rmcode** | string | Yes | Raw Material Code | e.g., "ROD12" | Joins to `rmmas`. |
 | **qtyinpic** | number | Yes | Total Quantity Produced (Pieces) | | Aggregate for gross production. |
 | **weight** | number | Yes | Total weight produced | | Material consumption analysis. |
 | **oprcode** | string | Yes | Operation Code | | Joins to `oprmas`. |
 | **downtime** | string | Yes | Recorded downtime (HH.MM) | | Machine loss calculation. |
 | **dtreason** | string | Yes | Downtime Reason Code | | Link to `downtimemas`. |
 | **opername** | string | Yes | Operator Name | | Personnel tracking. |
 | **issueno** | integer | Yes | Material Issue Reference | | Joins to `mchdr` or `mchdrcoil`. |
 | **username** | string | Yes | Database User | | Audit trail. |
 | **acptqty** | number | Yes | Accepted (Good) Quantity | | Primary yield metric. |
 | **rejqty** | number | Yes | Rejected (Reworkable) Quantity | | Quality analysis. |
 | **scrapqty** | number | Yes | Scrapped (Non-reusable) Qty | | Loss calculation. |
 | **operationcode** | string | Yes | Next Operation/Process Stage | e.g., "DEB", "CROSS" | Workflow tracking. |
 | **irno** | integer | Yes | Inspection Report Number | | Link to Quality Control. |
 | **shifthrs** | number | Yes | Hours worked in the shift | | Productivity (Qty/Hour) calculation. |
 | **sublotno** | string | Yes | Detailed Lot Identifier | | Deep traceability. |
 | **rejcode** | string | Yes | Rejection Reason Code | | Link to `rejectionmas`. |
 | **heatno** | string | Yes | Material Heat Number | | Metallurgical traceability. |
 | **cycle** | string | Yes | Machine Cycle Time | | Target production calculation. |
 | **HoldQty** | number | Yes | Quantity placed on hold | | Inventory availability. |
 | **Hold_Flag** | string | Yes | Quality Hold Status | "Y", "N" | Filter for usable stock. |
 | **CurOprCode** | string | Yes | Current Operation Status | e.g., "BC" | Workflow state. |
 
 ### 3. Relationships & Join Map
 
 #### Authoritative Joins (via SCHEMA_MAP):
 * **Machine Metadata**: `product2.machine_cd` joins to `dbo.machine.mccode` to retrieve machine names and capacities.
 * **Item Master**: `product2.itemcode` joins to `dbo.itemmas.itemcode` for product descriptions and unit weights.
 * **Material Issuance**: `product2.issueno` joins to `dbo.mchdr.issueno` or `dbo.mchdrcoil.issueno` to link production back to the raw material batch.
 * **Downtime Details**: `product2.prodno` and `product2.compcode` join to `dbo.downtimedtl.prodno` and `dbo.downtimedtl.compcode` to analyze losses for a specific run.
 * **Operation Master**: `product2.oprcode` joins to `dbo.oprmas.oprcode` to define the specific manufacturing step.
 * **Scrap Analysis**: `product2.prodno` joins to `dbo.prodscrap.prodno` to get categorized reasons for scrap loss.
 
 #### Likely/Inferred Joins:
 * **Raw Materials**: `product2.rmcode` likely joins to `dbo.rmmas.rmcode`.
 * **WIP Adjustments**: `product2.lotno` and `product2.itemcode` join to `dbo.adjqty` to reconcile physical vs. system counts.
 * **Quality Rejections**: `product2.rejcode` likely joins to `dbo.rejectionmas.rejcode`.
 
 ---