Free Essay

Sql Stored Proc

In:

Submitted By mayansingh
Words 1521
Pages 7
SQL_StoredProcBasics Updated 10/05/2001

BUSINESS & COMPUTERS, Inc.
13839 Mur-Len Rd, Suite M OLATHE, KANSAS 66062
We Translate Business Processes from the Mind to the Computer to the Bottom Line.

Phone: (913) 764-2311 Fax: 764 7515 larryg@kcnet.com

Stored Procedures for SQL Server The Basics
Copyright® 2001 Business & Computers, Inc. A note – the below is my humble opinion – with testing – If you use my ideas please test them and if you have problems or learn more let me know.

#1 - Stored Procedures (SPs) Inside SQL Server * Stored Procedures are precompiled Transact-SQL statements stored in a SQL Server database. * Stored Procedures are one of the most powerful pieces of programming you will ever see. When you start out, you will see them as a way to return a record set, or do some small update on your data. As you learn more about SPs you will understand why there are entire books written on the subject. SQL Server compiles the Proc so that when you run it, it runs as fast as possible. Once you write a couple of complicated SPs, you will be convinced. This paper only covers the tip of the Stored Procedure iceberg. * I will refer to Stored Procedures in this document as SP and Proc - get use to it. * Stored Procedures return read only data and can have > Input parameters > Output parameters > Parameters that are both input and output > Can have 1 or more recordsets

Business & Computers, Inc.

Page 1

#2 - Simple Recordset with a Input Parameter * Figure –2-1 shows a simple stored procedures with that has in input parameter and returns a recordset. When we run it from the Query Analyzer (Figure 2–2) we get the following results.

Figure 2-1 Stored Procedure with input parameter & recordset

Stored Procedure Name

Parameter Check Syntax

Run Button

Database running against

Result set

Figure -2-2 Running a procedure on Query Analyzer

* If you notice in Figure 2-2, it shows “(3 row(s) affected)”. If you don’t set “set nocount on” in a SP, when you run the SP in the Query Analyzer, you will get back a message “X rows affected”. By setting nocount on, it stops SQL Server from doing some work, that you don’t care about. This will cause the SP to run just a little faster. * You need to learn about sp_Help and other system stored procedures. Works with or without the single quotes.

Figure 2-3

* You can also run the query in an Access Pass-Through Query. Figure 2-4 MS Access Pass-Through Query Figure 2-5 Pass-Through Query Results

Business & Computers, Inc.

Page 2

* In figure 2-4 we use ADO code and the command object to get a recordset from the Stored Procedure on SQL Server. * Note: You certainly can do this many different ways, however I do want to point out the difference between the While, Wend Loop as opposed to the GetString. You will probably want to use the GetString in testing.

Figure 2-4 ADO using Proc for recordset
Public Function ex_SP_ReadRecords() '--> Uses the Command Object Dim Cmd1 As ADODB.Command Dim lngRecordsAffected As Long Dim rs1 As ADODB.Recordset Dim intRecordCount As Integer '----Dim cnnTemp As ADODB.Connection Set cnnTemp = New ADODB.Connection cnnTemp.ConnectionString = "Provider=SQLOLEDB.1;" & _ "DRIVER=SQL Server;SERVER=bcnt;" & _ "Trusted_Connection=Yes;UID=;PWD=;" & _ "DATABASE=MWData;" cnnTemp.Open 'Open Connection Set Cmd1 = New ADODB.Command Cmd1.ActiveConnection = cnnTemp '--With Cmd1 .CommandText = "z_sp_SimpleReadTable" .CommandType = adCmdStoredProc .Parameters.Refresh .Parameters("@vcCompanyName").Value = "bus" End With

