PL/SQL is an extension of SQL that allows procedural logic to be added to SQL statements and queries. Key features of PL/SQL include blocks, exceptions, cursors, procedures, functions, packages, and triggers. A PL/SQL block contains a declare section to define variables, an executable section to contain program logic, and an optional exception section. Exceptions can be predefined, non-predefined, or user-defined. The document provides examples of handling different types of exceptions within PL/SQL blocks to avoid abnormal program termination.
The document discusses Ruby virtual machines and optimizations. It covers topics like Ruby VM internals, system resources, Ruby optimizations like constant folding and inlining, object structures, classes and modules, method dispatch, garbage collection. The goal is to understand tools and techniques for building high performance Ruby applications.
This document contains summaries of key concepts in digital system design and hardware description languages:
1) It introduces MATLAB, Scilab, Octave tools and basic MATLAB syntax for digital system design. It also provides an example function for peak detection in signals.
2) It covers the basics of Verilog HDL syntax including modules, ports, data types, assignments, always blocks, case statements and finite state machines. It provides examples of basic Verilog code structure.
3) It briefly mentions the Quartus Prime lite edition and ModelSim tools before concluding with an introduction to MATLAB HDL.
Bit manipulation in atmel studio for AVRPham Hoang
Â
The document discusses using bitwise operators like OR (|) and AND (&) to set and clear individual bits in registers. It explains how to use the _BV() macro to make bit manipulation code more readable by representing single bits as bit masks. Examples are given of using bitwise operators and _BV() to set, clear, and toggle single bits as well as multiple non-contiguous bits in registers like PORTC.
CJPCCS BCA VISNAGAR functions in C languageFCSCJCS
Â
A function is a named, independent section of C code that performs a specific task. Functions allow programmers to break programs into smaller, reusable pieces of code. Functions may receive input parameters, perform some processing, and return an output value. When a function is called, its parameters are pushed onto the stack and the function code is executed. Upon returning, the stack frame is removed and the program counter returns to the calling location. Functions improve code organization and allow code reuse through modular programming.
This document discusses properties in C#. It explains that properties are made up of getter and setter methods rather than being stored in memory like variables. Properties allow executing code when getting or setting a value. The document provides examples of creating properties with getters only, setters only, and both getters and setters. It also discusses errors that can occur, such as not having any accessors, having multiple definitions for the same property name, or having a property and variable with the same name. The document explains that properties can be static like variables.
1) An assembler translates programs written in assembly language to machine code by translating mnemonic codes to machine code and symbols to addresses. It handles constants, literals, and addressing.
2) An assembler uses two passes. The first pass assigns addresses to lines of code and saves symbol addresses. The second pass translates opcodes, replaces symbols with addresses, and produces the object program.
3) Data structures used include an opcode table for translation, a symbol table for storing and looking up symbol addresses, and a literal table for handling literals.
The document discusses assemblers and their functions. It describes how assemblers translate mnemonic operation codes to machine language equivalents, assign addresses to symbolic labels, and handle forward references. The document also discusses two-pass assemblers, the data structures they use like the operation table and symbol table, and machine-dependent and independent features of assemblers.
Continuations allow saving and restoring the execution context of a program, enabling time travel capabilities to pause execution and resume it later from the saved point; continuation passing style converts programs to pass continuations as arguments rather than returning values from functions; delimited continuations provide a more controlled way to capture partial continuations up to a defined boundary rather than the entire remaining computation.
The document discusses Ruby virtual machines and optimizations. It covers topics like Ruby VM internals, system resources, Ruby optimizations like constant folding and inlining, object structures, classes and modules, method dispatch, garbage collection. The goal is to understand tools and techniques for building high performance Ruby applications.
This document contains summaries of key concepts in digital system design and hardware description languages:
1) It introduces MATLAB, Scilab, Octave tools and basic MATLAB syntax for digital system design. It also provides an example function for peak detection in signals.
2) It covers the basics of Verilog HDL syntax including modules, ports, data types, assignments, always blocks, case statements and finite state machines. It provides examples of basic Verilog code structure.
3) It briefly mentions the Quartus Prime lite edition and ModelSim tools before concluding with an introduction to MATLAB HDL.
Bit manipulation in atmel studio for AVRPham Hoang
Â
The document discusses using bitwise operators like OR (|) and AND (&) to set and clear individual bits in registers. It explains how to use the _BV() macro to make bit manipulation code more readable by representing single bits as bit masks. Examples are given of using bitwise operators and _BV() to set, clear, and toggle single bits as well as multiple non-contiguous bits in registers like PORTC.
CJPCCS BCA VISNAGAR functions in C languageFCSCJCS
Â
A function is a named, independent section of C code that performs a specific task. Functions allow programmers to break programs into smaller, reusable pieces of code. Functions may receive input parameters, perform some processing, and return an output value. When a function is called, its parameters are pushed onto the stack and the function code is executed. Upon returning, the stack frame is removed and the program counter returns to the calling location. Functions improve code organization and allow code reuse through modular programming.
This document discusses properties in C#. It explains that properties are made up of getter and setter methods rather than being stored in memory like variables. Properties allow executing code when getting or setting a value. The document provides examples of creating properties with getters only, setters only, and both getters and setters. It also discusses errors that can occur, such as not having any accessors, having multiple definitions for the same property name, or having a property and variable with the same name. The document explains that properties can be static like variables.
1) An assembler translates programs written in assembly language to machine code by translating mnemonic codes to machine code and symbols to addresses. It handles constants, literals, and addressing.
2) An assembler uses two passes. The first pass assigns addresses to lines of code and saves symbol addresses. The second pass translates opcodes, replaces symbols with addresses, and produces the object program.
3) Data structures used include an opcode table for translation, a symbol table for storing and looking up symbol addresses, and a literal table for handling literals.
The document discusses assemblers and their functions. It describes how assemblers translate mnemonic operation codes to machine language equivalents, assign addresses to symbolic labels, and handle forward references. The document also discusses two-pass assemblers, the data structures they use like the operation table and symbol table, and machine-dependent and independent features of assemblers.
Continuations allow saving and restoring the execution context of a program, enabling time travel capabilities to pause execution and resume it later from the saved point; continuation passing style converts programs to pass continuations as arguments rather than returning values from functions; delimited continuations provide a more controlled way to capture partial continuations up to a defined boundary rather than the entire remaining computation.
This document describes the basic functions of an assembler including translating mnemonic operation codes to machine language equivalents, assigning addresses to symbolic labels, and building properly formatted machine instructions. It provides examples of assembly language code and discusses machine-dependent features like instruction formats and addressing modes as well as machine-independent features such as literals, symbol definitions, and program structure.
Here are the key differences between CALL and INVOKE in x86 assembly:
- CALL is used to call a procedure without passing any parameters, while INVOKE allows passing parameters to procedures.
- When using CALL, any parameters need to be passed via registers or stack before the CALL. INVOKE handles pushing parameters onto the stack.
- A procedure called with CALL must pop its own parameters from the stack after the call, while a procedure called with INVOKE has the parameters automatically popped from the stack.
- INVOKE provides a simpler, higher-level way of calling procedures that mimics function calls in high-level languages by automatically handling parameter passing via the stack. CALL requires manually handling the
SSAdaP 1989 DECUS Europe Symposium Jan HolyJan Holy
Â
SSAdaP is a programming environment for creating, compiling, linking, and debugging Ada programs. It supports multiple hosts and targets. Versions currently exist for VAX/VMS and IBM mainframes, with UNIX versions under development. SSAdaP aims to implement the full Ada language specification and avoid restrictions. It provides features like separate compilation, configuration management, and a symbolic debugger. The system was developed in Hungary and Czechoslovakia to provide a full Ada implementation for Eastern Europe.
This document compares common commands between Cisco and Huawei networking devices. It lists equivalent commands such as "traceroute" and "tracert" for path tracing, "show version" and "display version" to view device information, and configuration commands like "configure terminal" and "system-view" to enter configuration mode. The document provides a mapping of many common show, debug, clear, and configuration commands between the two vendor platforms.
Control structures in C++ allow programs to conditionally execute code or repeat code in loops. The if/else statement executes code based on a condition being true or false. A while loop repeats a statement as long as a condition is true. A do/while loop repeats a statement first, then checks a condition to repeat. A for loop initializes a counter, checks a condition, and increments the counter on each iteration while the condition is true. Break and continue can prematurely exit or skip iterations in loops.
Asterisk: PVS-Studio Takes Up TelephonyAndrey Karpov
Â
Asterisk is a software implementation of a telephone private branch exchange (PBX); it was created in 1999 by Mark Spencer of Digium. Like any PBX, it allows attached telephones to make calls to one another, and to connect to other telephone services, such as the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services. Its name comes from the asterisk symbol, *.
Asterisk is released under a dual license model, using the GNU General Public License (GPL) as a free software license and a proprietary software license to permit licensees to distribute proprietary, unpublished system components.
In this article, we are going to discuss the results of the check of the Asterisk project by PVS-Studio 5.18.
The project seems to be regularly checked by the Coverity analyzer, which is indicated by comments like this one:
/* Ignore check_return warning from Coverity for ast_exists_extension below */
However, I still found some disappointing typos in the code. Let's try to figure them out as well as other potential issues. The source code was downloaded from the project's SVN repository.
PL/SQL is a procedural language designed specifically to embrace SQL statements within its syntax. PL/SQL program units are compiled by the Oracle Database server and stored inside the database.
This document provides information on PL/SQL programming language concepts. Some key points:
- PL/SQL allows defining logic blocks that can execute SQL and PL/SQL statements. Blocks have optional declaration, executable, and exception sections.
- PL/SQL supports variables, conditional statements like IF/CASE, and looping with LOOP/WHILE/FOR. Variables can be bound to table columns using %TYPE.
- Cursors allow processing multiple database records in PL/SQL. Explicit cursors are declared and opened/fetched/closed manually while implicit cursors are used for single record queries.
- Parameter cursors can accept parameters. Nested cursors allow querying related data. Cursors
This document provides information on PL/SQL programming language concepts including:
- PL/SQL allows defining logic using variables, conditional statements, loops, and object-oriented programming.
- Code is organized into blocks with declaration, executable, and exception sections.
- Variables can be declared and assigned values. Data types include numbers, strings, records, and collections.
- Conditional statements like IF-THEN-ELSE and CASE support different execution paths.
- Loops like simple, while, and for are used to iterate.
- Cursors access and process multiple database records in PL/SQL blocks.
What is PL/SQL
Procedural Language – SQL
An extension to SQL with design features of programming languages (procedural and object oriented)
PL/SQL and Java are both supported as internal host languages within Oracle products.
PL/SQL is a database-oriented programming language that extends SQL with procedural capabilities like condition checking, looping, and branching. It allows programmers to handle errors and display user-friendly error messages. PL/SQL code is organized into declarative regions, and it can define variables, constants, cursors, procedures, and functions. Cursors are used to process result sets from a SQL query row by row.
Abstract: Developers - If you are not using Bulk Binds you are not writing PL/SQL efficiently!
Bulk binding has been around for a long time, yet there are sites out there that don't utilise this feature to its full extent, if at all. Every release of Oracle improves on this functionality so obviously it's a topic worthy of consistent awareness.
In PL/SQL and SQL, there are a few nifty features related to bulk binding you may not have seen - it's not all about BULK COLLECT. Whether you're on 8i, 11g or anything in between, you'll benefit from the concepts described in this seminar and become a Bulk Binding Baron!
Exceptions Triggers function in SQL by Vasant Bhabadvasant Bhabad
Â
Exceptions in PL/SQL refer to error conditions that occur during program execution. PL/SQL supports catching exceptions using an EXCEPTION block to handle the error. There are system-defined and user-defined exceptions. Common system exceptions include ZERO_DIVIDE for division by zero and NO_DATA_FOUND if a query returns no rows. Functions and procedures use EXCEPTION blocks to catch and handle errors. Database triggers allow PL/SQL code to automatically execute in response to INSERT, UPDATE, or DELETE statements on a table.
PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, Times Ten in-memory database, and IBM DB 2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.
Oracle 11g new features for developersScott Wesley
Â
Abstract: There are a wealth of new features available in the 11g database release. This presentation touches on SQL & PL/SQL features I found of interest, and concentrates particularly on virtual columns.
Relevant scripts found at my blog
http://grassroots-oracle.com/2009/07/presentations.html#11gNewFeatures
The document outlines a course on problem solving with computers that covers topics like control structures, functions, pointers, object-oriented programming, inheritance, and managing console I/O operations across 5 modules taught over a period of 30 contact hours from April 13th to May 1st, with tests, assignments, and a final exam comprising the total course assessment of 60 marks plus a final exam worth 40 additional marks.
The document outlines a course on problem solving with computers that covers topics like control structures, functions, pointers, object-oriented programming, inheritance, and managing console I/O operations across 5 modules taught over a period of 30 contact hours from April 13th to May 1st, with tests, assignments, and a final exam comprising the assessment. It discusses different programming constructs like sequences, selections, loops, and decisions that form the basis of writing computer programs to solve problems. The document also provides examples of code snippets to demonstrate printing output, taking user input, and performing basic arithmetic operations like addition in C++.
The document discusses different loop structures in C++ including the for loop, do-while loop, and while loop. It provides examples of how to write each type of loop and explains the differences between them. The for loop has initialization, test, and update expressions that control the loop iterations. The do-while loop first executes the body and then evaluates the test expression, so it always runs at least once. Both for and while loops check the test expression before executing the body.
The document discusses iterative statements in C++. It introduces the for loop as one type of iterative statement that allows repetitive execution of a block of code. The for loop syntax includes an initialization statement, condition, and increment/decrement statement. Examples are provided to illustrate calculating sums and factorials using for loops. Infinite for loops and auto increment/decrement operators are also described.
This document describes the basic functions of an assembler including translating mnemonic operation codes to machine language equivalents, assigning addresses to symbolic labels, and building properly formatted machine instructions. It provides examples of assembly language code and discusses machine-dependent features like instruction formats and addressing modes as well as machine-independent features such as literals, symbol definitions, and program structure.
Here are the key differences between CALL and INVOKE in x86 assembly:
- CALL is used to call a procedure without passing any parameters, while INVOKE allows passing parameters to procedures.
- When using CALL, any parameters need to be passed via registers or stack before the CALL. INVOKE handles pushing parameters onto the stack.
- A procedure called with CALL must pop its own parameters from the stack after the call, while a procedure called with INVOKE has the parameters automatically popped from the stack.
- INVOKE provides a simpler, higher-level way of calling procedures that mimics function calls in high-level languages by automatically handling parameter passing via the stack. CALL requires manually handling the
SSAdaP 1989 DECUS Europe Symposium Jan HolyJan Holy
Â
SSAdaP is a programming environment for creating, compiling, linking, and debugging Ada programs. It supports multiple hosts and targets. Versions currently exist for VAX/VMS and IBM mainframes, with UNIX versions under development. SSAdaP aims to implement the full Ada language specification and avoid restrictions. It provides features like separate compilation, configuration management, and a symbolic debugger. The system was developed in Hungary and Czechoslovakia to provide a full Ada implementation for Eastern Europe.
This document compares common commands between Cisco and Huawei networking devices. It lists equivalent commands such as "traceroute" and "tracert" for path tracing, "show version" and "display version" to view device information, and configuration commands like "configure terminal" and "system-view" to enter configuration mode. The document provides a mapping of many common show, debug, clear, and configuration commands between the two vendor platforms.
Control structures in C++ allow programs to conditionally execute code or repeat code in loops. The if/else statement executes code based on a condition being true or false. A while loop repeats a statement as long as a condition is true. A do/while loop repeats a statement first, then checks a condition to repeat. A for loop initializes a counter, checks a condition, and increments the counter on each iteration while the condition is true. Break and continue can prematurely exit or skip iterations in loops.
Asterisk: PVS-Studio Takes Up TelephonyAndrey Karpov
Â
Asterisk is a software implementation of a telephone private branch exchange (PBX); it was created in 1999 by Mark Spencer of Digium. Like any PBX, it allows attached telephones to make calls to one another, and to connect to other telephone services, such as the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services. Its name comes from the asterisk symbol, *.
Asterisk is released under a dual license model, using the GNU General Public License (GPL) as a free software license and a proprietary software license to permit licensees to distribute proprietary, unpublished system components.
In this article, we are going to discuss the results of the check of the Asterisk project by PVS-Studio 5.18.
The project seems to be regularly checked by the Coverity analyzer, which is indicated by comments like this one:
/* Ignore check_return warning from Coverity for ast_exists_extension below */
However, I still found some disappointing typos in the code. Let's try to figure them out as well as other potential issues. The source code was downloaded from the project's SVN repository.
PL/SQL is a procedural language designed specifically to embrace SQL statements within its syntax. PL/SQL program units are compiled by the Oracle Database server and stored inside the database.
This document provides information on PL/SQL programming language concepts. Some key points:
- PL/SQL allows defining logic blocks that can execute SQL and PL/SQL statements. Blocks have optional declaration, executable, and exception sections.
- PL/SQL supports variables, conditional statements like IF/CASE, and looping with LOOP/WHILE/FOR. Variables can be bound to table columns using %TYPE.
- Cursors allow processing multiple database records in PL/SQL. Explicit cursors are declared and opened/fetched/closed manually while implicit cursors are used for single record queries.
- Parameter cursors can accept parameters. Nested cursors allow querying related data. Cursors
This document provides information on PL/SQL programming language concepts including:
- PL/SQL allows defining logic using variables, conditional statements, loops, and object-oriented programming.
- Code is organized into blocks with declaration, executable, and exception sections.
- Variables can be declared and assigned values. Data types include numbers, strings, records, and collections.
- Conditional statements like IF-THEN-ELSE and CASE support different execution paths.
- Loops like simple, while, and for are used to iterate.
- Cursors access and process multiple database records in PL/SQL blocks.
What is PL/SQL
Procedural Language – SQL
An extension to SQL with design features of programming languages (procedural and object oriented)
PL/SQL and Java are both supported as internal host languages within Oracle products.
PL/SQL is a database-oriented programming language that extends SQL with procedural capabilities like condition checking, looping, and branching. It allows programmers to handle errors and display user-friendly error messages. PL/SQL code is organized into declarative regions, and it can define variables, constants, cursors, procedures, and functions. Cursors are used to process result sets from a SQL query row by row.
Abstract: Developers - If you are not using Bulk Binds you are not writing PL/SQL efficiently!
Bulk binding has been around for a long time, yet there are sites out there that don't utilise this feature to its full extent, if at all. Every release of Oracle improves on this functionality so obviously it's a topic worthy of consistent awareness.
In PL/SQL and SQL, there are a few nifty features related to bulk binding you may not have seen - it's not all about BULK COLLECT. Whether you're on 8i, 11g or anything in between, you'll benefit from the concepts described in this seminar and become a Bulk Binding Baron!
Exceptions Triggers function in SQL by Vasant Bhabadvasant Bhabad
Â
Exceptions in PL/SQL refer to error conditions that occur during program execution. PL/SQL supports catching exceptions using an EXCEPTION block to handle the error. There are system-defined and user-defined exceptions. Common system exceptions include ZERO_DIVIDE for division by zero and NO_DATA_FOUND if a query returns no rows. Functions and procedures use EXCEPTION blocks to catch and handle errors. Database triggers allow PL/SQL code to automatically execute in response to INSERT, UPDATE, or DELETE statements on a table.
PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, Times Ten in-memory database, and IBM DB 2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.
Oracle 11g new features for developersScott Wesley
Â
Abstract: There are a wealth of new features available in the 11g database release. This presentation touches on SQL & PL/SQL features I found of interest, and concentrates particularly on virtual columns.
Relevant scripts found at my blog
http://grassroots-oracle.com/2009/07/presentations.html#11gNewFeatures
The document outlines a course on problem solving with computers that covers topics like control structures, functions, pointers, object-oriented programming, inheritance, and managing console I/O operations across 5 modules taught over a period of 30 contact hours from April 13th to May 1st, with tests, assignments, and a final exam comprising the total course assessment of 60 marks plus a final exam worth 40 additional marks.
The document outlines a course on problem solving with computers that covers topics like control structures, functions, pointers, object-oriented programming, inheritance, and managing console I/O operations across 5 modules taught over a period of 30 contact hours from April 13th to May 1st, with tests, assignments, and a final exam comprising the assessment. It discusses different programming constructs like sequences, selections, loops, and decisions that form the basis of writing computer programs to solve problems. The document also provides examples of code snippets to demonstrate printing output, taking user input, and performing basic arithmetic operations like addition in C++.
The document discusses different loop structures in C++ including the for loop, do-while loop, and while loop. It provides examples of how to write each type of loop and explains the differences between them. The for loop has initialization, test, and update expressions that control the loop iterations. The do-while loop first executes the body and then evaluates the test expression, so it always runs at least once. Both for and while loops check the test expression before executing the body.
The document discusses iterative statements in C++. It introduces the for loop as one type of iterative statement that allows repetitive execution of a block of code. The for loop syntax includes an initialization statement, condition, and increment/decrement statement. Examples are provided to illustrate calculating sums and factorials using for loops. Infinite for loops and auto increment/decrement operators are also described.
This document provides a disassembly and analysis of the 16K monitor program used in the Sinclair ZX Spectrum home computer. It is divided into several main parts, including input/output routines, the BASIC interpreter, and an expression handling component. The disassembly details the purpose and function of the various routines that make up these parts, such as routines for keyboard input, sound output, cassette handling, screen handling, and BASIC command interpretation. It also describes the mathematical functions and floating point arithmetic used in the system.
This document provides an overview of PL/SQL, including its benefits, basic structure and components, variable types, and examples of common programming constructs like if/else statements, loops, and cursors. PL/SQL allows developers to perform programming within Oracle databases, combining SQL statements with procedural programming elements like conditions and loops. It is useful for modularizing database applications and manipulating query results.
PL/SQL is a combination of SQL and procedural programming languages. It allows developers to perform operations like control flow statements, variable declarations, and exception handling. PL/SQL code is organized into blocks that contain a declarative part, an executable part, and an optional exception-handling part. Variables and other objects can be declared locally or globally depending on their scope. Control structures like IF-THEN-ELSE, CASE, and loops allow conditional and iterative execution. Procedures and functions can also be created to reuse code.
This document provides an introduction to PL/SQL, including PL/SQL block structure, data types, variables, control structures, and more. PL/SQL combines procedural language elements with SQL statements to enhance database programming capabilities. Key elements include DECLARE, BEGIN, and END sections in a PL/SQL block; data types like NUMBER, VARCHAR2, DATE; variables and constants; control structures like IF-THEN-ELSE; and functions for output.
The document provides information on control structures in C++ including relational operators, loops, and decisions. It discusses relational operators like ==, <, > that compare values and return true or false. It describes the three types of loops in C++ - for, while, and do-while loops. The for loop executes a fixed number of times based on initialization, test, and increment expressions. The while loop repeats while a test condition is true. The do-while loop executes the body at least once and then repeats while the test condition is true. The document also covers the if statement for simple conditions and if-else for alternative paths, and provides code examples to demonstrate each control structure.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Â
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
Â
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
Â
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Tatiana Kojar
Â
Skybuffer AI, built on the robust SAP Business Technology Platform (SAP BTP), is the latest and most advanced version of our AI development, reaffirming our commitment to delivering top-tier AI solutions. Skybuffer AI harnesses all the innovative capabilities of the SAP BTP in the AI domain, from Conversational AI to cutting-edge Generative AI and Retrieval-Augmented Generation (RAG). It also helps SAP customers safeguard their investments into SAP Conversational AI and ensure a seamless, one-click transition to SAP Business AI.
With Skybuffer AI, various AI models can be integrated into a single communication channel such as Microsoft Teams. This integration empowers business users with insights drawn from SAP backend systems, enterprise documents, and the expansive knowledge of Generative AI. And the best part of it is that it is all managed through our intuitive no-code Action Server interface, requiring no extensive coding knowledge and making the advanced AI accessible to more users.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
Â
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Â
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Â
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Â
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
5th LF Energy Power Grid Model Meet-up SlidesDanBrown980551
Â
5th Power Grid Model Meet-up
It is with great pleasure that we extend to you an invitation to the 5th Power Grid Model Meet-up, scheduled for 6th June 2024. This event will adopt a hybrid format, allowing participants to join us either through an online Mircosoft Teams session or in person at TU/e located at Den Dolech 2, Eindhoven, Netherlands. The meet-up will be hosted by Eindhoven University of Technology (TU/e), a research university specializing in engineering science & technology.
Power Grid Model
The global energy transition is placing new and unprecedented demands on Distribution System Operators (DSOs). Alongside upgrades to grid capacity, processes such as digitization, capacity optimization, and congestion management are becoming vital for delivering reliable services.
Power Grid Model is an open source project from Linux Foundation Energy and provides a calculation engine that is increasingly essential for DSOs. It offers a standards-based foundation enabling real-time power systems analysis, simulations of electrical power grids, and sophisticated what-if analysis. In addition, it enables in-depth studies and analysis of the electrical power grid’s behavior and performance. This comprehensive model incorporates essential factors such as power generation capacity, electrical losses, voltage levels, power flows, and system stability.
Power Grid Model is currently being applied in a wide variety of use cases, including grid planning, expansion, reliability, and congestion studies. It can also help in analyzing the impact of renewable energy integration, assessing the effects of disturbances or faults, and developing strategies for grid control and optimization.
What to expect
For the upcoming meetup we are organizing, we have an exciting lineup of activities planned:
-Insightful presentations covering two practical applications of the Power Grid Model.
-An update on the latest advancements in Power Grid -Model technology during the first and second quarters of 2024.
-An interactive brainstorming session to discuss and propose new feature requests.
-An opportunity to connect with fellow Power Grid Model enthusiasts and users.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
Â
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Main news related to the CCS TSI 2023 (2023/1695)Jakub Marek
Â
An English 🇬🇧 translation of a presentation to the speech I gave about the main changes brought by CCS TSI 2023 at the biggest Czech conference on Communications and signalling systems on Railways, which was held in Clarion Hotel Olomouc from 7th to 9th November 2023 (konferenceszt.cz). Attended by around 500 participants and 200 on-line followers.
The original Czech 🇨🇿 version of the presentation can be found here: https://www.slideshare.net/slideshow/hlavni-novinky-souvisejici-s-ccs-tsi-2023-2023-1695/269688092 .
The videorecording (in Czech) from the presentation is available here: https://youtu.be/WzjJWm4IyPk?si=SImb06tuXGb30BEH .
Fueling AI with Great Data with Airbyte WebinarZilliz
Â
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Â
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und ĂĽberflĂĽssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Â
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Â
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Â
Oracle pl sql
1. PL/ SQL:
1. Introduction
2. Exceptions
3. Cursors
4. Procedures
5. Functions
6. Packages
7. Triggers
Introduction:-
1) What is Pl/SQL ?
It is extension to SQL language.
PL/SQL = SQL + Programming features.
The following are the advantages of PL/SQL
1) We can use programming features like If stmt, loops, branching etc;
2) We can have user definied error messages by using the concept of exception handling.
3) We can perform related actions by using the concept of triggers.
4) Pl/SQL helps in reducing the network traffic.
PL/SQL Block structure:
----------------------
declare
........... -- Declare section
...........
...........
begin
........... -- Executable section
..........
...........
...........
...........
exception
.......... -- Exception section
..........
end;
/
A Pl/SQL block contains 3 sections.
1) Declare section
2) Executable section
3) Exception Section
1) Declare section:
-------------------
2. It is used to declare local variables, Cursor , exceptions etc;. All the lines between declare and
begin is called declare section.This section is optional.
2) Executable Section:
----------------------------
The actual task which should be done is written in the executable section. All the lines between
Begin and exception keywords is called as Executable section.
This section is mandatory
3) Exception Section:
-----------------------
If an exception is raised in the executable section,
control enters into exception section.
All the lines between exception and end is called exception section. This section is optional.
Ex1:
----
Write a PL/SQL block to display 'Hello World'.
For this program, we do not need any local variables.
So, we can start the program by using keyword begin.
Before the running this program, we need to make the environment variable serveroutput to ON.
To command to make the serveroutput to ON]
SQL> Set serveroutput on
Begin
dbms_output.put_line('Hello World');
end;
/
Hello World
Pl/SQL procedure successfully completed.
Ex 2:
-------
Write a PL/SQL block to calculate sum of two numbers.
For this program, we need 3 variables, so we need declare section.
Syntax to declare variable:
----------------------------
<variable> <datatype>(size);
Declare
a number(3);
b number(3);
c number(4);
begin
a :=10;
3. b :=20;
c := a+b;
dbms_output.put_line ( ' The sum is ...'||c);
end;
/
The sum is ...30
Pl/SQL procedure successfully completed.
In the above program, there are two important points to learn.
i) := is assignment operator, which is used to assign value from the right hand side to the variable
in the left hand side.
ii) || (pipe) is concatenation operator.
We can initilize at the time of declaration.
declare
a number(3) :=10;
b number(3) :=20;
In the abvoe program, we have hard coded the value 10 and 20 in the program. Instead of hard
coding the value, we can accept the values from the user.
Ex 3:
---
Write a program to accept two values from the user and display its sum.
Declare
a number(3);
b number(3);
c number(4);
begin
a := &a;
b := &b;
c := a+b;
dbms_output.put_line('The sum is ...'||c);
end;
/
Enter a value for A:40
Enter a value for B:30
The sum is ...70
Pl/SQL procedure successfully completed.
Note: & operator is used to accept value from the user.
Ex 4:
------
Write a PL/SQL block to accept empno and increments his salary by 1000.
Note: To increment the salary (change the value) in a table, we need to use update command.
4. Declare
l_empno number(4);
begin
l_empno := &empno;
update emp set sal = sal+1000
where empno = l_empno;
end;
/
Enter a value for empno: 7900
Procedure successfully completed.
To make the above update command permanent, we can use commit after update command in
PL/SQL block.
ex:
---
Declare
l_empno number(4);
begin
l_empno := &empno;
update emp set sal = sal+1000
where empno = l_empno;
commit;
end;
/
Writing a select stmt in a PL/SQL Block:
-------------------------------------------
Write a pl/SQL block which accepts empno and display ename and salary.
As ename and sal are the values present in the emp table, to get those values we need to write a
select stmt.
Note: Every select stmt in a PL/SQL block should have into clause.
Declare
l_empno number(4);
l_ename varchar2(20);
l_sal number(5);
begin
l_empno := &empno;
select ename,sal into l_ename, l_sal from emp
where empno = l_empno;
dbms_output.put_line(l_ename||'....'||l_sal);
end;
/
5. Note:
--------
As the above select stmt selects two columns, we need two local variable to catch the value
returned by the select stmt.
Using %TYPE attribute:
------------------------
%TYPE attribute is used to declare the local variables.
Instead of hardcoding the datatype and size for local variable, we can use %TYPE attribute.
Ex:
l_ename varchar2(20); -- we are hard coding datatype and size
l_ename emp.ename%TYPE; --- The datatype of ename column
of emp table is applicable to the local variable.
The above program, i use %TYPE attribute to declare local variables.
Declare
l_empno emp.empno%TYPE;
l_ename emp.ename%TYPE;
l_sal emp.sal%TYPE;
begin
l_empno := &empno;
select ename,sal into l_ename, l_sal from emp
where empno = l_empno;
dbms_output.put_line(l_ename||'....'||l_sal);
end;
/
Using %ROWTYPE Attribute:
--------------------------
A ROWTYPE variable is capable of holding complete row
of table.
Ex:
------
Write a PL/SQL Block which accepts an empno and display ename, sal, hiredate and job.
declare
l_empno emp.empno%TYPE;
l_row emp%ROWTYPE;
begin
l_empno := &empno;
select * into l_row from emp
where empno = l_empno;
dbms_output.put_line(l_row.ename);
dbms_output.put_line(l_row.sal);
6. dbms_output.put_line(l_row.hiredate);
dbms_output.put_line(l_row.job);
end;
/
Note: we cannot print a ROWTYPE variable, we can print a value of a ROWTYPE variable.
Exceptions:-
1) What is Exception?
Every error in Oracle is an exception.
2) Types of exceptions?
Exceptions are divided into three types
1) Pre definied exceptions
2) NoN pre definied exceptions
3) User definied exceptions
Pre Definied Exceptions:
-----------------------------
These exceptions will have exception name and exception number.
The following are some of the examples of predefinied exceptions.
EXCEPTION_NAME EXCEPTION_NUMBER
1) NO_DATA_FOUND
2) TOO_MANY_ROWS
3) ZERO_DIVIDE
4) VALUE_ERROR
5) DUP_VAL_ON_INDEX
1) NO_DATA_FOUND :
------------------------
This exception is raised when select does not return any row in PL/SQL block.
ex:
---
declare
l_sal emp.sal%type;
begin
dbms_output.put_line('Welcome');
select sal into l_Sal from emp
where empno = 2255;
dbms_output.put_line('The sal is ....'||l_sal);
dbms_output.put_line('Thank You');
end;
/
Output:
---------
7. Welcome
error
Note: In the above program, we get the output 'Welcome'.
This means that program execution is started.
As we dont have any employee with empno 2255, select stmt does not return any row.
When select stmt does not return any row, NO_DATA_FOUND exception is raised.
Once an exception is raised, control will not execute the remaining stmts of executable section,
searches for Exception section.
As we do not have exception section in the program, it is terminated abnormally.
We can make sure that the program is completed normally by catching the exception using
Exception section.
Syntax:
----------
Declare
.........
.........
begin
........
........
.........
Exception
When <Exception_handler> then
....................
....................
end;
/
Ex:
---
declare
l_sal emp.sal%type;
begin
dbms_output.put_line('Welcome');
select sal into l_Sal from emp
where empno = 2255;
dbms_output.put_line('The sal is ....'||l_sal);
dbms_output.put_line('Thank You');
Exception
when NO_DATA_FOUND then
dbms_output.put_line('Invalid empno');
end;
/
8. Output:
------
Welcome
Invalid empno
Pl/SQL Procedure successfully completed.
2) TOO_MANY_ROWS:
----------------------
TOO_MANY_ROWS exception is raised, when select stmt returns more than one row.
Ex:
----
declare
l_sal emp.sal%type;
begin
dbms_output.put_line('Welcome');
select sal into l_Sal from emp
where deptno=10;
dbms_output.put_line('The sal is ....'||l_sal);
dbms_output.put_line('Thank You');
end;
/
Output:
-----------
Welcome
Error
Note:
---------
As we get the output 'Welcome', this means that program execution is started.
As the select stmt returns more than one row, TOO_MANY_ROWS exception is raised.
As we know, Once an exception is raised control will not execute the remaining lines of
excutable section, searches for the Exception section.
As we do not have exception section, program is terminated abnormally.
We can avoid abnormal termination of the program by catching the Exception.
Ex:
---
declare
l_sal emp.sal%type;
begin
9. dbms_output.put_line('Welcome');
select sal into l_Sal from emp
where deptno=10;
dbms_output.put_line('The sal is ....'||l_sal);
dbms_output.put_line('Thank You');
Exception
When TOO_MANY_ROWS then
dbms_output.put_line( 'Select stmt returns more than one row');
end;
/
Output:
--------
Welcome
Select stmt returns more than one row.
Pl/SQL Procedure successfully completed.
3) ZERO_DIVIDE:
-----------------
This exception is raised, when we divide a number by zero.
Ex:
----
Declare
a number(4);
begin
dbms_output.put_line('Welcome');
a := 10/0;
dbms_output.put_line(a);
dbms_output.put_line('Thank You');
end;
/
Output:
--------
Welcome
Error
Note:
------
In the above program, as we are dividing by zero, ZERO_DIVIDE exception is raised.
As we are not catching the exception, program is terminated abnormally.
As a developer, we need to make sure that programs are completed successfully at any case.
SO we need to handle exception which is raised by using the Exception Section.
Ex:
--------
10. Declare
a number(4);
begin
dbms_output.put_line('Welcome');
a := 10/0;
dbms_output.put_line(a);
dbms_output.put_line('Thank You');
Exception
When ZERO_DIVIDE then
dbms_output.put_line('DO not divide by 0');
end;
/
Output:
-------
Welcome
DO not divide by 0.
Pl/SQL Procedure successfully completed.
4) VALUE_ERROR:
-----------------------
This exception is raised, when the value which is returned does not match with the datatype
variable.
Ex:
-------
Declare
l_ename number(10);
begin
dbms_output.put_line('Welcome');
select ename into l_ename from emp
where empno = 7369;
dbms_output.put_line('The employee name is...'||l_ename);
end;
/
Output:
-------
Welcome
Error
Note:
--------
As the select stmt returning char value, it cannot be stored in varible of number data.
11. In this case VALUE_ERROR exception is raised.
As we are not catching the exception, program is terminated abnormally.
We can avoid abnormal termination of the program by catching the exception using Exception
Section.
Ex:
----
Declare
l_ename number(10);
begin
dbms_output.put_line('Welcome');
select ename into l_ename from emp
where empno = 7369;
dbms_output.put_line('The employee name is...'||l_ename);
Exception
when VALUE_ERROR then
dbms_output.put_line('Pl check the datatype of the local variables');
end;
/
Output:
--------
Welcome
Pl check the datatype of the local variables
5) DUP_VAL_ON_INDEX:
----------------------------------------
This exception is raised when we try to insert a dulicate value on a primary key or unique key.
ex:
--------
Create the following table:
create table student ( sno number(3) primary key,
sname varchar2(20),
marks number(3));
insert a row in the table:
insert into student values (101,'arun',40);
commit;
begin
dbms_output.put_line ( 'Welcome');
insert into student values (101,'vijay',50);
dbms_output.put_line ( 'Thank You');
end;
/
12. Output:
-----------
Welcome
Error
Note:
---------
As we are inserting a duplicate value in a primary key column, DUP_VAL_ON_INDEX
exception is raised. As we are not catching the exception program is terminated abnormally.
We can avoid abnormai termination of the program by catching the exception.
Ex:
-------
begin
dbms_output.put_line ( 'Welcome');
insert into student values (101,'vijay',50);
dbms_output.put_line ( 'Thank You');
Exception
when DUP_VAL_ON_INDEX then
dbms_output.put_line('Do not insert duplicate value in a primary key');
end;
/
Output:
-------------
Welcome
Do not insert duplicate value in a primary key
When Others handler:
---------------------------------
When others can handle any type of exception
Ex1:
--------
Declare
a number(4);
begin
dbms_output.put_line('Welcome');
a := 10/0;
dbms_output.put_line(a);
dbms_output.put_line('Thank You');
Exception
When others then
dbms_output.put_line('Pl check the code');
end;
/
13. Output:
-----------
Welcome
Pl check the code
Note:
Exception that is raised is ZERO_DIVIDE.
We do not have ZERO_DIVIDE handler, but When Others can handler can handle this
exception.
Ex2:
---------
declare
l_sal emp.sal%type;
begin
dbms_output.put_line('Welcome');
select sal into l_Sal from emp
where deptno=10;
dbms_output.put_line('The sal is ....'||l_sal);
dbms_output.put_line('Thank You');
Exception
When others then
dbms_output.put_line('Pl check the code');
end;
/
Output:
-------------
Welcome
Pl check the code
+++++++++++++++++++++++++++++++++++
Non predefinied exception:
-------------------------------------
These exceptions will have exceptio number , but does not have exception name.
Ex:
-------
ORA-2292 exception. This exception is raised when we try to delete from row from the parent
table if correspoding row exists in the child table.
First lets establish parent-child relationship between two tables.
create table student2( sno number(3) primary key,
sname varchar2(20),
marks number(3));
14. insert into student2 values (101, 'arun',40);
insert into student2 values (102, 'varun',50);
insert into student2 values (103, 'kiran',60);
create table library2 ( roll_no number(3) references student2(sno),
book_name varchar2(20));
insert into library2 values (101,'Java');
insert into library2 values (102,'C++');
insert into library2 values (102,'Oracle');
commit;
begin
dbms_output.put_line('Welcome');
delete from student2 where sno =101;
dbms_output.put_line('Thank You');
end;
/
Output:
-----------
Welcome
Error
Note: We are deleteting the row from the parent table and the corresponding row exists in the
child table. So exception is raised. The exception which is raised in the above program is ORA-
2292. This exception does not have any name. This is an example of non -predefinied exception.
The following steps are to followed to handle non-pre definied exception.
Step 1: Declare the exception
Step 2: Associate the exception
Step 3: Handle then exception.
Syntax:
-----------
Step 1: Declare the exception
<Exception_name> Exception;
Step 2: Associate the exception
raise_application_error ( <exception_no> , <Exception_name> );
Step 3: Handle the exception
Exception
When < Exceptionb_name> then
............
...........
............
end;
/
15. Ex:
---
In the follwoing program , we perform the three step process to handle Non-pre definied
exceptions.
Declare
MY_EX1 Exception;
Raise_application_error ( -2292 , MY_EX1 );
begin
dbms_output.put_line('Welcome');
delete from student2 where sno =101;
dbms_output.put_line('Thank You');
Exception
When MY_EX1 then
dbms_output.put_line('Cannot delete from the parent table');
end;
/
Output:
------------
Welcome
Cannot delete from the parent table
3) User definied exceptions:
--------------------------------
These exceptions are definied by the user.
Following steps are to be followed to handle user definied exceptions.
Step 1: Declare the exception
Step 2: Raise the exception
Step 3: Handle the exception.
Ex:
---
Declare
l_sal emp.sal%type;
my_ex1 exception;
begin
dbms_output.put_line('Welcome');
select sal into l_sal from emp
where empno =7902;
if l_sal > 2000 then
raise my_ex1;
end if;
dbms_output.put_line('The sal is ....'||l_sal);
16. Exception
When my_ex1 then
dbms_output.put_line(' Sal is too high');
When others then
dbms_output.put_line('Pl check the code');
end;
/
Output:
------------
Welcome
Sal is too high
Using raise_application_error:
------------------------------------------
raise_application_error is a procedure which is used to throw a user defined error error_number
and error_message to the application.
Ex:
------
Declare
l_sal emp.sal%type;
begin
dbns_output.put_line('Welcome');
select sal into l_sal from emp where empno = 7902;
if l_sal > 2000 then
raise_application_error ( -20150, ' Sal is too high');
end if;
dbms_output.put_line('The sal is ....'||l_sal);
end;
/
Ouptut:
----------
Welcome
ORA-20150 , Sal is too high
Error Reporting functions:
------------------------------------
Cursors:-
Cursor is a memory locations which is used to run SQL commands.
There are two types cursors
1) Implicit Cursors
2) Explicit Cursors
17. 1) Implicit Cursors:
----------------------------
All the activited related to cursor like i) Opening the cursor ii) Processing the data in the cursor
iii) closing the cursor
are done automatically.
Hence these cursors are called Implict cursors.
Implicit Cursor Attributes:
---------------------------------------
There are four Implicit cursor attributes
1) SQL%ISOPEN
2) SQL%FOUND
3) SQL%NOTFOUND
4) SQL%ROWCOUNT
1) SQL%ISOPEN:
--------------------------
It is a boolean attribute. It always returns false. It is not used in programming as it always returns
false.
2) SQL%FOUND:
-----------------------------
It is a boolean attribute.
Returns TRUE -- if the SQL command effects the data.
Returns FALSE -- if the SQL commands do not effect the data.
3) SQL%NOTFOUND:
--------------------------------
It is a boolean attribute
Returns TRUE -- if the SQL command do not effect the data.
Returns FALSE -- if the SQL command effects the data
Note: It is exactly negation to SQL%FOUND
4) SQL%ROWCOUNT:
-------------------------------
Returns no of rows effected by the SQL command.
Using SQL%FOUND:
-----------------------------
Begin
Update emp set sal=2000
where empno=1111;
end;
/
Output:
-------------
PL/SQL Procedure successfully completed.
By looking at the above message, we cannot know whether your update command is effecting
the data or not.
18. To overcome this problem, we have SQL%FOUND attribute.
Have a look at this program
Begin
Update emp set sal=2000
where empno=1111;
if SQL%FOUND then
dbms_output.put_line('Update is successfull');
else
dbms_output.put_line('Update is failed');
end if;
end;
/
Output:
------------
Update is failed.
PL/SQL Procedure successfully completed.
Using SQL%NOTFOUND:
------------------------------
SQL%NOTFOUND is exactly opposite to SQL%FOUND.
We rewrite the above program using SQL%NOTFOUND
Begin
Update emp set sal=2000
where empno=1111;
if SQL%NOTFOUND then
dbms_output.put_line('Update is failed');
else
dbms_output.put_line('Update is successful');
end if;
end;
/
Output:
------------
Update is failed.
PL/SQL Procedure successfully completed.
Using SQL%ROWCOUNT:
-----------------------------------
SQL%ROWCOUNT attribute is used to find the no of rows effected by SQL command.
begin
update emp set sal=2000
where deptno=10;
dbms_output.put_line(SQL%ROWCOUNT||' rows updated');
end;
/
19. Output:
-----------
3 rows updated.
Note: As a developer, we cannot control the implicit cursor.
We can you these implicit cursor attributes to know whether the command is effecting the data or
not.
Explicit Cursors:
-----------------------
Explicit cursors are used to run select stmt which returs more than one row in a PL/SQL block
Steps to use Explicit cursors:
------------------------------------
Step 1: Declare the cursor
Step 2: Open the cursor
Srep 3: Fetch the data from the cursor to the local variables
Step 4: close the cursor
Syntax of the above four steps:
-----------------------------------------------
Step 1: Declaring the cursor
cursor < cursor_name>
is < select stmt >;
step 2: Open the cursor
open < cursor_name >;
step 3: Fetch the data from the cursor to the local variables
fetch < cursor_name > into < var1 > , < var2> , ....., < varn >;;
step 4: close the cursor
close < cursor_name>;
Explicit cursor attributes:
----------------------------------
There are four explicit cursor attributes
1) %ISOPEN
2) %FOUND
3) %NOTFOUND
4) %ROWCOUNT
1) %ISOPEN:
--------------------
It is a boolean attribute.
Returns TRUE -- if the cursor is open
Returns FALSE -- if the cursor is closed
2) %FOUND:
------------------
20. It is a boolean attribute
Returns TRUE -- if the fetch stmt is successfull
Returns FALSE -- if the fetch stmt fails
3) %NOTFOUND:
--------------------------
It is boolean attribute
Returns TRUE -- if the fetch stmt fails.
Returns FALSE -- if the fetch stmt is successfull
Note: 1) It is exactly opposite to %FOUND attribute
2) This attribute is used to break the loop of the fetch stmt.
4) %ROWCOUNT:
---------------------------
Returns no of rows fetched by the fetch stmt.
Example of Explicit cursor:
-----------------------------------
Write a PL/SQL block to display ename and sal of employees working in deptno no
Declare
cursor c1
is select ename , sal from emp
where deptno=10;
l_ename emp.ename%type;
l_sal emp.sal%type;
begin
open c1;
loop
fetch c1 into l_ename , l_sal;
exit when c1%notfound;
dbms_output.put_line( l_ename||'....'||l_sal);
end loop;
close c1;
end;
/
Output:
------------
CLARK 2450
KING 5000
MILLER 1300
Pl/SQL Proceudure successfully completed.
Ex2: Write a PL/SQL procedure to display dname , loc from dept table
21. Declare
cursor c1
is select dname , loc from dept;
l_dname dept.dname%type;
l_loc dept.loc%type;
begin
open c1;
loop
fetch c1 into l_dname, l_loc;
exit when c1%notfound;
dbms_output.put_line(l_dname||'.....'||l_loc);
end loop;
close c1;
end;
/
Output:
--------------
Accounting New York
Research Dallas
Sales Chicago
Operations Boston
Pl/SQL Procedure successfully completed.
Cursor For loops:
------------------------
It is shortcut way of writing explicit cursors.
When we use cursor for loops , following steps are not required.
1) Open the cursor
2) Fetch stmt
3) exit when condition
4) closing the cursor
5) declaring the local variables
Ex:
----------
Write a PL/SQL block which display ename and sal of employees working in deptno 10
Declare
cursor c1
is select ename , sal from emp
where deptno=10;
begin
22. for emp_rec in c1 loop
dbms_output.put_line(emp_rec.ename||'.....'||emp_rec.sal);
end loop;
end;
/
Output:
--------------
CLARK 2450
KING 5000
MILLER 1300
Pl/SQL Proceudure successfully completed.
Note: In the above program emp_rec in implicitly declared record variable,
which is capable of storing one row of the cursor.
Procedures:-
A Procedure is a named PL/SQL block which is compiled and stored in the database for repeated
execution.
Basic Syntax :
------------
Create or replace procedure <procedure_name>
is
begin
..............
..............
.............
end;
/
Ex 1:
-----------
Create or replace procedure p1
is
begin
dbms_output.put_line('Hello World');
end;
/
Procedure created.
To execute the procedure:
----------------------------
Exec command is used to execute the procedure.
SQL> Exec p1
Hello World
A procedure can have three types of parameters.
1) IN Parameter
23. 2) OUT Parameter
3) IN OUT Parameter
In Parameters are used to accept values from the user.
Ex 2:
---------
Create a procedure which accepts two numbers and display its sum.
create or replace procedure add_num ( a IN number,
b IN number)
is
c number(3);
begin
c := a+b;
dbms_output.put_line(' The sum is '||c);
end;
/
Procedure created.
To execute the procedure:
--------------------------
SQL> exec add_num (10,20)
Ex 3:
--------
Create a Procedure which accepts an empno and increments his salary by 1000.
create or replace procedure inc_sal ( a in number)
is
begin
update emp set sal = sal+1000
where empno = a;
end;
/
Procedure created.
TO execute the procedure:
---------------------------
SQL> exec inc_sal(7900)
We can improve the above procedure code by using %type attribute in procedure parameters.
The above procedure can be re-written as below :
create or replace procedure inc_sal ( a in emp.empno%type)
is
begin
update emp set sal = sal+1000
where empno = a;
24. end;
/
Ex 4:
-------
Create a procedure which accepts empno and display ename and salary.
create or replace procedure display_emp ( l_empno emp.empno%type)
is
l_ename emp.ename%type;
l_sal emp.sal%type;
begin
select ename, sal into l_ename,l_sal from emp
where empno = l_empno;
dbms_output.put_line(l_ename||'....'||l_sal);
exception
when no_data_found then
dbms_output.put_line('Invalid empno');
end;
/
Ex 5:
--------
Create a procedure which accepts deptno and display ename and salary of employees working in
that department.
create or replace procedure display_emp1 (l_deptno emp.deptno%type)
is
cursor c1
is select ename,sal from emp
where deptno = l_deptno;
begin
for emp_rec in c1 loop
dbms_output.put_line(emp_rec.ename||'...'||emp_rec.sal);
end loop;
end;
Ex 6:
--------
We can call a procedure from another procedure.
create or replace procedure demo1
is
begin
dbms_output.put_line('This is from demo1');
end;
/
25. create or replace procedure demo2
is
begin
dbms_output.put_line ('Welcome');
demo1;
dbms_output.put_line ('Thank you');
end;
/
SQL> Exec demo2
Ex 7:
---------
We can call multiple procedures at a time using PL/SQL block.
begin
p1;
add_num(10,20);
inc_sal(7900);
end;
/
Ex 8:
--------
If there are any syntax errors in the procedure code, then the
procedcure is created with compilation errors.
create or replace procedure add_num ( a IN number,
b IN number)
is
c number(3);
begin
c := a+b;
dbms_outut.put_line(' The sum is '||c);
end;
/
Procedure is created with compilation errrors.
To see the errors, use the following command.
SQL> sho err
We get error information.
Rectify the error and re compile the code to create procedure successfully.
Ex 9:
---------
Sub procedure: A procedure inside another procedure is called as
Sub procedure.
create or replace procedure test
is
26. procedure sample
is
begin
dbms_output.put_line('This is from sample');
end;
begin
dbms_output.put_line('This is from test');
sample;
end;
In the above example procedure sample is called as Sub procedure.
A Sub procedure can be invoked from the main procedure only.
SQL> EXEC test
This is from test
This is from sample
We cannot invoke the Sub procedure independently.
The following command will give error.
SQL>EXEC sample
Ex 10:
----------
OUT parameters are used to return the values to the calling environment.
create a procedure which accepts empno and return salary.
create or replace procedure ret_sal( l_empno in emp.empno%type,
l_sal out emp.sal%type)
is
begin
select sal into l_sal from emp
where empno = l_empno;
end;
As the procedure is returning a value using OUT parameter,
we need to have a bind variable to catch the value. We need to follow a 3 step process to execute
the above procedure.
Step 1: Create bind variable
Step 2: Execute the procedure using bind variable
Step 3: Print the value in the bind variable.
Step 1: creating Bind variable
SQL> variable g_sal number
Step 2: Invoking the procedure using bind variable
SQL> Exec ret_sal( 7900, :g_sal)
Step 3: Print the value in the bind variable
SQL> Print g_sal
27. Ex 11:
-----------------
IN OUT parameters are used to accept the value as well as return the values to the calling
environment.
Create a procedure which accepts a number and return its square.
create or replace procedure cal_square( a In OUT number)
is
begin
a := a*a;
end;
/
To run the above proceure we need to follow a four step process.
Step 1: Create Bind variable
Step 2: Initiate the Bind variable
Step 3: Invoke the procedure using bind varaible
Step 4: Print the value in the bind variable
Step 1:
SQL> Variable n number
Step 2:
begin
:n :=5;
end;
/
Step 3:
SQL> Exec cal_square (:n)
Step 4:
SQL> Print n
Ex 12:
------------
To see the list of procedures, use the following queries
SQL> select object_name from user_objects where
object_type='PROCEDURE';
or
SQL> select procedure_name from user_procedures.
Ex 13:
-------
Using Default keyword:
-----------------------
28. create or replace procedure add_num3( a number,
b number default 100,
c number default 200)
is
d number(5);
begin
d := a+b+c;
dbms_output.put_line('The sum is ...'||d);
end;
/
Procedure created.
To execute the procedure
SQL> EXEC add_num3(10,20,30)
Output: The sum is 60
SQL> Exec add_num3(10,20)
Output : The sum is 230
Note: Default value is considered if we do not pass any value.
SQL> You need to use arrow operator if you pass values to specific parameters
Ex:
SQL> Exec add_num3(a=>10, c =>20)
Output: The sum is 130
Default value 100 is considered for parameter b.
ex 14:
----------
If there are any errors in the procedure code, then procedure is created with compilation errors.
To see the compilation errors SHO ERR command is used.
We need to rectify the errors and recreate the procedure sucessfully.
Ex 15:
-----------
To see the code of the existing procedure
select text from user_source
where name =ADD_NUM3;
TO drop a procedure:
-----------------------
SQL> Drop Procedure <procedure_name>;
Ex:
SQL> Drop procedure add_num;
Functions:-
Function is a PL/SQL block which must and should return single value.
29. Syntax:
-----------
Create or replace function <Function_name>
( <Par_name> <mode> <datatype>,
,, ,, ,, )
return datatype
is
Begin
..........
.........
end;
/
ex1:
-----
Create a function which accepts two numbers and display its sum.
create or replace function add_num_f1 ( a number, b number)
return number
is
c number(5);
begin
c :=a+b;
return c;
end;
/
To invoke a function from a pl/Sql block:
---------------------------------------------
declare
n number(5);
begin
n := add_num_f1(20,40);
dbms_output.put_line('The sum is '||n);
end;
/
We can invoke functions from select stmt:
----------------------------------------------
select add_num_f1(30,50) from dual;
Functions can be invoked as part of an expression:
----------------------------------------------------
select 100 + add_num_f1(50,10) from dual;
Ex2:
------
30. create a function which accepts sal and returns tax value ( 10% of sal is tax).
create or replace function cal_tax ( a number)
is
begin
return a*10/100;
end;
/
Note: A function can return a value using return statement.
Ex 3:
----------
Have a look at the following function:
create or replace function add_num_f2 ( a number, b number)
return number
is
c number(5);
begin
insert into dept values (50,'HR','HYDERABAD')
c :=a+b;
return c;
end;
/
The above function gets created.
The above function can be invoked from the pl/SQL block
declare
n number(5);
begin
n := add_num_f2(20,40);
dbms_output.put_line('The sum is '||n);
end;
/
But, we cannot invoke the above function using select stmt.
ex:
select add_num_f2(30,50) from dual; -- will give us error.
Note: So, functions with dml commands cannot be invoked from select stmt.
------------------------
TO see the list of all the functions
31. select object_name from user_objects
where object_type = 'FUNCTION';
----------------------
To drop a function
drop function <function_name>;
ex:
drop function add_num_f2;
-----------------------
Functions are mainly used for calculation purposes.
Rest of the activities, prefer procedures.
Packages:-
cPackages are logically related sub programs.
Package creating involves two steps.
Step 1: Creating Package specification (PKS )
Step 2: Creating Package Body ( PKB )
Package Specification:
-----------------------------
It contains declaration of sub programs
Syntax:
----------
create or replace package <package_name>
is
declaration of procedures;
declaration of functions;
end;
/
Package Body:
-----------------------------
It contains definition of sub programs
Syntax:
----------
create or replace package body <package_name>
is
definition of procedures;
definition of functions;
32. end;
/
Ex:
----
Lets create a package with two procedures and function.
Procedure add_num -- which takes two parameters and display its sum.
Procedure display_emp -- which accepts empno and display ename and sal.
Function cal_tax -- which accepts sal and returns tax value (10% of sal is tax value ).
Package Specification:
---------------------------
create or replace package test_pack
is
procedure add_num ( a number,
b number);
procedure display_emp ( l_empno emp.empno%type);
function cal_tax ( l_sal emp.sal%type)
return number;
end test_pack;
/
Package body:
--------------------------
create or replace package body test_pack
is
procedure add_num ( a number,
b number)
is
c number;
begin
c := a+b;
dbms_output.put_line('The sum is '||c);
end;
procedure display_emp (l_empno emp.empno%type)
is
l_ename emp.ename%type;
l_sal emp.sal%type;
begin
select sal into l_sal from emp
where empno = l_empno;
dbms_output.put_line(l_ename||'.......'||l_sal);
end;
33. function cal_tax ( l_sal emp.sal%type)
is
l_tax number;
begin
l_tax := l_sal *10/100;
return l_tax;
end;
end test_pack;
/
To invoke sub programs inside the package:
--------------------------------------------
SQL> EXEC test_pack.display_emp (7900)
SQL> select empno, ename, sal, test_pack.cal_tax (sal) from emp;
Procedure overloading using packages:
---------------------------------------
We can achieve procedure overloading using Packages.
Basing on the no of parameters and datatype of the parameters,
the appropriate procedure is invoked.
ex:
----
Create or replace package test_pack2
is
procedure p1 ( a number,
b number);
procedure p1 ( a number);
end test_pack2;
/
create or replace package body test_pack2
is
procedure p1 ( a number,
b number)
is
c number;
begin
c := a+b;
dbms_output.put_line('The sum is'||c);
end;
procedure p1 ( a number)
is
begin
34. dbms_output.put_line('The square of the number is '||a*a);
end;
end test_pack2;
/
In the above package there are two procedures with the same name.
Appropriate procedure is invoked basing on the no of parameters which are passed
at the time of calling the procedure.
Ex:
--
SQL> exec test_pack2(10, 20);
The sum is 30
SQL> exec test_pack2(10);
The square of the number is 100
To drop the package:
----------------------------
We need to drop package bodu first and then the package specification.
Drop package body <package_name>;
Drop package <package_name>;
Ex:
------
Drop package body test_pack2;
Drop package test_pack2;
Guidelines of the packages:
----------------------------
1) Helps in modularity of the code.
2) Packages cannot be nested.
3) Packages cannot be parameterized.
Triggers:-
Trigger is a PL/SQL block which is executed automatically
basing on a event.
Triggering events: Insert, Update, Delete
Trigger timings: Before, after, instead of
Syntax:
------
Create or replace trigger <trg_name>
<timing> <event> on <table_name>
begin
35. .............
.............
.............
end;
/
ex:
----
create or replace trigger trg1
after insert on dept
begin
dbms_output.put_line('Thank You');
end;
/
Trigger Created.
Now, when we peroform the event, trigger is executed,.
ex:
----
insert into dept values (52,'HR','HYDERABAD');
Thank You
1 row created.
We get the message, 'Thank You'.
That means trigger is executed.
We can create triggers on multiple events.
ex:
-----
create or replace trigger trg1
after insert or update or delete on dept
begin
dbms_output.put_line('Thank You');
end;
/
Trigger created.
Now, for all the three events , triggger is fired.
ex:
--
Update dept set loc='DELHI'
where deptno =10;
Thank You
1 Row updated.
36. delete from dept where deptno=50;
Thank you
1 Row deleted.
In the above program, we get the same message for all the events.
We can also have different messages to be displayed, basing on the events.
Ex:
------
create or replace trigger trg1
after insert or update or delete on dept
begin
if inserting then
dbms_output.put_line('Thank You for inserting');
elsif updating then
dbms_output.put_line('Thank You for updating');
else
dbms_output.put_line('Thank You for deleting');
end if;
end;
/
Trigger created.
In the above program, inserting and updating are the key words which are used to identify the
events.
Triggers can be classified into two types, basing on the no of times it is executed.
1) Statement level triggers
2) Row level triggers
1) Statement level triggers are executed only once, irrespective of no of rows effected by the
event.
2) Row level triggers are executed for every row effected by the event.
To create a row level trigger, we need to use
for-each-row clause.
ex:
-----
create or replace trigger trg1
after update on emp for each row
begin
dbms_output.put_line('Thank you for updating');
end;
/
Trigger created.
37. update emp set sal=2000
where deptno=10;
Thank you for updating
Thank you for updating
Thank you for updating
3 rows updated.
As, the update command is effecting 3 rows, trigger is executed 3 times.
These kind of triggers are called row level triggers.
Triggers are used to enforce business rules by
using :OLD and :NEW qualifiers.
ex:
----
Create a trigger which restrict insert operation
if sal >5000.
create or replace trigger trg1
before insert on emp for each row
begin
if :new.sal >5000 then
raise_application_error(-20150,
' Sal cannot be more than 5000');
end if;
end;
/
Trigger Created.
Event:
--------
insert into emp( empno, ename,sal, deptno )
values (1111,'ARUN', 6000,10);
ERROR:
ORA-20150, sal cannot be more than 5000
Ex:
--------
Create a trigger which restrict delete operation on emp
if job is president.
create or replace trigger trg1
before delete on emp for each row
begin
if :OLD.JOB='PRESIDENT' then
38. raise_application_error(-20151,
' cannot delete president');
end if;
end;
/
Trigger created.
Event:
---------
delete from emp where ename='KING';
Error:
ORA-20151, cannot delete president
Instead of triggers:
------------------------
Instead of triggers are helpful to perform DML operations on complex view.
Example of complex view:
------------------------
create or replace view emp_dept_v
as
select e.empno, e.ename, e.sal, e.deptno, d.dname, d.loc
from emp e, dept d
where e.deptno = d.deptno;
View created.
Generally, we cannot insert row into complex view.
But, by using the instead of triggers, we can do it.
ex:
----
create or replace trigger trg1
instead of insert on emp_dept_v for each row
begin
insert into dept values (:NEW.deptno,:NEW.dname, :NEW.loc);
insert into emp ( empno, ename,sal, deptno) values
(:NEW.empno, :NEW.ename,:NEW.sal, :NEW.deptno);
end;
/
Trigger Created.
Event:
------
insert into emp_dept_v values (2121,'VIJAY',3000,60,'TRAINING','HYDERABAD');
1 Row created.
39. To see the list of triggers:
-------------------------------
select trigger_name from user_triggers;
To drop a trigger:
------------------
Drop trigger <trigger_name>;
Ex:
-----
Drop trigger trg1;
Trigger Droped.