PL/SQL, Embedded SQL. Lecture #14 Autumn, Fall, 2001, LRX

Size: px
Start display at page:

Download "PL/SQL, Embedded SQL. Lecture #14 Autumn, Fall, 2001, LRX"

Transcription

1 PL/SQL, Embedded SQL Lecture #14 Autumn, 2001 Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 402

2 PL/SQL Found ony in the Orace SQL processor (sqpus). A compromise between competey procedura programming and SQL's very high-eve, but imited statements. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 403

3 PL/SQL (II) Aows oca variabes, oops, procedures, examination of reations one tupe at a time. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 404

4 PL/SQL (III) Rough form: DECLARE decarations BEGIN executabe statements END;. run; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 405

5 PL/SQL (IV) DECLARE portion is optiona. Dot and run are needed to end the statement and execute it. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 406

6 Simpest Form: Sequence of Modifications Likes(drinker, beer) BEGIN INSERT INTO Likes VALUES('Say', 'Bud'); DELETE FROM Likes WHERE drinker = 'Fred' END;. run; AND beer = 'Mier'; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 407

7 Procedures Stored database objects that use a PL/SQL statement in their body. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 408

8 Procedures (II) Form of decaration: CREATE OR REPLACE PROCEDURE <name>(<argist>) AS decarations BEGIN <PL/SQL statements> END;. run; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 409

9 Procedures (III) Argument ist has name-mode-type tripes.»mode: IN, OUT, or INOUT, as in ODL.»Types: standard SQL + generic types ike NUMBER = any integer or rea type. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 410

10 Procedures (IV)»Since types in procedures must match their types in the DB schema, you shoud generay use an expression of the form reation.attribute%type to capture the type correcty. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 411

11 Exampe A procedure to take a beer and price and add it to Joe's menu. Ses(bar, beer, price) Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 412

12 Exampe (II) CREATE PROCEDURE joemenu( b IN Ses.beer%TYPE, p IN Ses.price%TYPE ) AS BEGIN INSERT INTO Ses VALUES('Joe''s Bar', b, p); END;. run; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 413

13 Exampe (III) Note "run" ony stores the procedure; it doesn't execute the procedure. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 414

14 Invoking Procedures A procedure ca may appear in the body of a PL/SQL statement. Exampe: BEGIN joemenu('bud', 2.50); joemenu('moosedroo', 5.00); END;. run; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 415

15 Assignment Assign expressions to decared variabes with :=. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 416

16 Branches IF <condition> THEN <statement(s)> ELSE <statement(s)> END IF; But in nests, use ELSIF in pace of ELSE IF. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 417

17 Loops LOOP... EXIT WHEN <condition>... END LOOP; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 418

18 Cursors Decare by: CURSOR <name> IS seect-from-where statement Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 419

19 Cursors (II) Cursor gets each tupe from the reation produced by the seect-from-where, in turn, using a fetch statement in a oop.»fetch statement: FETCH <cursor name> INTO variabe ist; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 420

20 Cursors (III) Break the oop by a statement of the form: EXIT WHEN <cursor name>%notfound;»true when there are no more tupes to get. Open and cose the cursor with OPEN and CLOSE. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 421

21 Exampe A procedure that examines the menu for Joe's Bar and raises by $1.00 a prices that are ess than $3.00. Ses(bar, beer, price) Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 422

22 Exampe (II) This simpe price-change agorithm can be impemented by a singe UPDATE statement, but more compicated price changes coud not. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 423

23 Exampe (III) CREATE PROCEDURE joegouge() AS thebeer Ses.beer%TYPE; theprice Ses.price%TYPE; CURSOR c IS SELECT beer, price FROM Ses WHERE bar = 'Joe''s bar'; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 424

24 Exampe (III) BEGIN OPEN c; LOOP FETCH c INTO thebeer, theprice; EXIT WHEN c%notfound; IF theprice < 3.00 THEN UDPATE Ses SET price = theprice WHERE bar = 'Joe''s Bar' AND beer = thebeer; END IF; END LOOP; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 425

25 Exampe (IV) CLOSE c; END;. run Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 426

26 Singe-Row Seect Seect-from-where in PL/SQL must have an INTO cause isting variabes into which a tupe can be paced. It is an error if the seect-from-where returns more than one tupe; you shoud have used a cursor. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 427

27 Exampe Find the price Joe charges for Bud (and drop it on the foor). Ses(bar, beer, price) DECLARE p Ses.price%TYPE; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 428

28 Exampe (II) BEGIN SELECT price INTO p FROM Ses WHERE bar = 'Joe''s Bar' AND beer = 'Bud'; END;. run Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 429

29 SQL2 Embedded SQL Add to a conventiona programming anguage (C in our exampes) certain statements that represent SQL operations. Each embedded SQL statement introduced with EXEC SQL. Preprocessor converts C + SQL to pure C.» SQL statements become procedure cas. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 430

30 Shared Variabes A specia pace for C decarations of variabes that are accessibe to both SQL and C. Bracketed by EXEC SQL BEGIN/END DECLARE SECTION; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 431

31 Shared Variabes (II) In Orace Pro/C (not C++) the "brackets" are optiona. In C, variabes used normay; in SQL, they must be preceded by a coon. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 432

32 Exampe Find the price for a given beer at a given bar. Ses(bar, beer, price) Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 433

33 Exampe (II) EXEC SQL BEGIN DECLARE SECTION; char thebar[21], thebeer[21]; foat theprice; EXEC SQL END DECLARE SECTION;... /* assign to thebar and thebeer */... EXEC SQL SELECT price INTO :theprice FROM Ses WHERE beer = :thebeer AND bar = :thebar;... Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 434