Set rs1 = Cmd1.Execute() 'While Not rs1.EOF ' intRecordCount = intRecordCount + 1 ' Debug.Print rs1.Fields(1), intRecordCount ' rs1.MoveNext 'Wend 'The following lines shows all the records and all fields fro the above recordset Debug.Print rs1.GetString(adClipString, , ";") rs1.Close Finish_Up: ex_SP_ReadRecords = True ProcedureDone: On Error Resume Next rs1.Close Set Cmd1 = Nothing Set rs1 = Nothing Exit Function HandleError: Debug.Print Err.Number, Err.Description Resume ProcedureDone End Function

Business & Computers, Inc.

Page 3

#3 - Simple Input & Output Parameters * Figure 3-1 shows another example of a simple SP with input and output parameter. In the SP we input a company Id (@vcCo_IdT) and return the company name in the output parameter. We run the SP with ADO Code. (see figure-6)

Figure 3-1 Stored Procedure Input and Output Parameters

The Proc simply takes the input from the ADO code, runs the T-SQL statement using the input parameter, and returns the answer to the ADO code.

Figure -3-2

Comment

/*Input @vcCo_Idt =266 OutPut @vcOutPut1 = Business & Computers, Inc */

* Notice the line in Figure-3-2. This is a remark. You can put in Figure -3-3 ADO Code to run Proc a remark with “/*” and end with Public Function ex_SP_In_Out_Parameters_Simple_2() “*/” You can also use two dashes “--this is a test” for a single line. 'On Error GoTo HandleError * The ADO code (figure-3-3) Opens the connection, sets the command, refreshes the parameters, and set the value of the parameter, and then executes the proc. It then reads the output parameter from the proc.
Dim Cmd1 As ADODB.Command Dim lngRecordsAffected As Long Dim cnnTemp As ADODB.Connection Set cnnTemp = New ADODB.Connection cnnTemp.ConnectionString = "Provider=SQLOLEDB.1;" & _ "DRIVER=SQL Server;SERVER=bcnt;" & _ "Trusted_Connection=Yes;UID=;PWD=;" & _ "DATABASE=MWData;" cnnTemp.Open '----

Note: If you run this procedure 'Open Command Object from the query analyzer, you will Set Cmd1 = New ADODB.Command Cmd1.ActiveConnection = cnnTemp need to put in a false parameter for the output parameter, and probably put a print statement in- '--With Cmd1 side the proc to show the output .CommandText = "z_sp_In_Out_Parameters_Simple" parameter in the query analyzer. .CommandType = adCmdStoredProc
.Parameters.Refresh .Parameters("@vcCo_IdT").Value = 266 .Execute , lngRecordsAffected, adExecuteNoRecords End With Debug.Print Cmd1.Parameters("@vcOutPut1").Value

z_sp_In_Out_Parameters_Simple '266', ''

print @vcOutPut1

Set Cmd1 = Nothing ProcedureDone: Exit Function HandleError:
Business & Computers, Inc.
Page 4

CREATE PROCEDURE z_sp_In_Out_Parameters_Complex Figure 3-4 Com@vcWhere AS varchar(8000), plex Input and Output @vcTableFromName AS varchar(255) , Parameters @vcIDName AS varchar(55) , @vcTableInToName AS varchar(255) = 'tbl_zs_StartID', @btNumericId_YN as bit=0, @vcOutPut1 AS varchar(255) output as SET NOCOUNT ON

* This is a bit of a /* Documentation Below '---complex stored --> Purpose: This is an Example of In & Out Parameters procedure. I See ex_SP_In_Out_Parameters_Complex in Mod_ADo_SQL Required_Elements: tbl_zs_StartID Returns: Recordset see a direction -----------------------------------------------we are heading. Documentation Above */
Declare @vcSQL AS varchar(255) Declare @vcIDField AS varchar(55) set @vcOutPut1 = '-100' Select @vcSQL = 'delete from ' + @vcTableInToName exec(@vcSQL) set @vcOutPut1 = '-90' --What field do we put the data into If @btNumericId_YN =0 Begin Select @vcIDField = 'IdT' End else Begin Select @vcIDField = 'Id' End set @vcOutPut1 = '-80' --Put the Id from the records in the current form into the table Select @vcSQL = 'INSERT INTO ' + @vcTableInToName + '( ' + @vcIDField + ')' + ' SELECT ' + @vcIDName + ' FROM ' + @vcTableFromName + ' Where ' exec(@vcSQL + @vcWhere) set @vcOutPut1 = '-70' --SELECT @chmsg = 'We are Done.' --select @vcOutPut1 = str(@@rowcount) SELECT vw_Companies.Co_Alpha_Name, vw_Companies.Bill_Cty, vw_Companies.Bill_St FROM vw_Companies RIGHT OUTER JOIN tbl_zs_StartID ON vw_Companies.Co_IdT = tbl_zs_StartID.IdT select @vcOutPut1 = '--->' + Ltrim(str(@@rowcount) + ' Records') return 10

