Dynamic SQL Example declare l_depnam varchar2(20) := 'testing'; l_loc varchar2(10) := 'Dubai'; begin execute immediate 'insert into dept values (:1,:2,:3)'

Slides:



Advertisements
Similar presentations
Migrations v2 Source Target. VersionScript 1… 2… Migrations v2 Source Target VersionScript 1… 2… 3… 4…
Advertisements

PL/SQL. Introduction to PL/SQL PL/SQL is the procedure extension to Oracle SQL. It is used to access an Oracle database from various environments (e.g.
April 14, 2004 Next Information Systems 1 Bulk Collections and Inserts in Oracle 9i & 10g Simay Alpöge Next Information Systems, Inc.
CS 31003: Compilers ANIRUDDHA GUPTA 11CS10004 G2 CLASS DATE : 24/07/2013.
AGGREGATE FUNCTIONS Prof. Sin-Min Lee Surya Bhagvat CS 157A – Fall 2005.
Toward Online Schema Evolution for Non-Stop Systems Amol Deshpande, University of Maryland Michael Hicks, University of Maryland.
Table maintenance revisited (again) Please use speaker notes for additional information!
Module 2: Using Transact-SQL Querying Tools. Overview SQL Query Analyzer Using the Object Browser Tool in SQL Query Analyzer Using Templates in SQL Query.
Jump-Start Embedded SQL into RPG Presented by: Robert Arce.
PL/SQL. Обработка исключительных ситуаций EXCEPTION WHEN имя_исключительной_ситуации1 THEN последовательность_операторов1; WHEN имя_исключительной_ситуации2.
Session Title: Using SQL and PL/SQL for Queries and Reporting Presented By: Stephen Frederic Institution: IHL September 16, 2013.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
PL/SQL and the Table API. Benefits of Server-Side Code Speedy Pizza MENU NAPOLITAINE PIZZA Reduced network traffic Maintainability Data integrity Triggers.
Agenda Journalling More Embedded SQL. Journalling.
Java Database Connectivity (JDBC) Introduction to JDBC JDBC is a simple API for connecting from Java applications to multiple databases. Lets you smoothly.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 11 Introduction to Dynamic SQL and Object Technology.
Unicode Oddity. from a Unicode PeopleSoft Database SELECT emplid, name, LENGTH(name), BLENGTH(name) FROMps_personal_data WHEREemplid = '007’ ; EMPLID.
Copyright  Oracle Corporation, All rights reserved. 3 Creating Procedures.
Lecture 4 PL/SQL language. PL/SQL – procedural SQL Allows combining procedural and SQL code PL/SQL code is compiled, including SQL commands PL/SQL code.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 DB2 9 Fundamentals.
Records Oracle Database PL/SQL 10g Programming Chapter 5.
Procedure Function Trigger. create table employee ( id number, name varchar2(100), deptno number, salary float, primary key(id) ) create table deptincrease.
PL SQL Block Structures. What is PL SQL A good way to get acquainted with PL/SQL is to look at a sample program. PL/SQL combines the data manipulating.
Database Management COP4540, SCS, FIU Constraints and security in SQL (Ch. 8.6, Ch22.2)
In Oracle.  A PL/SQL block stored in the database and fired in response to a specified event ◦ DML statements : insert, update, delete ◦ DDL statements.
Session Title: Using SQL and PL/SQL for Queries and Reporting Presented By: Stephen Frederic Institution: IHL September 16, 2014.
10-1 Copyright  Oracle Corporation, All rights reserved. Database Objects ObjectDescription TableBasic unit of storage; composed of rows and columns.
Stored Procedures Week 9. Test Details Stored Procedures SQL can call code written in iSeries High Level Languages –Called stored procedures SQL has.
Programmatic SQL Shaista Khan CS 157B. Topic Embedded SQL statements in high-level programming languages.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Dynamic SQL Oracle Database PL/SQL 10g Programming Chapter 13.
Copyright  Oracle Corporation, All rights reserved. 18 Interacting with the Oracle Server.
CMPE 226 Database Systems October 7 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
Constraints and Triggers. What’s IC? Integrity Constraints define the valid states of SQL-data by constraining the values in the base tables. –Restrictions.
Kansas State University Department of Computing and Information Sciences CIS 560: Database System Concepts Thursday, September 13, 2000 “Structured Query.
1 Handling Exceptions Part F. 2 Handling Exceptions with PL/SQL What is an exception? Identifier in PL/SQL that is raised during execution What is an.
Dynamic SQL. 2 home back first prev next last What Will I Learn? Recall the stages through which all SQL statements pass Describe the reasons for using.
Polymorphism What is it, why it is needed? Dynamic binding Sorting and searching.
Retrieving Data in PL/SQL. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –Recognize the SQL statements that can.
PL/SQL programming Procedures and Cursors Lecture 1 [Part 2]
Oracle & SQL. Oracle Data Types Character Data Types: Char(2) Varchar (20) Clob: large character string as long as 4GB Bolb and bfile: large amount of.
Introduction to PL/SQL Francis Thottungal. The outline The basic PL/SQL code structure is : DECLARE -- optional, which declares and define variables,
الفصل السادس لغة Structured Query Language) SQL الفصل السادس لغة Structured Query Language) SQL.
Slide 1 Insert your own content.. Slide 2 Insert your own content.
6 Copyright © 2009, Oracle. All rights reserved. Using Dynamic SQL.
Chapter 2 Anonymous Block
Constraints and Triggers
SQL-lab Download sql script file sailors.txt
Interacting with the Oracle Server
CS122B: Projects in Databases and Web Applications Spring 2017
CS122B: Projects in Databases and Web Applications Winter 2017
Week 7 March 8 SQL: Chronological Sort, SUBSTRing, ROUND
أنماط الإدارة المدرسية وتفويض السلطة الدكتور أشرف الصايغ
Slide 1 Insert your own content.. Slide 1 Insert your own content.
Chapter 10 Oracle9i Developer: PL/SQL Programming
SQL Code for Byrnetube video
Slide 1 Insert your own content.. Slide 1 Insert your own content.
Slide 1 Insert your own content.. Slide 1 Insert your own content.
Modifying Jython Examples
Example Main: NL=1 P1: NL=2 P2: NL=3 P3: NL=2 offset var I, J; P1 var K, L; P2 var Q; Main: NL=1 P1: NL=2 NL=3 use.
Test Process “V” Diagram
Triggers.
Build on-the-fly reporting with Dynamic SQL
Dynamic SQL Konstantin Osipov, MySQL AB.
Insert Author Names; Author Names
Database Programming Using Oracle 11g
SQL NOT NULL Constraint
SQL AUTO INCREMENT Field
Joanna Wolthuis Be a Dynamic SQL Dynamo!.
Practice Project Practice to know SQL
Presentation transcript:

Dynamic SQL Example declare l_depnam varchar2(20) := 'testing'; l_loc varchar2(10) := 'Dubai'; begin execute immediate 'insert into dept values (:1,:2,:3)' using 50, l_depnam, l_loc; commit; end;

Dynamic SQL Example 2 declare l_depnam varchar2(20) := 'testing'; l_loc varchar2(10) := 'Dubai'; begin execute immediate 'insert into dept values (‘ || 50 || ‘, ‘ || l_depnam || ‘, ‘ || l_loc || ‘)‘ ; commit; end;

Static SQL Example declare l_depnam varchar2(20) := 'testing'; l_loc varchar2(10) := 'Dubai'; begin INSERT INTO dept VALUES (50, l_depnam, l_loc); commit; end;