Copyright 2007– WinWare, Inc. Session: How to Utilize the Open Database Architecture of CribMaster Presenter: Phil Stenger.

Slides:



Advertisements
Similar presentations
IT203 Unit 9: Database Security II Is It Secure? Copyright © 2012 Pearson Education, Inc. Publishing as Prentice HallChapter8.1.
Advertisements

Access 2007 ® Use Databases How can Microsoft Access 2007 help you structure your database?
ICIS-NPDES Plugin Design Preview Webinar ICIS-NPDES Full Batch OpenNode2 Plugin Project Presented by Bill Rensmith Windsor Solutions, Inc. 3/15/2012.
CC SQL Utilities.
AppManager 7: Deep Technical Dive Tim Sedlack & Michi Schniebel Sr. Product Managers.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Fundamentals, Design, and Implementation, 9/e Chapter 7 Using SQL in Applications.
Copyright ©2014 Pearson Education, Inc. Chapter 3 Requirements and Business Rules Chapter3.1.
Pro Exchange SPAM Filter An Exchange 2000 based spam filtering solution.
DB Audit Expert v1.1 for Oracle Copyright © SoftTree Technologies, Inc. This presentation is for DB Audit Expert for Oracle version 1.1 which.
ORACLE ONLINE TRAINING Contact our Support Team : SOFTNSOL India: Skype id : softnsoltrainings id:
Triggers Event handlers in the DBMS. Triggers are event handlers Triggers a executed when an event happens in the DBMS Example events – INSERT, UPDATE.
Lecture 7 Integrity & Veracity UFCE8K-15-M: Data Management.
SQL Server 7.0 Maintaining Referential Integrity.
11 Copyright س Oracle Corporation, All rights reserved. ® Overview of PL/SQL.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
Professor Michael J. Losacco CIS 1110 – Using Computers Database Management Chapter 9.
1. To start the process, Warehouse Stationery (WSL) will invite you to use The Warehouse Group Supplier Electronic Portal and will send you the link to.
Triggers A Quick Reference and Summary BIT 275. Triggers SQL code permits you to access only one table for an INSERT, UPDATE, or DELETE statement. The.
SQL SERVER.  DML Triggers  DDL Trigers  INSERT triggers  DELETE triggers  UPDATE triggers  A mix and match of any of the above.
Triggers and Stored Procedures in DB 1. Objectives Learn what triggers and stored procedures are Learn the benefits of using them Learn how DB2 implements.
Module 15 Monitoring SQL Server 2008 R2 with Alerts and Notifications.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
Data Driven Designs 99% of enterprise applications operate on database data or at least interface databases. Most common DBMS are Microsoft SQL Server,
Commercial RDBMSs Access and Oracle. Access DBMS Architchecture  Can be used as a standalone system on a single PC: -JET Engine -Microsoft Data Engine.
Database structure and space Management. Segments The level of logical database storage above an extent is called a segment. A segment is a set of extents.
37 Copyright © 2007, Oracle. All rights reserved. Module 37: Executing Workflow Processes Siebel 8.0 Essentials.
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
Fall 2001Database Systems1 Triggers Assertions –Assertions describe rules that should hold for a given database. –An assertion is checked anytime a table.
What is a Package? A package is an Oracle object, which holds other objects within it. Objects commonly held within a package are procedures, functions,
Constraints cis 407 Types of Constraints & Naming Key Constraints Unique Constraints Check Constraints Default Constraints Misc Rules and Defaults Triggers.
Objectives Database triggers and syntax
06 | Modifying Data in SQL Server Brian Alderman | MCT, CEO / Founder of MicroTechPoint Tobias Ternstrom | Microsoft SQL Server Program Manager.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
DBT544. DB2/400 Advanced Features Level Check Considerations Database Constraints File Overrides Object and Record Locks Trigger Programs.
Get Rid of Cron Scripts Using Events Sheeri Cabral Senior DB Admin/Architect,
1 Chapter Overview Defining Operators Creating Jobs Configuring Alerts Creating a Database Maintenance Plan Creating Multiserver Jobs.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
G. Green 1.  Options include:  Script Files  already covered  APIs  last course topic  Database-Stored Code  our focus 2.
Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Function, Trigger used in PosgreSQL.
Collaborative Planning Training. Agenda  Collaboration Overview  Setting up Collaborative Planning  User Setups  Collaborative Planning and Forecasting.
1 Intro stored procedures Declaring parameters Using in a sproc Intro to transactions Concurrency control & recovery States of transactions Desirable.
Commercial RDBMSs: Office Access and Oracle Pertemuan 13 Matakuliah: M0564 /Pengantar Sistem Basis Data Tahun : 2008.
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
Chapter 3 Requirements and Business Rules Copyright © 2012 Pearson Education, Inc. Publishing as Prentice HallChapter3.1.
Copyright © 2013 Curt Hill Triggers The Generation of Indirect Actions.
IMS 4212: Constraints & Triggers 1 Dr. Lawrence West, Management Dept., University of Central Florida Stored Procedures in SQL Server.
IT420: Database Management and Organization Triggers and Stored Procedures 24 February 2006 Adina Crăiniceanu
Using Workflow With Dataforms Tim Borntreger, Director of Client Services.
5 Copyright © 2008, Oracle. All rights reserved. Testing and Validating a Repository.
Module 5: Managing Content. Overview Publishing Content Executing Reports Creating Cached Instances Creating Snapshots and Report History Creating Subscriptions.
1. Advanced SQL Functions Procedural Constructs Triggers.
7.5 Using Stored-Procedure and Triggers NAME MATRIC NUM GROUP Muhammad Azwan Bin Khairul Anwar CS2305A Muhammad Faiz Bin Badrol Shah CS2305B.
 Reviewing basic architecture concepts  Oracle 10g Architecture  Main features of 9i and 10g