Business & Computers, Inc.

Page 5

#4 - What Access Calls Action Queries (Delete data, Append Data, Update Data, Make Tables) * In MS Access we have select queries that would return a result set similar to figure 2-5. In addition we have the following type of queries that manip ulates the data in the tables. Delete data * Ok, so I made it a little more difficult than it had to be. To delete records from a table you can just have one line in the procedure: delete tbl_City where City_Id = @intId

Figure 4-1

Delete Records—Stored Procedure

Figure 4-2 ADO to Run the Above Delete Action

Public Function ex_SP_QueryDelete() As Boolean

You can pass an input parameter Create Procedure abc @intId as Int as

'>>> Stored Procedure & ADO are about the same Speed We delete table tmpCity if it exist.

Section A

Section B

Business & Computers, Inc.

Page 8

#5 - Case Statement * If you are like me and use the “IIf” statement in Access queries, you are going to want to know what you can replace it with in SQL Server. There are no replacements in Views, however in SPS you can use the case statement. In figure 5-1 we have a SP that looks at the field Mail_St which is a 2 character field for the state. If it = KS we substitute Kansas, if MO we use Missouri, otherwise we use the actual value in the field Mail_St. You can see how it comes out in figure 5-2.

Figure 5-1

Figure 5-2

Business & Computers, Inc.

Page 9

#6 - Additional Information

Figure 6-1 SQL Floor(7.234) Round(765.4321, 2)

>>Numeric Functions>Type Conversions>Misc. InformationBetween ‘1/1/01’ and ‘12/31/01’

String Delimiter Concatenation Operator

SQL -> ‘Gordon’ + ‘, ‘ + ‘Larry’ SQL -> ‘Gordon’ + ‘, ‘ + ‘Larry’

‘ + _ % 1 0

Wildcard Character (Any one character) Where Last like “Gor_on” SQL -> select last_Name from tbl_Individuals where last_name like 'Gor_on' Wildcard Character (Any group of characters) SQL -> select last_Name from tbl_Individuals where last_name like 'Gord%' True/Yes Bit type data False/No Bit type data

Business & Computers, Inc.

Page 10

Figure 6-4 SQL

>>String Functions

Similar Documents

Premium Essay

Sql Quiz

...minutes | 7 out of 10 | Score for this quiz: 7 out of 10 Submitted Mar 19 at 11:58pm This attempt took 36 minutes.   Question 1 1 / 1 pts Parameters for stored procedures and functions can be of any valid SQL Server data type except Parameters for stored procedures and functions can be of any valid SQL Server data type except   date/time Correct!   table   xml   numeric   Question 2 0 / 1 pts Skip to question text. Code a statement that calls the following stored procedure and passes the values ‘2011-12-01’ and 122 to its input parameters. Pass the parameters by name in the reverse order that they’re declared in the procedure. CREATE PROC spInvoiceTotal1        @DateVar smalldatetime,        @VendorID int AS SELECT SUM(InvoiceTotal) FROM Invoices WHERE VendorID = @VendorID AND InvoiceDate >= @DateVar; ______________________________________________________________________________ You Answered Correct Answers EXEC spInvoiceTotal1 @VendorID = 122, @DateVar = '2011-12-01'; EXEC spInvoiceTotal1 @VendorID = 122, @DateVar = '2011-12-01'   Question 3 0 / 1 pts Before you can pass a table to a stored procedure or a function as a parameter, you must use the ______________________ statement to create a user-defined table type. Before you can pass a table to a stored procedure or a function as a parameter, you must use the ______________________ statement to create a user-defined table type. You Answered Correct Answers ...