34 Cursors Simiar to PL/SQL cursors, with some syntactic differences. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 435

35 Exampe Print Joe's menu. Ses(bar, beer, price) Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 436

36 Exampe (II) EXEC SQL BEGIN DECLARE SECTION; char thebeer[21]; foat theprice; EXEC SQL END DECLARE SECTION; EXEC SQL DECLARE c CURSOR FOR SELECT beer, price FROM Ses WHERE bar = 'Joe''s Bar'; EXEC SQL OPEN CURSOR c; whie(1) { EXEC SQL FETCH c INTO :thebeer, :theprice; if(not FOUND) break; /* format and print beer and price */ } EXEC SQL CLOSE CURSOR c; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 437

37 Orace Vs. SQL2 Features SQL2 expects FROM in fetch-statement. SQL2 defines an array of characters SQLSTATE that is set every time the system is caed.» Errors are signaed there. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 438

38 Orace Vs. SQL2 Features (II)» A faiure for a cursor to find any more tupes is signaed there.» However, Orace provides us with a header fie sqca.h that decares a communication area and defines macros to access it.» In particuar, NOT FOUND is a macro that says "the no-tupe-found signa was set." Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 439

39 Dynamic SQL Motivation:» Embedded SQL is fine for fixed appications, e.g., a program that is used by a saes cerk to book an airine seat.» It fais if you try to write a program ike sqpus, because you have compied the code for sqpus before you see the SQL statements typed in response to the SQL> prompt. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 440

40 Dynamic SQL (II)» Two specia statements of embedded SQL: PREPARE turns a character string into an SQL query. EXECUTE executes that query. Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 441

41 Exampe: Sqpus Sketch EXEC SQL BEGIN DECLARE SECTION; char query[max_query_length]; EXEC SQL END DECLARE SECTION; /* issue SQL> prompt */ /* read user's text into array query */ EXEC SQL PREPARE q FROM :query; EXEC SQL EXECUTE q; /* go back to reissue prompt */ Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 442

42 Exampe: Sqpus Sketch (II) Once prepared, a query can be executed many times. Aternativey, PREPARE and EXECUTE can be combined into: EXEC SQL EXECUTE IMMEDIATE :query; Fa, 2001, LRX #14 PL/SQL,Embedded SQL HUST,Wuhan,China 443

Outerjoins, Constraints, Triggers

Outerjoins, Constraints, Triggers Outerjoins, Constraints, Triggers Lecture #13 Autumn, 2001 Fa, 2001, LRX #13 Outerjoins, Constraints, Triggers HUST,Wuhan,China 358 Outerjoin R S = R S with danging tupes padded with nus and incuded in

More information

Assign expressions to declared variables with :=. END IF; EXIT WHEN éconditioné END LOOP;

Assign expressions to declared variables with :=. END IF; EXIT WHEN éconditioné END LOOP; Assignment Assign expressions to declared variables with :=. Branches IF éconditioné THEN éstatementèsèé ELSE éstatementèsèé END IF; But in nests, use ELSIF in place of ELSE IF. Loops LOOP... EXIT WHEN

More information

Real SQL Programming Persistent Stored Modules (PSM)

Real SQL Programming Persistent Stored Modules (PSM) Real SQL Programming Persistent Stored Modules (PSM) Ullman-Widom: Adatbázisrendszerek Alapvetés. Második, átdolgozott kiadás, Panem, 2009 9.3. Az SQL és a befogadó nyelv közötti felület (sormutatók, cursors)

More information

Schedule. Feb. 12 (T) Advising Day. No class. Reminder: Midterm is Feb. 14 (TH) Today: Feb. 7 (TH) Feb. 21 (TH) Feb. 19 (T)

Schedule. Feb. 12 (T) Advising Day. No class. Reminder: Midterm is Feb. 14 (TH) Today: Feb. 7 (TH) Feb. 21 (TH) Feb. 19 (T) Schedule Today: Feb. 7 (TH) PL/SQL, Embedded SQL, CLI, JDBC. Read Sections 8.1, 8.3-8.5. Feb. 12 (T) Advising Day. No class. Reminder: Midterm is Feb. 14 (TH) Covers material through Feb. 7 (TH) lecture

More information

Databases 1. SQL/PSM and Oracle PL/SQL

Databases 1. SQL/PSM and Oracle PL/SQL Databases 1 SQL/PSM and Oracle PL/SQL SQL DDL (Data Definition Language) Defining a Database Schema Primary Keys, Foreign Keys Local and Global Constraints Defining Views Triggers 2 SQL DML (Database Modifications)

More information

SQL3 Objects. Lecture #20 Autumn, Fall, 2001, LRX

SQL3 Objects. Lecture #20 Autumn, Fall, 2001, LRX SQL3 Objects Lecture #20 Autumn, 2001 #20 SQL3 Objects HUST,Wuhan,China 588 Objects in SQL3 OQL extends C++ with database concepts, whie SQL3 extends SQL with OO concepts. #20 SQL3 Objects HUST,Wuhan,China

More information

Likesèdrinker, beerè. Sellsèbar, beer, priceè. Frequentsèdrinker, barè

Likesèdrinker, beerè. Sellsèbar, beer, priceè. Frequentsèdrinker, barè Modication to Views Via Triggers Oracle allows us to ëintercept" a modication to a view through an instead-of trigger Example Likesèdrinker, beerè Sellsèbar, beer, priceè Frequentsèdrinker, barè CREATE

More information

Chapter 9 SQL in a server environment