Welcome POS Synchronize Concept 08 Sept 2015.
Creating Database Triggers
Active Database Concepts
PT2520 Unit 9: Database Security II
Chapter 7 Using SQL in Applications
Oracle9i Developer: PL/SQL Programming Chapter 8 Database Triggers.
Chapter 7 Using SQL in Applications
Relational Database Design
Chapter 11 Managing Databases with SQL Server 2000
Triggers.
Prof. Arfaoui. COM390 Chapter 9
Purchase Document Management
Responding to Data Manipulation Via Triggers
Presentation transcript:

Copyright 2007– WinWare, Inc. Session: How to Utilize the Open Database Architecture of CribMaster Presenter: Phil Stenger

Copyright 2007– WinWare, Inc. What Can I Do At The Database Level?? Triggers and Stored Procedures Schedule SQL Server Agent Jobs Use SQL Mail To Send Dynamic s Use CribMaster SQL Rul Files

Copyright 2007– WinWare, Inc. Why Do We Need To Do This Functionality? CribMaster Currently Does Not Store Data The Way You Need to See It or Report On It. I Have Unique Processes and or Rules That CribMaster Currently Does Not Allow Through Normal Application Functionality. I Need To Update CribMaster Based on Data From Another System.

Copyright 2007– WinWare, Inc. Scheduling and Storing Data With SQL Server Jobs Issue – CribMaster Only Stores Dead Stock, Over Stocked and Crib Value Analyzer Reports Based on AltVendor.Cost But My Site Uses the CribMaster Average Price Calculation. Issue – CribMaster Rolls Up data For Analyzer Reports Weekly and Monthly But I Need Monthly Only Data Only For Some Reports. Resolution – Using SQL Server Scheduled Jobs Roll Up Additional Data In The CribStatistics Table.

Copyright 2007– WinWare, Inc. Example SQL Scripts CribStatistics Type 100 = Weekly and monthly value by price roll-up CribStatistics Type 200 = Weekly and monthly Dead Stock by price roll-up (180 days) CribStatistics Type 300 = Weekly and monthly Over Stock by price roll-up (12 Months) CribStatistics Type 201 = Weekly and monthly Dead Stock by price roll-up (90 days) CribStatistics Type 101 = Monthly only value by price roll-up CribStatistics Type 202= Monthly only Dead Stock by price roll-up (180 days) CribStatistics Type 301 = Monthly only Over Stock by price roll-up (12 Months)