Words: 645 - Pages: 3

Premium Essay

Comp

...Relational Database Design SQL GRANT REVOKE Commands DCL commands are used to enforce database security in a multiple user database environment. Two types of DCL commands are GRANT and REVOKE. Only Database Administrator's or owner's of the database object can provide/remove privileges on a database object. SQL GRANT Command SQL GRANT is a command used to provide access or privileges on the database objects to the users. The Syntax for the GRANT command is: GRANT privilege_name ON object_name TO {user_name |PUBLIC |role_name} [WITH GRANT OPTION];  privilege_name is the access right or privilege granted to the user. Some of the access rights are ALL, EXECUTE, and SELECT.  object_name is the name of an database object like TABLE, VIEW, STORED PROC and SEQUENCE.  user_name is the name of the user to whom an access right is being granted.  PUBLIC is used to grant access rights to all users.  ROLES are a set of privileges grouped together.  WITH GRANT OPTION - allows a user to grant access rights to other users. GRANT SELECT ON employee TO user1; This command grants a SELECT permission on employee table to user1.You should use the WITH GRANT option carefully because for example if you GRANT SELECT privilege on employee table to user1 using the WITH GRANT option, then user1 can GRANT SELECT privilege on employee table to another user, such as user2 etc. Later, if you REVOKE the SELECT privilege on employee from user1...

Words: 867 - Pages: 4

Premium Essay

Deep'Z Studio.

...INTRODUCTION SQL is divided into the following  Data Definition Language (DDL)  Data Manipulation Language (DML)  Data Retrieval Language (DRL)  Transaction Control Language (TCL)  Data Control Language (DCL) DDL -- create, alter, drop, truncate, rename DML -- insert, update, delete DRL -- select TCL -- commit, rollback, savepoint DCL -- grant, revoke CREATE TABLE SYNTAX Create table (col1 datatype1, col2 datatype2 …coln datatypen); Ex: SQL> create table student (no number (2), name varchar (10), marks number (3)); INSERT This will be used to insert the records into table. We have two methods to insert.   a) By value method By address method USING VALUE METHOD Syntax: insert into (table_name) values (value1, value2, value3 …. Valuen); © Copy rights are reserved. 2 Ex: SQL> insert into student values (1, ’sudha’, 100); SQL> insert into student values (2, ’saketh’, 200); To insert a new record again you have to type entire insert command, if there are lot of records this will be difficult. This will be avoided by using address method. b) USING ADDRESS METHOD Syntax: insert into (table_name) values (&col1, &col2, &col3 …. &coln); This will prompt you for the values but for every insert you have to use forward slash. Ex: SQL> insert into student values (&no, '&name', &marks); Enter value for no: 1 Enter value for name: Jagan Enter value for marks: 300 old new SQL> 1:...

Words: 42387 - Pages: 170

Premium Essay

Basic Database Notes (Sql)