Chapter 9 SQL in a server environment Chapter 9 SQL in a server environment SQL in a Programming Environment embedded SQL persistent stored modules Database-Connection Libraries Call-level interface (CLI) JDBC PHP SQL in Real Programs We have

More information

Outline. CS 235: Introduction to Databases. DB Application Programming. Interface Solutions. Basic PSM Form. Persistent Stored Modules

Outline. CS 235: Introduction to Databases. DB Application Programming. Interface Solutions. Basic PSM Form. Persistent Stored Modules Outline CS 235: Introduction to Databases Svetlozar Nestorov Database application programming SQL limitations SQL Persistent, Stored Modules (PSM) Extension of SQL PL/SQL: Oracle s version of PSM Lecture

More information

CSCD43: Database Systems Technology. Lecture 4

CSCD43: Database Systems Technology. Lecture 4 CSCD43: Database Systems Technology Lecture 4 Wael Aboulsaadat Acknowledgment: these slides are based on Prof. Garcia-Molina & Prof. Ullman slides accompanying the course s textbook. Steps in Database

More information

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL

Options. Real SQL Programming 1. Stored Procedures. Embedded SQL Real 1 Options We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional

More information

Databases and PHP. Accessing databases from PHP

Databases and PHP. Accessing databases from PHP Databases and PHP Accessing databases from PHP PHP & Databases PHP can connect to virtuay any database There are specific functions buit-into PHP to connect with some DB There is aso generic ODBC functions

More information

SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8.

SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8. SQL in Programming Languages Read chapter 5 of Atzeni et al. BD: Modelli e Linguaggi di Interrogazione and section 8.4 of Garcia-Molina Slides derived from those by Jeffrey D. Ullman SQL and Programming

More information

Relational Model. Lecture #6 Autumn, Fall, 2001, LRX

Relational Model. Lecture #6 Autumn, Fall, 2001, LRX Reationa Mode Lecture #6 Autumn, 2001 #06 Reationa Mode HUST,Wuhan,China 121 Reationa Mode Tabe = reation. Coumn headers = attributes. Row = tupe Reation schema = name(attributes). Exampe: Beers(name,

More information

Functions. 6.1 Modular Programming. 6.2 Defining and Calling Functions. Gaddis: 6.1-5,7-10,13,15-16 and 7.7

Functions. 6.1 Modular Programming. 6.2 Defining and Calling Functions. Gaddis: 6.1-5,7-10,13,15-16 and 7.7 Functions Unit 6 Gaddis: 6.1-5,7-10,13,15-16 and 7.7 CS 1428 Spring 2018 Ji Seaman 6.1 Moduar Programming Moduar programming: breaking a program up into smaer, manageabe components (modues) Function: a

More information

l Tree: set of nodes and directed edges l Parent: source node of directed edge l Child: terminal node of directed edge

l Tree: set of nodes and directed edges l Parent: source node of directed edge l Child: terminal node of directed edge Trees & Heaps Week 12 Gaddis: 20 Weiss: 21.1-3 CS 5301 Fa 2016 Ji Seaman 1 Tree: non-recursive definition Tree: set of nodes and directed edges - root: one node is distinguished as the root - Every node

More information

DATABASE DESIGN - 1DL400

DATABASE DESIGN - 1DL400 DATABASE DESIGN - 1DL400 Fall 2015 A course on modern database systems http://www.it.uu.se/research/group/udbl/kurser/dbii_ht15 Kjell Orsborn Uppsala Database Laboratory Department of Information Technology,

More information

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program?

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Why Learn to Program? Intro to Programming & C++ Unit 1 Sections 1.1-3 and 2.1-10, 2.12-13, 2.15-17 CS 1428 Spring 2018 Ji Seaman 1.1 Why Program? Computer programmabe machine designed to foow instructions Program a set of

More information

Straight-line code (or IPO: Input-Process-Output) If/else & switch. Relational Expressions. Decisions. Sections 4.1-6, , 4.

Straight-line code (or IPO: Input-Process-Output) If/else & switch. Relational Expressions. Decisions. Sections 4.1-6, , 4. If/ese & switch Unit 3 Sections 4.1-6, 4.8-12, 4.14-15 CS 1428 Spring 2018 Ji Seaman Straight-ine code (or IPO: Input-Process-Output) So far a of our programs have foowed this basic format: Input some

More information

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components Illustrated

Intro to Programming & C Why Program? 1.2 Computer Systems: Hardware and Software. Hardware Components Illustrated Intro to Programming & C++ Unit 1 Sections 1.1-3 and 2.1-10, 2.12-13, 2.15-17 CS 1428 Fa 2017 Ji Seaman 1.1 Why Program? Computer programmabe machine designed to foow instructions Program instructions

More information

Real SQL Programming 1

Real SQL Programming 1 Real SQL Programming 1 SQL in Real Programs We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database Reality is almost always

More information

More Relation Model: Functional Dependencies

More Relation Model: Functional Dependencies More Reation Mode: Functiona Dependencies Lecture #7 Autumn, 2001 Fa, 2001, LRX #07 More Reation Mode: Functiona Dependencies HUST,Wuhan,China 152 Functiona Dependencies X -> A = assertion about a reation

More information

Database Management

Database Management Database Management - 2013 Model Answers 1. a. A cyclic relationship type (also called recursive) is a relationship type between two occurrences of the same entity type. With each entity type in a cyclic

More information

understood as processors that match AST patterns of the source language and translate them into patterns in the target language.

understood as processors that match AST patterns of the source language and translate them into patterns in the target language. A Basic Compier At a fundamenta eve compiers can be understood as processors that match AST patterns of the source anguage and transate them into patterns in the target anguage. Here we wi ook at a basic

More information