Copyright 2007– WinWare, Inc. Example SQL Scripts Continued, INSERT INTO CribStatistics (StatisticsType, Crib, BinCount, StatisticsDate, StatisticsValue) SELECT 100, STATION.Crib, COUNT(*), GetDate(), SUM(STATION.Quantity * INVENTRY.Price) FROM STATION INNER JOIN INVENTRY ON STATION.Item = INVENTRY.ItemNumber GROUP BY STATION.Crib INSERT INTO CribStatistics (StatisticsType, Crib, BinCount, StatisticsDate, StatisticsValue, UDFStatisticsMonthDate) SELECT 101, STATION.Crib, COUNT(*), Null, SUM(STATION.Quantity * INVENTRY.Price), GetDate() FROM STATION INNER JOIN INVENTRY ON STATION.Item = INVENTRY.ItemNumber GROUP BY STATION.Crib _____________________________________________________

Copyright 2007– WinWare, Inc. Preventing Updates In CribMaster Using Triggers Issue – A Client wanted To prevent Users From Updating A Closed PO at the PODetail Level. I.E. Changing the Qty, Promised Or Required Dates… Resolution – We Placed a Trigger On the PODetail Table Preventing Updates To Detail When a PO Is in Closed Status.

Copyright 2007– WinWare, Inc. The Trigger and Results From CribMaster CREATE TRIGGER TRG_PODETAIL_PREVENTUPDATE ON PODETAIL FOR UPDATE AS IF EXISTS (select 1 from inserted a, PO b where a.TYPE = 0 and a.PONUMBER = b.PONUMBER and b.POSTATUSNO = 1 ) BEGIN ROLLBACK RAISERROR ('YOU CANNOT UPDATE A CLOSED PO',16,1) END

Copyright 2007– WinWare, Inc. Using A Trigger On One SQL Server Database to Update Another SQL Server Database?? Issue – Work Orders Are Created In Another Application That Uses A SQL Server Database And I want To Issue To Those Work Orders (User Defined Field) In CribMaster. Resolution – Create A Trigger On the Work Order Table Of the Other Application To Update The CribMaster User1 Table

Copyright 2007– WinWare, Inc. An Example Of a Solution Using Oracle Issue - The CribMaster Calculated Order Point and Order Qty Are Not suited To My Business Resolution – Create a Trigger That Updates the CribMaster Over Ride Order Point and Over Ride Order Qty based on my Calculations

Copyright 2007– WinWare, Inc. An Example Of a Solution Using Oracle, Con’t CREATE OR REPLACE TRIGGER TRG_STATION_CALCORDERQTYMIN BEFORE INSERT OR UPDATE ON STATION REFERENCING NEW AS NEW OLD AS OLD FOR EACH ROW DECLARE hold_UDFVENDING CRIB.UDFVENDING%TYPE; BEGIN -- See if non-vending crib. All cribs assumed non-vending unless -- explicitly flagged as vending (CRIB.UDFVENDING='YES') BEGIN SELECT NVL(UPPER(UDFVENDING), 'NO') INTO hold_UDFVENDING FROM CRIB WHERE CRIB = :NEW.CRIB; EXCEPTION WHEN NO_DATA_FOUND THEN hold_UDFVENDING := 'NO'; END; IF hold_UDFVENDING <> 'YES' THEN -- Fire for non-vending cribs only IF NVL(:NEW.MONTHLYUSAGE, 0) >= 0 THEN :NEW.OVERRIDEORDERPOINT := CEIL(NVL(:NEW.MONTHLYUSAGE, 0) * 1.5); END IF; IF NVL(:NEW.BINQUANTITY, 0) >= 0 THEN :NEW.OVERRIDEORDERQUANTITY := NVL(:NEW.MONTHLYUSAGE, 0) * 3 - NVL(:NEW.BINQUANTITY, 0); IF (:NEW.OVERRIDEORDERQUANTITY < 0) THEN :NEW.OVERRIDEORDERQUANTITY := 0; END IF; EXCEPTION WHEN OTHERS THEN -- Consider logging the error and then re-raise RAISE; END; / Don’t Try To Read This 8 pt Type. I Needed A Filler Here