...Create Table CREATE TABLE PRESENTERS (PRESENTERID CHAR (6) PRIMARY KEY NOT NULL, PNRLNAME VARCHAR (20) NOT NULL, PNRFNAME VARCHAR (20) NOT NULL, GENDER CHAR (2) DEFAULT ‘M’, AGE SMALLINT NOT NULL CHECK (AGE>=18), YEARS SMALLINT NOT NULL, SALARY_YEARLY DECIMAL (10, 2) NOT NULL); CREATE TABLE EPISODES (EPISODENO INT IDENTITY (1,1) PRIMARY KEY NOT NULL, EPISODENAME VARCHAR (50) NOT NULL, DATEAIRED DATE NOT NULL, GUEST VARCHAR (50), COUNTRYAIRED VARCHAR (10) NOT NULL, PRESENTERID CHAR (6) FOREIGN KEY REFERENCES PRESENTERS (PRESENTERID), CARNO CHAR (7) FOREIGN KEY REFERENCES CARS (CARNO)); Insert Into Table INSERT INTO PRESENTERS (PRESENTERID, PNRLNAME, PNRFNAME, AGE, YEARS, SALARY_YEARLY) VALUES ('EMP_01','NEEDELL','TIFF', 61, 10, 374500.70), ('EMP_02','BUTLER-HENDERSON','VICKI', 41, 10, 24262.55), ('EMP_03','PLATO','JASON', 45, 8, 29100.98); Alter Tables Add Column ALTER TABLE EMPLOYEES ADD LAST_NAME VARCHAR (50) Datatypes ALTER TABLE CAKES ALTER COLUMN CAKENO CHAR (8) NOT NULL Constraints ALTER TABLE EMPLOYEES ADD CONSTRAINT PK1 PRIMARY KEY (EMPID) Foreign Keys ALTER TABLE EPISODES ADD FOREIGN KEY (CAKENO) REFERENCES CAKES (CAKENO) Change Column SP_RENAME 'TABLE_NAME'.'OLD_COLUMN_NAME', 'NEW_COLUMN_NAME', 'COLUMN'; Drop Column ALTER TABLE EMPLOYEES DROP COLUMN LAST_NAME; Delete Row DELETE FROM CARS WHERE CARMAKE='SUBARU WRX' Drop Table DROP TABLE EMPLOYEES Update Tables UPDATE PRESENTERS SET SALARY_YEARLY...

Words: 1804 - Pages: 8

Premium Essay

Chapter 3

...Review Questions Chapter 1 1.3 Describe the approach taken to the handling of data in the early file-based systems. In the early file based system their all data was in written form, due to the lake of education, due to the in-familiarity with new techniques, lake of computer knowledge so all the data required would be stored in a file or files owned by the programs. Discuss the disadvantages of this approach. Different programs could be written in different languages, and would not be able to access another program's files. This would be true even for those programs written in the same language, because a program needs to know the file structure before it can access it. 1.4 Describe the main characteristics of the database approach and contrast it with the file-based approach. Focus is now on the data first, and then the applications. The structure of the data is now kept separate from the programs that operate on the data. This is held in the system catalog or data dictionary. Programs can now share data, which is no longer fragmented. There is also a reduction in redundancy, and achievement of program-data independence. 1.5 Describe the five components of the DBMS environment and discuss how they relate to each other. (1) Hardware: The computer system(s) that the DBMS and the application programs run on. This can range from a single PC, to a single mainframe, to a network of computers. (2) Software: The DBMS software and the application...

Words: 2796 - Pages: 12

Free Essay

Estadistica

...Estándares Transact-SQL Buenas Prácticas de Programación 1. Convenciones y Estándares de Nombres Nota: Los términos “notación Pascal” y “notación de Camell” son usados a través de este documento. Notación Pascal – El primer carácter de todas las palabras se escribe en Mayúsculas y los otros caracteres en minúsculas. Ejemplo: ColorDeFondo Notación de Camell – El primer carácter de todas las palabras, excepto de la primera palabra se escribe en Mayúsculas y los otros caracteres en minúsculas. Ejemplo: colorDeFondo 1. Usa notación Pascal para el nombre de las Tablas CREATE TABLE dbo.Employee 2. Usa notación Pascal para el nombre de los campos de tabla CREATE TABLE dbo.Employee ( IdEmployee INT, FirstName VARCHAR(20), LastName VARCHAR(20) ) 3. NO usar nunca “sp_”, La razón es que: SQL Server reconoce el prefijo “sp_” como “System Stored Procedure”, es decir, un procedimiento almacenado de Sistema y lo buscaría en la Base de Datos. Usa la siguiente sintaxis para los nombres de los Stored procedures: Usp_<Nombre Esquema>_<Nombre Tabla> _<Accion> Ejemplo: usp_GEN_Employee_Insert usp_GEN_Employee_GetAll 4. Usa esquemas para agrupar los objetos como tablas, los nombres deben de ser Abreviados. Incorrecto: GEN_Employee Correcto: GEN.Employee 2. Consideraciones en el diseño de base de datos 1. El nombre de la base de datos debe de asemejarse al nombre de la aplicación, no deberá de contener...