Hands-free system (for cellular phone)

Hands-free system (for cellular phone) Hands-free system (for ceuar phone) With navigation system Owners of modes equipped with a navigation system shoud refer to the Navigation System Owner s Manua. Without navigation system This system supports

More information

CS54100: Database Systems

CS54100: Database Systems CS54100: Database Systems SQL DDL 27 January 2012 Prof. Chris Clifton Defining a Database Schema CREATE TABLE name (list of elements). Principal elements are attributes and their types, but key declarations

More information

Non-interactive SQL. EECS Introduction to Database Management Systems

Non-interactive SQL. EECS Introduction to Database Management Systems Non-interactive SQL EECS3421 - Introduction to Database Management Systems Using a Database Interactive SQL: Statements typed in from terminal; DBMS outputs to screen. Interactive SQL is inadequate in

More information

Chapter 9 SQL in a server environment

Chapter 9 SQL in a server environment Chapter 9 SQL in a server environment SQL in a Programming Environment embedded SQL persistent stored modules Database-Connection Libraries Call-level interface (CLI) JDBC PHP Database connection The third

More information

Arrays. Array Data Type. Array - Memory Layout. Array Terminology. Gaddis: 7.1-4,6

Arrays. Array Data Type. Array - Memory Layout. Array Terminology. Gaddis: 7.1-4,6 Arrays Unit 5 Gaddis: 7.1-4,6 CS 1428 Fa 2017 Ji Seaman Array Data Type Array: a variabe that contains mutipe vaues of the same type. Vaues are stored consecutivey in memory. An array variabe definition

More information

Welcome - CSC 301. CSC 301- Foundations of Programming Languages

Welcome - CSC 301. CSC 301- Foundations of Programming Languages Wecome - CSC 301 CSC 301- Foundations of Programming Languages Instructor: Dr. Lutz Hame Emai: hame@cs.uri.edu Office: Tyer, Rm 251 Office Hours: TBA TA: TBA Assignments Assignment #0: Downoad & Read Syabus

More information

A SIMPLE APPROACH TO SPECIFYING CONCURRENT SYSTEMS

A SIMPLE APPROACH TO SPECIFYING CONCURRENT SYSTEMS Artificia Inteigence and Language Processing ]acques Cohen Editor A SIMPLE APPROACH TO SPECIFYING CONCURRENT SYSTEMS LESLIE LAMPORT Over the past few years, I have deveoped an approach to the forma specification

More information

Chapter 13 Introduction to SQL Programming Techniques

Chapter 13 Introduction to SQL Programming Techniques Chapter 13 Introduction to SQL Programming Techniques Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Outline Database Programming: Techniques and Issues Embedded

More information

A tuple is dangling if it doesn't join with any

A tuple is dangling if it doesn't join with any Outerjoin R./ S = R./Swith dangling tuples padded with nulls and included in the result. A tuple is dangling if it doesn't join with any other tuple. R = A B 1 2 3 4 S = B C 2 5 2 6 7 8 R./ S = A B C 1

More information

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Lecture 4: Threads

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Lecture 4: Threads CSE120 Principes of Operating Systems Prof Yuanyuan (YY) Zhou Lecture 4: Threads Announcement Project 0 Due Project 1 out Homework 1 due on Thursday Submit it to Gradescope onine 2 Processes Reca that

More information

A Petrel Plugin for Surface Modeling

A Petrel Plugin for Surface Modeling A Petre Pugin for Surface Modeing R. M. Hassanpour, S. H. Derakhshan and C. V. Deutsch Structure and thickness uncertainty are important components of any uncertainty study. The exact ocations of the geoogica

More information

Lecture outline Graphics and Interaction Scan Converting Polygons and Lines. Inside or outside a polygon? Scan conversion.

Lecture outline Graphics and Interaction Scan Converting Polygons and Lines. Inside or outside a polygon? Scan conversion. Lecture outine 433-324 Graphics and Interaction Scan Converting Poygons and Lines Department of Computer Science and Software Engineering The Introduction Scan conversion Scan-ine agorithm Edge coherence

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 10 Outline Database Programming: Techniques and Issues Embedded SQL, Dynamic SQL, and SQLJ Database Programming with Function Calls: SQL/CLI and JDBC Database Stored Procedures and SQL/PSM Comparing

More information

Chapter 2 The relational Model of data. Relational model introduction

Chapter 2 The relational Model of data. Relational model introduction Chapter 2 The relational Model of data Relational model introduction 1 Contents What is a data model? Basics of the relational model Next : How to define? How to query? Constraints on relations 2 What

More information

A METHOD FOR GRIDLESS ROUTING OF PRINTED CIRCUIT BOARDS. A. C. Finch, K. J. Mackenzie, G. J. Balsdon, G. Symonds

A METHOD FOR GRIDLESS ROUTING OF PRINTED CIRCUIT BOARDS. A. C. Finch, K. J. Mackenzie, G. J. Balsdon, G. Symonds A METHOD FOR GRIDLESS ROUTING OF PRINTED CIRCUIT BOARDS A C Finch K J Mackenzie G J Basdon G Symonds Raca-Redac Ltd Newtown Tewkesbury Gos Engand ABSTRACT The introduction of fine-ine technoogies to printed

More information

An Introduction to Design Patterns

An Introduction to Design Patterns An Introduction to Design Patterns 1 Definitions A pattern is a recurring soution to a standard probem, in a context. Christopher Aexander, a professor of architecture Why woud what a prof of architecture

More information

MCSE Training Guide: Windows Architecture and Memory