Copyright 2007– WinWare, Inc. What Else Can I Do At The Database Level?? Issue – I want To make Sure the Cost Field Is Always Populated When I Create A New Item Resolution – Since CribMaster Has No Option To Enforce This Go To The Database And Set That Field To Not Allow Nulls »Note: All Items With A Supplier Must Have A Cost Before You Can Set the Field To No Nulls

Copyright 2007– WinWare, Inc. Dynamically Sending Using SQL Mail Issue – Client Wants To send an To Users or Supervisors That have Over Due Gauges Checked Out Resolution – Use A Scheduled Stored Procedure Job With SQL Mail To Auto Generate and E- mail The Notification

Copyright 2007– WinWare, Inc. Don’t I Need Exchange Server To Send SQL Mail?? The Answer Is No…..You use a POP3 Account and SMTP For SQL Mail Advantages to using POP3 and SMTP for SQL MAIL and SQL Agent Mail SMTP allows SQL Mail and SQL Agent mail to work with most firewall rules since SMTP protocols normally are not blocked. Using POP3 and SMTP for SQL Mail and SQL Agent mail also provides all the same functionality of using Exchange. Therefore this means no SQL Server mail functionality will be lost using POP3 and SMTP as a mail solution for SQL Server. Note: Web Site On How To Set Up SQL Mail Using a POP Account-

Copyright 2007– WinWare, Inc. And The Results…. This Stored Procedure Is Available Upon Request

Copyright 2007– WinWare, Inc. What Is an SQL Rul File? Staring With CribMaster 7.0 And Newer CribMaster Import Files Can Invoke SQL Scripts (Note: This Functionality Requires A Registry Update For Security reasons) Examples rulSql - will execute the specified SQL immediately in the rul file header (any rul file) rulSql Delete From User1

Copyright 2007– WinWare, Inc. What Is an SQL Rul File, Con’t? rulSqlFile - will execute the specified SQL File immediately in the rul file header (any rul file) rulSqlFile.\SqlFileName.Sql rulSqlRules will execute the specified SQL statement for each row of data - Only E type ruls will execute

Copyright 2007– WinWare, Inc. An Example Of When You Can Use The RulSQLRules? rulSqlRules <<YourFileName.csv >>PODetail START Auto,E Update PODetail set UDFSalesOrder=%s Where OriginalSeqNo=%s,MyPONumber,CMSEQ Auto,E Update PODetail set Cost=%s Where OriginalSeqNo=%s, MyNewPrice,CMSEQ Auto,E Update PODetail set PROMISEDDATE={d '%s'} Where OriginalSeqNo=%s, MYEXPECTEDDATE,CMSEQ

Copyright 2007– WinWare, Inc. What Is an SQL Rul File, Con’t? A Couple Of New Features: rulSqlAtEnd - Delete From JUNK // SQL to Execute After all data is loaded You can have multiple of these- valid for any rul file rulSqlFileAtEnd -.\SqlFileName.Sql // SQL File to Execute at the End - Only One File Allowed - The File Name

Copyright 2007– WinWare, Inc. Does WinWare Charge For These Stored Procedures And Triggers If The Trigger Is Not Complex and Can be Written By A Support Tech No Fee is Charged Stored Procedures Are Generally More Complex And Might Invoke A Programming Fee We Aren’t Always looking For The Almighty Your Success is Also a Success For WinWare…

Copyright 2007– WinWare, Inc. Open Discussion Give Me Examples Of What You Did At The Database Level And Why… Do You Have An Issue With CribMaster Functionality That We Can Discuss?