Words: 2608 - Pages: 11

Premium Essay

Practice Questions for Ibm Db2 10 Certification

...1.Workload Manager (WLM) manages how many concurrent stored procedures can run in an address space and the number of concurrent stored procedures in an address space cannot exceed the value of the NUMTCB parameter. Which statement about the value of NUMTCB is correct? A. NUMTCB parameter must be set to 1 for Java stored procedures. B. NUMTCB parameter must be set to 1 for REXX stored procedures. C. NUMTCB parameter can be a value greater than 1 for native SQL stored procedures. D. NUMTCB parameter can be a value greater than 1 when a stored procedure invokes DB2 utilities. Answer: B 2.If a single row of the PLAN_TABLE has a 'Y' value in more than one of the sort composite columns, what is indicated.? A. The next sort step will perform two sorts. B. There are multiple sorts in the plan step. C. One sort in the plan step will accomplish two tasks. D. Two sorts are performed on the new table of a star join. Answer: C 3.What IBM provided stored procedure will access DB2 real time statistics tables? A. DSNAEXP B. DSNAIMS C. DSNACCOX D. DSNLEUSR Answer: C 4.The EXPLAIN STMTCACHE ALL statement provides information about SQL tuning. Which information is part of the DSN_STATEMENT_CACHE_TABLE? A. Filter factor information. B. Stage 1 and stage 2 information. C. Number of columns used in an index. D. Number of times an SQL statement is executed. Answer: D 5.Which two of the following DB2 performance features will ignore clustering...

Words: 8187 - Pages: 33

Premium Essay

Hostel Management

...1.INTRODUCTION 1.1 PURPOSE: The purpose of this document is to describe the requirements for an automation system for a college grievance cell to register the complaints online from valid users and maintain all related information. It also describes the interface, platform and other constraints. 1.2 SCOPE: This document is the only one that describes the requirements of the system. It is meant for the use by the developers and will be the basis for validating the final delivered system. Any change made to the requirements in the future will have to go through a formal approval process. The developer is responsible for asking clarification, where necessary, and will not make any alteration without the permission of the client. 1.3 DEFINITIONS AND ABBREVIATIONS: 1. OGC- Online Grievance Cell 2. Grievance-A grievance is the subject of a complaint filed by a student, which is to be resolved by procedures provided in the college. It is any issue causing problem to the students, which need to be relevant. Ex. Issues related to ragging, food, faculty etc. Grievance is sometimes referred to as complaint. 3. Student- Any student of SDMCET belonging to any of the semesters from 1st to 8th of any branch. 4. Authority- The Dean academic for academic and Dean Student welfare for non academic grievances, who are responsible for resolving the grievances of students. 5. Database Administrator- One who manages and maintains the database, i.e adding/ deleting of users...

Words: 5166 - Pages: 21

Premium Essay

Video Data Mining

...a lot of various concepts. Even though the annotation for the individual image frame is in effect, any concept in the image frames still cannot represent the complete video. The aim of the paper is to allow users to obtain their desired videos by submitting her/his interested video clips, without considering the identification of the query terms and applying an efficient indexing technique for searching videos present in large multimedia repositories. Keywords Video data mining, multimedia repository, index table, query clip. 1. INTRODUCTION Data mining is the process of posing various queries and extracting useful and often previously unknown and unexpected information, patterns, and trends from large quantities of data, generally stored in databases[1]. These data could be accumulated over a long period of time or they could be large data sets accumulated simultaneously from heterogeneous sources. Video mining is considered as an extension of still image mining by including mining of temporal image sequences. However, the video data in the general case represent the multimedia already since they include – besides the image sequence – audio data and textual annotations. The searching of video data to find the best matching video clip in content to the desired clip of the user is a very challenging task[4]. We approach...