MCSE Training Guide: Windows Architecture and Memory MCSE Training Guide: Windows 95 -- Ch 2 -- Architecture and Memory Page 1 of 13 MCSE Training Guide: Windows 95-2 - Architecture and Memory This chapter wi hep you prepare for the exam by covering the

More information

ITCS Implementation. Jing Yang 2010 Fall. Class 14: Introduction to SQL Programming Techniques (Ch13) Outline

ITCS Implementation. Jing Yang 2010 Fall. Class 14: Introduction to SQL Programming Techniques (Ch13) Outline ITCS 3160 Data Base Design and Implementation Jing Yang 2010 Fall Class 14: Introduction to SQL Programming Techniques (Ch13) Outline Database Programming: Techniques and Issues Three approaches: Embedded

More information

Dynamic Symbolic Execution of Distributed Concurrent Objects

Dynamic Symbolic Execution of Distributed Concurrent Objects Dynamic Symboic Execution of Distributed Concurrent Objects Andreas Griesmayer 1, Bernhard Aichernig 1,2, Einar Broch Johnsen 3, and Rudof Schatte 1,2 1 Internationa Institute for Software Technoogy, United

More information

Structures. Data Types Structures. Data Types (C/C++) Gaddis: A Data Type consists of: Unit 7. example: Integer. CS 1428 Spring 2018

Structures. Data Types Structures. Data Types (C/C++) Gaddis: A Data Type consists of: Unit 7. example: Integer. CS 1428 Spring 2018 Structures Data Types A Data Type consists of: Unit 7 Gaddis: 11.2-8 set of vaues set of operations over those vaues CS 1428 Spring 2018 Ji Seaman exampe: Integer whoe numbers, -32768 to 32767 +, -, *,

More information

Special Edition Using Microsoft Excel Selecting and Naming Cells and Ranges

Special Edition Using Microsoft Excel Selecting and Naming Cells and Ranges Specia Edition Using Microsoft Exce 2000 - Lesson 3 - Seecting and Naming Ces and.. Page 1 of 8 [Figures are not incuded in this sampe chapter] Specia Edition Using Microsoft Exce 2000-3 - Seecting and

More information

Arrays. Array Data Type. Array - Memory Layout. Array Terminology. Gaddis: 7.1-3,5

Arrays. Array Data Type. Array - Memory Layout. Array Terminology. Gaddis: 7.1-3,5 Arrays Unit 5 Gaddis: 7.1-3,5 CS 1428 Spring 2018 Ji Seaman Array Data Type Array: a variabe that contains mutipe vaues of the same type. Vaues are stored consecutivey in memory. An array variabe decaration

More information

Database Applications. SQL/PSM Embedded SQL JDBC

Database Applications. SQL/PSM Embedded SQL JDBC Database Applications SQL/PSM Embedded SQL JDBC 1 Course Objectives Design Construction Applications Usage 2 Course Objectives Interfacing When the course is through, you should Know how to connect to

More information

MCSE TestPrep SQL Server 6.5 Design & Implementation - 3- Data Definition

MCSE TestPrep SQL Server 6.5 Design & Implementation - 3- Data Definition MCSE TestPrep SQL Server 6.5 Design & Impementation - Data Definition Page 1 of 38 [Figures are not incuded in this sampe chapter] MCSE TestPrep SQL Server 6.5 Design & Impementation - 3- Data Definition

More information

Databases-1 Lecture-01. Introduction, Relational Algebra

Databases-1 Lecture-01. Introduction, Relational Algebra Databases-1 Lecture-01 Introduction, Relational Algebra Information, 2018 Spring About me: Hajas Csilla, Mathematician, PhD, Senior lecturer, Dept. of Information Systems, Eötvös Loránd University of Budapest

More information

THE PERCENTAGE OCCUPANCY HIT OR MISS TRANSFORM

THE PERCENTAGE OCCUPANCY HIT OR MISS TRANSFORM 17th European Signa Processing Conference (EUSIPCO 2009) Gasgow, Scotand, August 24-28, 2009 THE PERCENTAGE OCCUPANCY HIT OR MISS TRANSFORM P. Murray 1, S. Marsha 1, and E.Buinger 2 1 Dept. of Eectronic

More information

Database-Connection Libraries

Database-Connection Libraries Database-Connection Libraries CALL-LEVEL INTERFACE JAVA DATABASE CONNECTIVITY PHP PEAR/DB 1 An Aside: SQL Injection SQL queries are often constructed by programs. These queries may take constants from

More information

RDF Objects 1. Alex Barnell Information Infrastructure Laboratory HP Laboratories Bristol HPL November 27 th, 2002*

RDF Objects 1. Alex Barnell Information Infrastructure Laboratory HP Laboratories Bristol HPL November 27 th, 2002* RDF Objects 1 Aex Barne Information Infrastructure Laboratory HP Laboratories Bristo HPL-2002-315 November 27 th, 2002* E-mai: Andy_Seaborne@hp.hp.com RDF, semantic web, ontoogy, object-oriented datastructures

More information

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine. 1 PL/SQL INTRODUCTION SQL does not have procedural capabilities. SQL does not provide the programming techniques of condition checking, looping and branching that is required for data before permanent

More information

Introduction to SQL. Multirelation Queries Subqueries. Slides are reused by the approval of Jeffrey Ullman s

Introduction to SQL. Multirelation Queries Subqueries. Slides are reused by the approval of Jeffrey Ullman s Introduction to SQL Multirelation Queries Subqueries Slides are reused by the approval of Jeffrey Ullman s 1 Our Running Example All our SQL queries will be based on the following database schema. Underline

More information

An Optimizing Compiler

An Optimizing Compiler An Optimizing Compier The big difference between interpreters and compiers is that compiers have the abiity to think about how to transate a source program into target code in the most effective way. Usuay

More information

First lecture of this chapter is in slides (PPT file)

First lecture of this chapter is in slides (PPT file) First lecture of this chapter is in slides (PPT file) Review of referential integrity CREATE TABLE other_table ( b1 INTEGER, c1 INTEGER, PRIMARY KEY (b1, c1) ) CREATE TABLE t ( a integer PRIMARY KEY, b2

More information

Link Registry Protocol Options

Link Registry Protocol Options Link Registry Protoco Options Norman Finn, March 2017 HUAWEI TECHNOLOGIES CO., LTD. IEEE 802.1 TSN At east two obvious choices for P802.1CS Link Registration Protoco An IS-IS-ike protoco. TCP (Transmission

More information

Guardian 365 Pro App Guide. For more exciting new products please visit our website: Australia: OWNER S MANUAL

Guardian 365 Pro App Guide. For more exciting new products please visit our website: Australia:   OWNER S MANUAL Guardian 365 Pro App Guide For more exciting new products pease visit our website: Austraia: www.uniden.com.au OWNER S MANUAL Privacy Protection Notice As the device user or data controer, you might coect

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE SQL DATA DEFINITION LANGUAGE DATABASE SCHEMAS IN SQL SQL is primarily a query language, for getting information from a database. DML: Data Manipulation Language SFWR ENG 3DB3 FALL 2016 MICHAEL LIUT (LIUTM@MCMASTER.CA)

More information

As Michi Henning and Steve Vinoski showed 1, calling a remote

As Michi Henning and Steve Vinoski showed 1, calling a remote Reducing CORBA Ca Latency by Caching and Prefetching Bernd Brügge and Christoph Vismeier Technische Universität München Method ca atency is a major probem in approaches based on object-oriented middeware

More information

Proceedings of the International Conference on Systolic Arrays, San Diego, California, U.S.A., May 25-27, 1988 AN EFFICIENT ASYNCHRONOUS MULTIPLIER!

Proceedings of the International Conference on Systolic Arrays, San Diego, California, U.S.A., May 25-27, 1988 AN EFFICIENT ASYNCHRONOUS MULTIPLIER! [1,2] have, in theory, revoutionized cryptography. Unfortunatey, athough offer many advantages over conventiona and authentication), such cock synchronization in this appication due to the arge operand

More information

(12) United States Patent (10) Patent N0.: US 6,230,287 B1 Pinard et al. (45) Date of Patent: May 8, 2001

(12) United States Patent (10) Patent N0.: US 6,230,287 B1 Pinard et al. (45) Date of Patent: May 8, 2001 US006230287B1 (12) United States Patent (10) Patent N0.: US 6,230,287 B1 Pinard et a. (45) Date of Patent: May 8, 2001 (54) WEB BASED HELP DESK 6,119,247 * 9/2000 House et a...... 714/38 6,144,670 * 11/2000

More information

Register Allocation. Consider the following assignment statement: x = (a*b)+((c*d)+(e*f)); In posfix notation: ab*cd*ef*++x

Register Allocation. Consider the following assignment statement: x = (a*b)+((c*d)+(e*f)); In posfix notation: ab*cd*ef*++x Register Aocation Consider the foowing assignment statement: x = (a*b)+((c*d)+(e*f)); In posfix notation: ab*cd*ef*++x Assume that two registers are avaiabe. Starting from the eft a compier woud generate

More information

based mainly on course notes by Will Hyslop (UNB-F) and course notes by Jeff Ullman and others (Stanford)

based mainly on course notes by Will Hyslop (UNB-F) and course notes by Jeff Ullman and others (Stanford) plsql.txt Wed Feb 22 12:40:22 2017 1 NOTES ON ORACLE PL/SQL Owen Kaser, February 5, 2015. based mainly on course notes by Will Hyslop (UNB-F) and course notes by Jeff Ullman and others (Stanford) plsql.txt

More information

Chapter 6 The database Language SQL as a tutorial

Chapter 6 The database Language SQL as a tutorial Chapter 6 The database Language SQL as a tutorial About SQL SQL is a standard database language, adopted by many commercial systems. ANSI SQL, SQL-92 or SQL2, SQL99 or SQL3 extends SQL2 with objectrelational

More information

Distance Weighted Discrimination and Second Order Cone Programming

Distance Weighted Discrimination and Second Order Cone Programming Distance Weighted Discrimination and Second Order Cone Programming Hanwen Huang, Xiaosun Lu, Yufeng Liu, J. S. Marron, Perry Haaand Apri 3, 2012 1 Introduction This vignette demonstrates the utiity and

More information

Lecture 7 Stored procedure

Lecture 7 Stored procedure ITM-661 ระบบฐานข อม ล (Database system) Walailak - 2013 Lecture 7 Stored procedure Walailak University T. Connolly, and C. Begg, Database Systems: A Practical Approach to Design, Implementation, and Management,

More information

Meeting Exchange 4.1 Service Pack 2 Release Notes for the S6200/S6800 Servers

Meeting Exchange 4.1 Service Pack 2 Release Notes for the S6200/S6800 Servers Meeting Exchange 4.1 Service Pack 2 Reease Notes for the S6200/S6800 Servers The Meeting Exchange S6200/S6800 Media Servers are SIP-based voice and web conferencing soutions that extend Avaya s conferencing

More information

NCH Software Express Delegate

NCH Software Express Delegate NCH Software Express Deegate This user guide has been created for use with Express Deegate Version 4.xx NCH Software Technica Support If you have difficuties using Express Deegate pease read the appicabe

More information

Week 4. Pointers and Addresses. Dereferencing and initializing. Pointers as Function Parameters. Pointers & Structs. Gaddis: Chapters 9, 11

Week 4. Pointers and Addresses. Dereferencing and initializing. Pointers as Function Parameters. Pointers & Structs. Gaddis: Chapters 9, 11 Week 4 Pointers & Structs Gaddis: Chapters 9, 11 CS 5301 Spring 2017 Ji Seaman 1 Pointers and Addresses The address operator (&) returns the address of a variabe. int x; cout

More information

Introduction to Database Systems

Introduction to Database Systems Introduction to Database Systems Lecture #1 Autumn, 2001 Fa, 2001, LRX #01 Introduction to Database Systems HUST,Wuhan,China 1 Basic Information Course name: Database System Design (DSD) Course number:

More information

Readme ORACLE HYPERION PROFITABILITY AND COST MANAGEMENT

Readme ORACLE HYPERION PROFITABILITY AND COST MANAGEMENT ORACLE HYPERION PROFITABILITY AND COST MANAGEMENT Reease 11.1.2.4.000 Readme CONTENTS IN BRIEF Purpose... 2 New Features in This Reease... 2 Instaation Information... 2 Supported Patforms... 2 Supported

More information

Control Plane Based on SCIM API

Control Plane Based on SCIM API Contro Pane Based on SCIM API draft-hunt-secevents-stream-mgmt-api Phi Hunt IETF100, Singapore November, 2017 Why not re-use? Why SCIM? SCIM2 is a provisioning protoco Based on JSON documents and RESTfu

More information

Department of Computer Science. AIMS Verification HT 2018

Department of Computer Science. AIMS Verification HT 2018 Department of Computer Science AIMS Verification HT 2018 Outine Back Hats Back Hats Exempars for entry points of attacks Symboic Execution Basic idea of soving the formuas Path-based Merging paths Automated

More information

Tutorial 3 Concepts for A1

Tutorial 3 Concepts for A1 CPSC 231 Introduction to Computer Science for Computer Science Majors I Tutoria 3 Concepts for A1 DANNY FISHER dgfisher@ucagary.ca September 23, 2014 Agenda script command more detais Submitting using

More information

CSCI3030U Database Models

CSCI3030U Database Models CSCI3030U Database Models CSCI3030U RELATIONAL MODEL SEMISTRUCTURED MODEL 1 Content Design of databases. relational model, semistructured model. Database programming. SQL, XPath, XQuery. Not DBMS implementation.

More information

CSE120 Principles of Operating Systems. Architecture Support for OS

CSE120 Principles of Operating Systems. Architecture Support for OS CSE120 Principes of Operating Systems Architecture Support for OS Why are you sti here? You shoud run away from my CSE120! 2 CSE 120 Architectura Support Announcement Have you visited the web page? http://cseweb.ucsd.edu/casses/fa18/cse120-a/

More information

Constraints. Local and Global Constraints Triggers

Constraints. Local and Global Constraints Triggers Constraints Foreign Keys Local and Global Constraints Triggers 1 Constraints and Triggers A constraint is a relationship among data elements that the DBMS is required to enforce. Example: key constraints.

More information

NCH Software Spin 3D Mesh Converter

NCH Software Spin 3D Mesh Converter NCH Software Spin 3D Mesh Converter This user guide has been created for use with Spin 3D Mesh Converter Version 1.xx NCH Software Technica Support If you have difficuties using Spin 3D Mesh Converter

More information

Professor: Alvin Chao

Professor: Alvin Chao Professor: Avin Chao Anatomy of a Java Program: Comments Javadoc comments: /** * Appication that converts inches to centimeters. * * @author Chris Mayfied * @version 01/21/2014 */ Everything between /**

More information

file://j:\macmillancomputerpublishing\chapters\in073.html 3/22/01

file://j:\macmillancomputerpublishing\chapters\in073.html 3/22/01 Page 1 of 15 Chapter 9 Chapter 9: Deveoping the Logica Data Mode The information requirements and business rues provide the information to produce the entities, attributes, and reationships in ogica mode.

More information

User s Guide. Eaton Bypass Power Module (BPM) For use with the following: Eaton 9155 UPS (8 15 kva)

User s Guide. Eaton Bypass Power Module (BPM) For use with the following: Eaton 9155 UPS (8 15 kva) Eaton Bypass Power Modue (BPM) User s Guide For use with the foowing: Eaton 9155 UPS (8 15 kva) Eaton 9170+ UPS (3 18 kva) Eaton 9PX Spit-Phase UPS (6 10 kva) Specia Symbos The foowing are exampes of symbos

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling CSE120 Principes of Operating Systems Prof Yuanyuan (YY) Zhou Scheduing Announcement Homework 2 due on October 25th Project 1 due on October 26th 2 CSE 120 Scheduing and Deadock Scheduing Overview In discussing

More information

A Comparison of a Second-Order versus a Fourth- Order Laplacian Operator in the Multigrid Algorithm

A Comparison of a Second-Order versus a Fourth- Order Laplacian Operator in the Multigrid Algorithm A Comparison of a Second-Order versus a Fourth- Order Lapacian Operator in the Mutigrid Agorithm Kaushik Datta (kdatta@cs.berkeey.edu Math Project May 9, 003 Abstract In this paper, the mutigrid agorithm

More information

Introduction to OpenMP

Introduction to OpenMP MPSoC Architectures OpenMP Aberto Bosio, Associate Professor UM Microeectronic Departement bosio@irmm.fr Introduction to OpenMP What is OpenMP? Open specification for Muti-Processing Standard API for defining

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE SQL DATA DEFINITION LANGUAGE DATABASE SCHEMAS IN SQL SQL is primarily a query language, for getting information from a database. DML: Data Manipulation Language SFWR ENG 3DB3 FALL 2016 MICHAEL LIUT (LIUTM@MCMASTER.CA)

More information

Contains slides made by Naci Akkøk, Pål Halvorsen, Arthur M. Keller, Vera Goebel

Contains slides made by Naci Akkøk, Pål Halvorsen, Arthur M. Keller, Vera Goebel SQL-99 Contains slides made by Naci Akkøk, Pål Halvorsen, Arthur M. Keller, Vera Goebel SQL-99 user-defined types (UDTs) methods for UDTs declarations references operations Overview 2 SQL Development SQL-86

More information

Avaya Aura Call Center Elite Multichannel Configuration Server User Guide

Avaya Aura Call Center Elite Multichannel Configuration Server User Guide Avaya Aura Ca Center Eite Mutichanne Configuration Server User Guide Reease 6.2.3/6.2.5 March 2013 2013 Avaya Inc. A Rights Reserved. Notice Whie reasonabe efforts were made to ensure that the information

More information

Directives & Memory Spaces. Dr. Farid Farahmand Updated: 2/18/2019

Directives & Memory Spaces. Dr. Farid Farahmand Updated: 2/18/2019 Directives & Memory Spaces Dr. Farid Farahmand Updated: 2/18/2019 Memory Types Program Memory Data Memory Stack Interna PIC18 Architecture Data Memory I/O Ports 8 wires 31 x 21 Stack Memory Timers 21 wires

More information

Industrial Process Control Trainers with Discovery software PROCON PROCESS CONTROL TRAINERS

Industrial Process Control Trainers with Discovery software PROCON PROCESS CONTROL TRAINERS SYSTEMS Edition 1 I 38S-1 PROCON PROCESS CONTROL TRAINERS Industria Process Contro Trainers with Discovery software Leve & Fow Contro Temperature Contro Pressure Contro SYSTEMS-1 1 Temperature Rig 38-600

More information

Neural Network Enhancement of the Los Alamos Force Deployment Estimator

Neural Network Enhancement of the Los Alamos Force Deployment Estimator Missouri University of Science and Technoogy Schoars' Mine Eectrica and Computer Engineering Facuty Research & Creative Works Eectrica and Computer Engineering 1-1-1994 Neura Network Enhancement of the

More information

SQL DATA DEFINITION LANGUAGE

SQL DATA DEFINITION LANGUAGE 9/27/16 DATABASE SCHEMAS IN SQL SQL DATA DEFINITION LANGUAGE SQL is primarily a query language, for getting information from a database. SFWR ENG 3DB3 FALL 2016 But SQL also includes a data-definition

More information

CS145 Introduction. About CS145 Relational Model, Schemas, SQL Semistructured Model, XML

CS145 Introduction. About CS145 Relational Model, Schemas, SQL Semistructured Model, XML CS145 Introduction About CS145 Relational Model, Schemas, SQL Semistructured Model, XML 1 Content of CS145 Design of databases. E/R model, relational model, semistructured model, XML, UML, ODL. Database

More information

Modeling of Problems of Projection: A Non-countercyclic Approach * Jason Ginsburg Osaka Kyoiku University

Modeling of Problems of Projection: A Non-countercyclic Approach * Jason Ginsburg Osaka Kyoiku University Modeing of Probems of Projection: A Non-countercycic Approach * Jason Ginsburg Osaka Kyoiku University Abstract This paper describes a computationa impementation of the recent Probems of Projection (POP)

More information

Bridge Talk Release Notes for Meeting Exchange 5.0

Bridge Talk Release Notes for Meeting Exchange 5.0 Bridge Tak Reease Notes for Meeting Exchange 5.0 This document ists new product features, issues resoved since the previous reease, and current operationa issues. New Features This section provides a brief

More information

For Review Only. CFP: Cooperative Fast Protection. Bin Wu, Pin-Han Ho, Kwan L. Yeung, János Tapolcai and Hussein T. Mouftah

For Review Only. CFP: Cooperative Fast Protection. Bin Wu, Pin-Han Ho, Kwan L. Yeung, János Tapolcai and Hussein T. Mouftah Journa of Lightwave Technoogy Page of CFP: Cooperative Fast Protection Bin Wu, Pin-Han Ho, Kwan L. Yeung, János Tapocai and Hussein T. Mouftah Abstract We introduce a nove protection scheme, caed Cooperative

More information

Introduction to SQL. Select-From-Where Statements Multirelation Queries Subqueries. Slides are reused by the approval of Jeffrey Ullman s

Introduction to SQL. Select-From-Where Statements Multirelation Queries Subqueries. Slides are reused by the approval of Jeffrey Ullman s Introduction to SQL Select-From-Where Statements Multirelation Queries Subqueries Slides are reused by the approval of Jeffrey Ullman s 1 Why SQL? SQL is a very-high-level language. Say what to do rather

More information

Concurrent programming: From theory to practice. Concurrent Algorithms 2016 Tudor David

Concurrent programming: From theory to practice. Concurrent Algorithms 2016 Tudor David oncurrent programming: From theory to practice oncurrent Agorithms 2016 Tudor David From theory to practice Theoretica (design) Practica (design) Practica (impementation) 2 From theory to practice Theoretica

More information

Database Application Development

Database Application Development Database Application Development Chapter 6 PSM (Stored Procedures) 1 Stored Procedures What is a stored procedure: SQL allows you to define procedures and functions and store in the DB server Program executed

More information