Words: 2310 - Pages: 10

Free Essay

Car Sensor

...Journal of Traffic and Logistics Engineering Vol. 2, No. 3, September 2014 A Car Monitoring System for Self Recording Traffic Violations Ahmed M. Elmahalawy Computer Science and Engineering Department, Faculty of Electronics Engineering, Minufiya University Menouf, 32952, El-Minufiya, Egypt Email: ahmed.elmahalawy@el-eng.menofia.edu.eg; a_elmhalaway@hotmail.com  which ought to be considered as sufficiently independent. These two major sub-systems are: 1) the transaction subsystem and 2) the enforcement subsystem. [2] Another example is video technology applications for traffic management and safety. This technology offers both tangible and intangible benefits. Video technology requires a substantial up- front investment costs for the purchase and installation of equipment and training of staff. Due to the complexity of video systems and the rapid pace of change related to this technology, agencies may overlook some applications while using resources to implement less valuable applications. [3] Over the last few years there has been a growing interest in Intelligent Speed Adaptation (ISA), to solve the problem of exceeding the speed limits. ISA has the potential to significantly reduce the incidence and severity of road trauma in many countries all over the world. [4], [5] The remainder of this paper is organized as follows: Section 2 gives a background of previous work in this field. Overview of Self Recording Traffic Violations system is presented...

Words: 3119 - Pages: 13

Premium Essay

Oracle Sql Tutorial

...Oracle/SQL Tutorial1 Michael Gertz Database and Information Systems Group Department of Computer Science University of California, Davis gertz@cs.ucdavis.edu http://www.db.cs.ucdavis.edu This Oracle/SQL tutorial provides a detailed introduction to the SQL query language and the Oracle Relational Database Management System. Further information about Oracle and SQL can be found on the web site www.db.cs.ucdavis.edu/dbs. Comments, corrections, or additions to these notes are welcome. Many thanks to Christina Chung for comments on the previous version. Recommended Literature George Koch and Kevin Loney: Oracle8 The Complete Reference (The Single Most Comprehensive Sourcebook for Oracle Server, Includes CD with electronic version of the book), 1299 pages, McGraw-Hill/Osborne, 1997. Michael Abbey and Michael Corey: Oracle8 : A Beginner’s Guide [A Thorough Introduction for First-time Users], 767 pages, McGraw-Hill/Osborne, 1997. Steven Feuerstein, Bill Pribyl, Debby Russell: Oracle PL/SQL Programming (2nd Edition), O’Reilly & Associates, 1028 pages, 1997. C.J. Date and Hugh Darwen: A Guide to the SQL Standard (4th Edition), Addison-Wesley, 1997. Jim Melton and Alan R. Simon: Understanding the New SQL: A Complete Guide (2nd Edition, Dec 2000), The Morgan Kaufmann Series in Data Management Systems, 2000. 1 revised Version 1.01, January 2000, Michael Gertz, Copyright 2000. Contents 1. SQL – Structured Query Language 1.1. Tables 1.2. Queries (Part I) 1.3. Data Definition...

Words: 21631 - Pages: 87

Premium Essay

Docs

...Performance and Cost Evaluation of an Adaptive Encryption Architecture for Cloud Databases Abstract: The cloud database as a service is a novel paradigm that can support several Internet-based applications, but its adoption requires the solution of information confidentiality problems. We propose a novel architecture for adaptive encryption of public cloud databases that offers an interesting alternative to the tradeoff between the required data confidentiality level and the flexibility of the cloud database structures at design time. We demonstrate the feasibility and performance of the proposed solution through a software prototype. Moreover, we propose an original cost model that is oriented to the evaluation of cloud database services in plain and encrypted instances and that takes into account the variability of cloud prices and tenant workloads during a medium-term period. KEYWORDS: Cloud database, confidentiality, encryption, adaptivity, cost model. LIST OF CONTENTS Page No List of Figures viii List of Tables ix 1. Introduction 1.1 Purpose 1.2 Scope 1.3 Motivation 1.3.1 Definitions 1.3.2 Abbreviations 1.3.3 Model Diagrams 1.4 Overview 2. Literature Survey 2.1 Introduction 2.2 History ...

Words: 17343 - Pages: 70

Premium Essay

Tools for Business

...conduct a general study of Business Intelligence and BI systems followed by a comparison of Cognos 8 BI, Microsoft BI and SAP BW/NetWeaver. The goal was to distinguish similarities and differences between the tools regarding technique, cost, usability and educational need and to provide a mapping for different customer situations. The method consisted of a theoretical study followed by a practical part including development, testing and interviews. The comparison showed that SAP and Microsoft both use the client/server model while Cognos is an integrated web-based system built on SOA. SQL Server can only be installed on Windows while BW and Cognos also support UNIX, Linux and IBM. SSRS report formats are HTML, PDF, CSV, XML, TIFF, Word and Excel. In BW, query results can be viewed as HTML, CSV and Excel. Cognos report formats are HTML, PDF, CSV, XML and Excel. The educational need for SQL Server and Cognos is low and may often be solved internally or through e-learning. In contrast, BW uses its own terminology and the enhanced star schema,...

Words: 25350 - Pages: 102

Premium Essay

Asignment

...Oracle® Database Concepts 10g Release 2 (10.2) B14220-02 October 2005 Oracle Database Concepts, 10g Release 2 (10.2) B14220-02 Copyright © 1993, 2005, Oracle. All rights reserved. Primary Author: Michele Cyran Contributing Author: Paul Lane, JP Polk Contributor: Omar Alonso, Penny Avril, Hermann Baer, Sandeepan Banerjee, Mark Bauer, Bill Bridge, Sandra Cheevers, Carol Colrain, Vira Goorah, Mike Hartstein, John Haydu, Wei Hu, Ramkumar Krishnan, Vasudha Krishnaswamy, Bill Lee, Bryn Llewellyn, Rich Long, Diana Lorentz, Paul Manning, Valarie Moore, Mughees Minhas, Gopal Mulagund, Muthu Olagappan, Jennifer Polk, Kathy Rich, John Russell, Viv Schupmann, Bob Thome, Randy Urbano, Michael Verheij, Ron Weiss, Steve Wertheimer The Programs (which include both the software and documentation) contain proprietary information; they are provided under a license agreement containing restrictions on use and disclosure and are also protected by copyright, patent, and other intellectual and industrial property laws. Reverse engineering, disassembly, or decompilation of the Programs, except to the extent required to obtain interoperability with other independently created software or as specified by law, is prohibited. The information contained in this document is subject to change without notice. If you find any problems in the documentation, please report them to us in writing. This document is not warranted to be error-free. Except as may be expressly permitted in your license agreement...

Words: 199783 - Pages: 800

Free Essay

Dsfsd

...network storage system in today’s world. Also, nowadays the files are stored over the network. This system provides an easy way to retrieve any file which is stored over the network. The IP address of any system which is connected to the network can be found out just by selecting the name of the system. Therefore the range of IP address where the search has to be done can be found by that. The required file can be searched easily when this IP address range is known. The name of the file to be searched is given as input. If possible the file format is also given along with it. The IP address range where the search has to be performed is also selected. If there is any particular system outside that particular range they also can be selected for search operation to be performed. The search is done in each working and connected system in the shared drive and the search results are displayed in the grid view which is the output. The file can be accessed just by clicking the result that appears. Thus this provides a easy way to search a file over a number of systems connected to a network simultaneously. Thus it is very effective since the search is done in a number of systems simultaneously. CHAPTER 2 LITERATURE REVIEW 2. LITERATURE REVIEW 2.1 Existing System: When a particular file has to be searched which is stored in another system connected over network, the IP address of the system...

Words: 4829 - Pages: 20